Skip to content

Commit 0be2900

Browse files
committed
2019-12-30
1 parent 0f5bd7c commit 0be2900

File tree

11 files changed

+71
-0
lines changed

11 files changed

+71
-0
lines changed

baseocr/.gitignore

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

baseocr/build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 29
5+
buildToolsVersion "29.0.2"
6+
7+
defaultConfig {
8+
minSdkVersion 15
9+
targetSdkVersion 29
10+
versionCode 1
11+
versionName "1.0"
12+
}
13+
}
14+
15+
dependencies {
16+
}
17+
18+
//发布 Jcenter
19+
apply from: 'bintray.gradle'

baseocr/consumer-rules.pro

Whitespace-only changes.

baseocr/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

baseocr/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.shouzhong.baseocr" />
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.shouzhong.baseocr;
2+
3+
import com.ym.idcard.reg.NativeOcrIn;
4+
5+
public class OcrUtils {
6+
7+
private static final String PACKAGE_NAME = "com.tomcat.ocr.idcard";
8+
private static final String APP_SHA1 = "19:F4:E8:B7:A9:EE:A3:67:90:07:B0:C6:56:8D:AD:60:44:AB:6D:C9";
9+
private static final String OCR_API_KEY = "26f1f6a0d4d7cb0dd0e9b28f4cedef83";
10+
11+
public static void init() {
12+
NativeOcrIn.start(PACKAGE_NAME, APP_SHA1, OCR_API_KEY);
13+
}
14+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.ym.idcard.reg;
2+
3+
public class NativeOcrIn {
4+
static {
5+
System.loadLibrary("ocr");
6+
}
7+
8+
public static native int start(String pkg, String sha1, String key);
9+
10+
public static native boolean res();
11+
}
13.5 KB
Binary file not shown.
13.5 KB
Binary file not shown.
9.41 KB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">ocrlib</string>
3+
</resources>

0 commit comments

Comments
 (0)