Skip to content

Commit a4cafc0

Browse files
committed
update
- added project code - upgraded android SDK version into the latest one according to the new Google play policy - linked every contact items
1 parent a7c24b6 commit a4cafc0

Some content is hidden

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

64 files changed

+2412
-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: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
}
5+
6+
android {
7+
namespace 'com.kbyai.idcardrecognition'
8+
compileSdk 34
9+
10+
defaultConfig {
11+
applicationId "com.kbyai.idcardrecognition"
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.9.0'
44+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
45+
46+
implementation project(path: ':libidsdk')
47+
48+
implementation 'com.itextpdf:itextpdf:5.5.10'
49+
50+
// PDF library
51+
implementation 'io.fotoapparat:fotoapparat:2.7.0'
52+
53+
testImplementation 'junit:junit:4.13.2'
54+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
55+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
56+
}

app/idcard.jks

2.62 KB
Binary file not shown.

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.idcardrecognition
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.idcardrecognition", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

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

0 commit comments

Comments
 (0)