-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added project code - upgraded android SDK version into the latest one according to the new Google play policy - linked every contact items
- Loading branch information
1 parent
a7c24b6
commit a4cafc0
Showing
64 changed files
with
2,412 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties | ||
/.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
plugins { | ||
id 'com.android.application' | ||
id 'org.jetbrains.kotlin.android' | ||
} | ||
|
||
android { | ||
namespace 'com.kbyai.idcardrecognition' | ||
compileSdk 34 | ||
|
||
defaultConfig { | ||
applicationId "com.kbyai.idcardrecognition" | ||
minSdk 24 | ||
targetSdk 34 | ||
versionCode 5 | ||
versionName "1.4" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
|
||
ndk { | ||
abiFilters 'arm64-v8a', 'armeabi-v7a' | ||
} | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation 'androidx.core:core-ktx:1.7.0' | ||
implementation 'androidx.appcompat:appcompat:1.6.1' | ||
implementation 'com.google.android.material:material:1.9.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||
|
||
implementation project(path: ':libidsdk') | ||
|
||
implementation 'com.itextpdf:itextpdf:5.5.10' | ||
|
||
// PDF library | ||
implementation 'io.fotoapparat:fotoapparat:2.7.0' | ||
|
||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.5' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
app/src/androidTest/java/com/kbyai/idcardrecognition/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.kbyai.idcardrecognition | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.kbyai.idcardrecognition", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<uses-permission android:name="android.permission.CAMERA" /> | ||
<uses-feature android:name="android.hardware.camera" /> | ||
<!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />--> | ||
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />--> | ||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />--> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:dataExtractionRules="@xml/data_extraction_rules" | ||
android:fullBackupContent="@xml/backup_rules" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.IDCardRecognition" | ||
tools:targetApi="31"> | ||
<activity | ||
android:name=".CameraActivityKt" | ||
android:exported="false" /> | ||
|
||
<activity | ||
android:name=".MainActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity | ||
android:name=".AboutActivity" | ||
android:exported="false" /> | ||
<activity | ||
android:name=".ResultActivity" | ||
android:exported="false" | ||
android:screenOrientation="portrait" /> | ||
<provider | ||
android:name="androidx.core.content.FileProvider" | ||
android:authorities="com.kbyai.idcardrecognition.fileprovider" | ||
android:exported="false" | ||
android:grantUriPermissions="true"> | ||
<meta-data | ||
android:name="android.support.FILE_PROVIDER_PATHS" | ||
android:resource="@xml/file_paths" /> <!-- Define your file paths XML resource --> | ||
</provider> | ||
</application> | ||
|
||
</manifest> |
150 changes: 150 additions & 0 deletions
150
app/src/main/java/com/kbyai/idcardrecognition/AboutActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
package com.kbyai.idcardrecognition | ||
|
||
import android.content.Intent | ||
import android.content.pm.ResolveInfo | ||
import android.net.Uri | ||
import android.os.Bundle | ||
import android.widget.TextView | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.kbyai.idcardrecognition.R | ||
|
||
|
||
class AboutActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_about) | ||
|
||
findViewById<TextView>(R.id.txtMail).setOnClickListener { | ||
val intent = Intent(Intent.ACTION_SEND) | ||
intent.type = "plain/text" | ||
intent.putExtra(Intent.EXTRA_EMAIL, arrayOf("contact@kby-ai.com")) | ||
intent.putExtra(Intent.EXTRA_SUBJECT, "License Request") | ||
intent.putExtra(Intent.EXTRA_TEXT, "") | ||
startActivity(Intent.createChooser(intent, "")) | ||
} | ||
|
||
findViewById<TextView>(R.id.txtWhatsapp).setOnClickListener { | ||
val general = Intent(Intent.ACTION_VIEW, Uri.parse("https://com.whatsapp/kbyai")) | ||
val generalResolvers: HashSet<String> = HashSet() | ||
val generalResolveInfo: List<ResolveInfo> = packageManager.queryIntentActivities(general, 0) | ||
for (info in generalResolveInfo) { | ||
if (info.activityInfo.packageName != null) { | ||
generalResolvers.add(info.activityInfo.packageName) | ||
} | ||
} | ||
|
||
val telegram = Intent(Intent.ACTION_VIEW, Uri.parse("https://wa.me/19092802609")) | ||
var goodResolver = 0 | ||
|
||
val resInfo: List<ResolveInfo> = packageManager.queryIntentActivities(telegram, 0) | ||
if (!resInfo.isEmpty()) { | ||
for (info in resInfo) { | ||
if (info.activityInfo.packageName != null && !generalResolvers.contains(info.activityInfo.packageName)) { | ||
goodResolver++ | ||
telegram.setPackage(info.activityInfo.packageName) | ||
} | ||
} | ||
} | ||
|
||
if (goodResolver != 1) { | ||
telegram.setPackage(null) | ||
} | ||
if (telegram.resolveActivity(packageManager) != null) { | ||
startActivity(telegram) | ||
} | ||
} | ||
|
||
findViewById<TextView>(R.id.txtTelegram).setOnClickListener { | ||
val general = Intent(Intent.ACTION_VIEW, Uri.parse("https://t.com/kbyai")) | ||
val generalResolvers: HashSet<String> = HashSet() | ||
val generalResolveInfo: List<ResolveInfo> = packageManager.queryIntentActivities(general, 0) | ||
for (info in generalResolveInfo) { | ||
if (info.activityInfo.packageName != null) { | ||
generalResolvers.add(info.activityInfo.packageName) | ||
} | ||
} | ||
|
||
val telegram = Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/kbyai")) | ||
var goodResolver = 0 | ||
|
||
val resInfo: List<ResolveInfo> = packageManager.queryIntentActivities(telegram, 0) | ||
if (!resInfo.isEmpty()) { | ||
for (info in resInfo) { | ||
if (info.activityInfo.packageName != null && !generalResolvers.contains(info.activityInfo.packageName)) { | ||
goodResolver++ | ||
telegram.setPackage(info.activityInfo.packageName) | ||
} | ||
} | ||
} | ||
|
||
if (goodResolver != 1) { | ||
telegram.setPackage(null) | ||
} | ||
if (telegram.resolveActivity(packageManager) != null) { | ||
startActivity(telegram) | ||
} | ||
} | ||
|
||
findViewById<TextView>(R.id.txtSkype).setOnClickListener { | ||
val general = Intent(Intent.ACTION_VIEW, Uri.parse("https://com.skype/kbyai")) | ||
val generalResolvers: HashSet<String> = HashSet() | ||
val generalResolveInfo: List<ResolveInfo> = packageManager.queryIntentActivities(general, 0) | ||
for (info in generalResolveInfo) { | ||
if (info.activityInfo.packageName != null) { | ||
generalResolvers.add(info.activityInfo.packageName) | ||
} | ||
} | ||
|
||
val telegram = Intent(Intent.ACTION_VIEW, Uri.parse("https://join.skype.com/invite/OffY2r1NUFev")) | ||
var goodResolver = 0 | ||
|
||
val resInfo: List<ResolveInfo> = packageManager.queryIntentActivities(telegram, 0) | ||
if (!resInfo.isEmpty()) { | ||
for (info in resInfo) { | ||
if (info.activityInfo.packageName != null && !generalResolvers.contains(info.activityInfo.packageName)) { | ||
goodResolver++ | ||
telegram.setPackage(info.activityInfo.packageName) | ||
} | ||
} | ||
} | ||
|
||
if (goodResolver != 1) { | ||
telegram.setPackage(null) | ||
} | ||
if (telegram.resolveActivity(packageManager) != null) { | ||
startActivity(telegram) | ||
} | ||
} | ||
|
||
findViewById<TextView>(R.id.txtGitHub).setOnClickListener { | ||
val general = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/kby-ai")) | ||
val generalResolvers: HashSet<String> = HashSet() | ||
val generalResolveInfo: List<ResolveInfo> = packageManager.queryIntentActivities(general, 0) | ||
for (info in generalResolveInfo) { | ||
if (info.activityInfo.packageName != null) { | ||
generalResolvers.add(info.activityInfo.packageName) | ||
} | ||
} | ||
|
||
val telegram = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/kby-ai")) | ||
var goodResolver = 0 | ||
|
||
val resInfo: List<ResolveInfo> = packageManager.queryIntentActivities(telegram, 0) | ||
if (!resInfo.isEmpty()) { | ||
for (info in resInfo) { | ||
if (info.activityInfo.packageName != null && !generalResolvers.contains(info.activityInfo.packageName)) { | ||
goodResolver++ | ||
telegram.setPackage(info.activityInfo.packageName) | ||
} | ||
} | ||
} | ||
|
||
if (goodResolver != 1) { | ||
telegram.setPackage(null) | ||
} | ||
if (telegram.resolveActivity(packageManager) != null) { | ||
startActivity(telegram) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.