Skip to content

Commit 02f5b56

Browse files
committed
update
1 parent 8ba4a13 commit 02f5b56

File tree

80 files changed

+5311
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+5311
-0
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
/.idea/

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
}
5+
6+
android {
7+
namespace 'com.kbyai.faceattribute'
8+
compileSdk 34
9+
10+
defaultConfig {
11+
applicationId "com.kbyai.activelive"
12+
minSdk 24
13+
targetSdk 34
14+
versionCode 5
15+
versionName "1.4"
16+
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18+
19+
ndk {
20+
abiFilters 'arm64-v8a', 'armeabi-v7a'
21+
}
22+
}
23+
24+
buildTypes {
25+
release {
26+
minifyEnabled false
27+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
28+
}
29+
}
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
33+
}
34+
kotlinOptions {
35+
jvmTarget = '1.8'
36+
}
37+
}
38+
39+
dependencies {
40+
41+
implementation 'androidx.core:core-ktx:1.7.0'
42+
implementation 'androidx.appcompat:appcompat:1.6.1'
43+
implementation 'com.google.android.material:material:1.8.0'
44+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
45+
implementation 'androidx.preference:preference:1.2.0'
46+
implementation 'androidx.preference:preference-ktx:1.2.0'
47+
48+
implementation "androidx.camera:camera-core:1.0.0-beta12"
49+
implementation "androidx.camera:camera-camera2:1.0.0-beta12"
50+
implementation "androidx.camera:camera-lifecycle:1.0.0-beta12"
51+
implementation 'androidx.camera:camera-view:1.0.0-alpha19'
52+
53+
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
54+
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
55+
implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.9.1'
56+
57+
implementation project(path: ':libfacesdk')
58+
59+
// implementation 'io.fotoapparat:fotoapparat:2.7.0'
60+
implementation project(path: ':libfotoapparat')
61+
62+
testImplementation 'junit:junit:4.13.2'
63+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
64+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
65+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.kbyai.faceattribute
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.kbyai.faceattribute", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.CAMERA" />
6+
7+
<uses-feature android:name="android.hardware.camera" />
8+
<uses-permission android:name="android.permission.VIBRATE" />
9+
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
10+
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
11+
12+
<application
13+
android:allowBackup="true"
14+
android:dataExtractionRules="@xml/data_extraction_rules"
15+
android:fullBackupContent="@xml/backup_rules"
16+
android:icon="@mipmap/ic_launcher"
17+
android:label="@string/app_name"
18+
android:supportsRtl="true"
19+
android:theme="@style/Theme.FaceAttribute"
20+
tools:targetApi="31">
21+
<activity
22+
android:name=".AboutActivity"
23+
android:exported="false" />
24+
25+
<activity
26+
android:name=".SettingsActivity"
27+
android:exported="false"
28+
android:label="@string/title_activity_settings"
29+
android:screenOrientation="portrait" />
30+
31+
<activity
32+
android:name=".CameraActivity"
33+
android:exported="false"
34+
android:screenOrientation="portrait" />
35+
36+
<activity
37+
android:name=".CaptureActivityKt"
38+
android:exported="false"
39+
android:screenOrientation="portrait" />
40+
41+
<activity
42+
android:name=".MainActivity"
43+
android:exported="true"
44+
android:screenOrientation="portrait">
45+
<intent-filter>
46+
<action android:name="android.intent.action.MAIN" />
47+
48+
<category android:name="android.intent.category.LAUNCHER" />
49+
</intent-filter>
50+
</activity>
51+
</application>
52+
53+
</manifest>
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
package com.kbyai.faceattribute
2+
3+
import android.content.Intent
4+
import android.content.pm.ResolveInfo
5+
import android.net.Uri
6+
import android.os.Bundle
7+
import android.widget.TextView
8+
import androidx.appcompat.app.AppCompatActivity
9+
10+
11+
class AboutActivity : AppCompatActivity() {
12+
override fun onCreate(savedInstanceState: Bundle?) {
13+
super.onCreate(savedInstanceState)
14+
setContentView(R.layout.activity_about)
15+
16+
findViewById<TextView>(R.id.txtMail).setOnClickListener {
17+
val intent = Intent(Intent.ACTION_SEND)
18+
intent.type = "plain/text"
19+
intent.putExtra(Intent.EXTRA_EMAIL, arrayOf("contact@kby-ai.com"))
20+
intent.putExtra(Intent.EXTRA_SUBJECT, "License Request")
21+
intent.putExtra(Intent.EXTRA_TEXT, "")
22+
startActivity(Intent.createChooser(intent, ""))
23+
}
24+
25+
findViewById<TextView>(R.id.txtWhatsapp).setOnClickListener {
26+
val general = Intent(Intent.ACTION_VIEW, Uri.parse("https://com.whatsapp/kbyai"))
27+
val generalResolvers: HashSet<String> = HashSet()
28+
val generalResolveInfo: List<ResolveInfo> = packageManager.queryIntentActivities(general, 0)
29+
for (info in generalResolveInfo) {
30+
if (info.activityInfo.packageName != null) {
31+
generalResolvers.add(info.activityInfo.packageName)
32+
}
33+
}
34+
35+
val telegram = Intent(Intent.ACTION_VIEW, Uri.parse("https://wa.me/19092802609"))
36+
var goodResolver = 0
37+
38+
val resInfo: List<ResolveInfo> = packageManager.queryIntentActivities(telegram, 0)
39+
if (!resInfo.isEmpty()) {
40+
for (info in resInfo) {
41+
if (info.activityInfo.packageName != null && !generalResolvers.contains(info.activityInfo.packageName)) {
42+
goodResolver++
43+
telegram.setPackage(info.activityInfo.packageName)
44+
}
45+
}
46+
}
47+
48+
if (goodResolver != 1) {
49+
telegram.setPackage(null)
50+
}
51+
if (telegram.resolveActivity(packageManager) != null) {
52+
startActivity(telegram)
53+
}
54+
}
55+
56+
findViewById<TextView>(R.id.txtTelegram).setOnClickListener {
57+
val general = Intent(Intent.ACTION_VIEW, Uri.parse("https://t.com/kbyai"))
58+
val generalResolvers: HashSet<String> = HashSet()
59+
val generalResolveInfo: List<ResolveInfo> = packageManager.queryIntentActivities(general, 0)
60+
for (info in generalResolveInfo) {
61+
if (info.activityInfo.packageName != null) {
62+
generalResolvers.add(info.activityInfo.packageName)
63+
}
64+
}
65+
66+
val telegram = Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/kbyai"))
67+
var goodResolver = 0
68+
69+
val resInfo: List<ResolveInfo> = packageManager.queryIntentActivities(telegram, 0)
70+
if (!resInfo.isEmpty()) {
71+
for (info in resInfo) {
72+
if (info.activityInfo.packageName != null && !generalResolvers.contains(info.activityInfo.packageName)) {
73+
goodResolver++
74+
telegram.setPackage(info.activityInfo.packageName)
75+
}
76+
}
77+
}
78+
79+
if (goodResolver != 1) {
80+
telegram.setPackage(null)
81+
}
82+
if (telegram.resolveActivity(packageManager) != null) {
83+
startActivity(telegram)
84+
}
85+
}
86+
87+
findViewById<TextView>(R.id.txtSkype).setOnClickListener {
88+
val general = Intent(Intent.ACTION_VIEW, Uri.parse("https://com.skype/kbyai"))
89+
val generalResolvers: HashSet<String> = HashSet()
90+
val generalResolveInfo: List<ResolveInfo> = packageManager.queryIntentActivities(general, 0)
91+
for (info in generalResolveInfo) {
92+
if (info.activityInfo.packageName != null) {
93+
generalResolvers.add(info.activityInfo.packageName)
94+
}
95+
}
96+
97+
val telegram = Intent(Intent.ACTION_VIEW, Uri.parse("https://join.skype.com/invite/OffY2r1NUFev"))
98+
var goodResolver = 0
99+
100+
val resInfo: List<ResolveInfo> = packageManager.queryIntentActivities(telegram, 0)
101+
if (!resInfo.isEmpty()) {
102+
for (info in resInfo) {
103+
if (info.activityInfo.packageName != null && !generalResolvers.contains(info.activityInfo.packageName)) {
104+
goodResolver++
105+
telegram.setPackage(info.activityInfo.packageName)
106+
}
107+
}
108+
}
109+
110+
if (goodResolver != 1) {
111+
telegram.setPackage(null)
112+
}
113+
if (telegram.resolveActivity(packageManager) != null) {
114+
startActivity(telegram)
115+
}
116+
}
117+
118+
findViewById<TextView>(R.id.txtGitHub).setOnClickListener {
119+
val general = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/kby-ai"))
120+
val generalResolvers: HashSet<String> = HashSet()
121+
val generalResolveInfo: List<ResolveInfo> = packageManager.queryIntentActivities(general, 0)
122+
for (info in generalResolveInfo) {
123+
if (info.activityInfo.packageName != null) {
124+
generalResolvers.add(info.activityInfo.packageName)
125+
}
126+
}
127+
128+
val telegram = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/kby-ai"))
129+
var goodResolver = 0
130+
131+
val resInfo: List<ResolveInfo> = packageManager.queryIntentActivities(telegram, 0)
132+
if (!resInfo.isEmpty()) {
133+
for (info in resInfo) {
134+
if (info.activityInfo.packageName != null && !generalResolvers.contains(info.activityInfo.packageName)) {
135+
goodResolver++
136+
telegram.setPackage(info.activityInfo.packageName)
137+
}
138+
}
139+
}
140+
141+
if (goodResolver != 1) {
142+
telegram.setPackage(null)
143+
}
144+
if (telegram.resolveActivity(packageManager) != null) {
145+
startActivity(telegram)
146+
}
147+
}
148+
}
149+
}

0 commit comments

Comments
 (0)