Commit c59f2c72e07ae98afbf2ef98d290625632ce4f20
0 parents
项目初始化
Showing
18 changed files
with
916 additions
and
0 deletions
.DS_Store
0 → 100644
No preview for this file type
.gitattributes
0 → 100644
.gitignore
0 → 100644
README.md
0 → 100644
1 | +++ a/README.md | ||
1 | + | ||
2 | +# react-native-fw-rn-aliface | ||
3 | + | ||
4 | +## Getting started | ||
5 | + | ||
6 | +`$ npm install react-native-fw-rn-aliface --save` | ||
7 | + | ||
8 | +### Mostly automatic installation | ||
9 | + | ||
10 | +`$ react-native link react-native-fw-rn-aliface` | ||
11 | + | ||
12 | +### Manual installation | ||
13 | + | ||
14 | + | ||
15 | +#### iOS | ||
16 | + | ||
17 | +1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` | ||
18 | +2. Go to `node_modules` ➜ `fw-rn-aliface` and add `RNFwRnAliface.xcodeproj` | ||
19 | +3. In XCode, in the project navigator, select your project. Add `libRNFwRnAliface.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` | ||
20 | +4. Run your project (`Cmd+R`)< | ||
21 | + | ||
22 | +#### Android | ||
23 | + | ||
24 | +1. Open up `android/app/src/main/java/[...]/MainActivity.java` | ||
25 | + - Add `import com.feewee.aliface.RNFwRnAlifacePackage;` to the imports at the top of the file | ||
26 | + - Add `new RNFwRnAlifacePackage()` to the list returned by the `getPackages()` method | ||
27 | +2. Append the following lines to `android/settings.gradle`: | ||
28 | + ``` | ||
29 | + include ':react-native-fw-rn-aliface' | ||
30 | + project(':react-native-fw-rn-aliface').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fw-rn-aliface/android') | ||
31 | + ``` | ||
32 | +3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: | ||
33 | + ``` | ||
34 | + compile project(':react-native-fw-rn-aliface') | ||
35 | + ``` | ||
36 | + | ||
37 | + | ||
38 | +## Usage | ||
39 | +```javascript | ||
40 | +import RNFwRnAliface from 'react-native-fw-rn-aliface'; | ||
41 | + | ||
42 | +// TODO: What to do with the module? | ||
43 | +RNFwRnAliface; | ||
44 | +``` | ||
45 | +## 构建文档 | ||
46 | +#### 1.构建项目 | ||
47 | +``` | ||
48 | +https://www.jianshu.com/p/091a68ea1ca7/ | ||
49 | +https://youngjuning.js.org/2019/06/react-native-create-library%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3/ | ||
50 | +``` | ||
51 | +#### 2.修改package.json | ||
52 | +``` | ||
53 | + | ||
54 | +{ | ||
55 | + "name": "fw-rn-aliface", | ||
56 | + "version": "1.0.0", | ||
57 | + "description": "阿里人脸活体检测", | ||
58 | + "main": "index.js", | ||
59 | + "scripts": { | ||
60 | + "test": "echo \"Error: no test specified\" && exit 1", | ||
61 | + "npm:publish": "npm --registry https://registry.npmjs.org/ publish", | ||
62 | + "npm:sync": "curl -i https://npm.taobao.org/sync/fw-rn-aliface", | ||
63 | + "pod:lint": "export LANG=en_US.UTF-8 && pod lib lint TXIm.podspec", | ||
64 | + "pod:install": "cd ios && export LANG=en_US.UTF-8 && pod install" | ||
65 | + }, | ||
66 | + "keywords": [ | ||
67 | + "aliface" | ||
68 | + ], | ||
69 | + "repository": { | ||
70 | + "type": "git", | ||
71 | + "url": "git@gitlab.feewee.cn:FEV2/fw-rn-aliface.git" | ||
72 | + }, | ||
73 | + "homepage": "http://gitlab.feewee.cn/FEV2/fw-rn-aliface", | ||
74 | + "author": "baiyun", | ||
75 | + "license": "MIT", | ||
76 | + "dependencies": { | ||
77 | + "prop-types": "^15.7.2" | ||
78 | + }, | ||
79 | + "peerDependencies": { | ||
80 | + "react": "16.9.0", | ||
81 | + "react-native": "0.61.5" | ||
82 | + } | ||
83 | +} | ||
84 | + | ||
85 | +``` | ||
86 | +####3.修改build.gradle文件 | ||
87 | +``` | ||
88 | +apply plugin: 'com.android.library' | ||
89 | +apply plugin: 'maven' | ||
90 | +apply plugin: 'signing' | ||
91 | + | ||
92 | +buildscript { | ||
93 | + repositories { | ||
94 | + mavenLocal() | ||
95 | + google() | ||
96 | + jcenter() | ||
97 | + maven() { | ||
98 | + url '/usr/local/node/lib/node_modules/react-native/android' | ||
99 | + } | ||
100 | + } | ||
101 | + | ||
102 | + dependencies { | ||
103 | + classpath 'com.android.tools.build:gradle:3.4.0' | ||
104 | + } | ||
105 | +} | ||
106 | + | ||
107 | +repositories { | ||
108 | + mavenLocal() | ||
109 | + google() | ||
110 | + jcenter() | ||
111 | + maven { | ||
112 | + url '/usr/local/node/lib/node_modules/react-native/android' | ||
113 | + } | ||
114 | +} | ||
115 | + | ||
116 | + | ||
117 | +apply plugin: 'com.android.library' | ||
118 | + | ||
119 | +android { | ||
120 | + compileSdkVersion 23 | ||
121 | + buildToolsVersion "23.0.1" | ||
122 | + | ||
123 | + defaultConfig { | ||
124 | + minSdkVersion 16 | ||
125 | + targetSdkVersion 22 | ||
126 | + versionCode 1 | ||
127 | + versionName "1.0" | ||
128 | + } | ||
129 | + | ||
130 | + buildTypes { | ||
131 | + release { | ||
132 | + minifyEnabled false | ||
133 | + } | ||
134 | + } | ||
135 | + | ||
136 | + compileOptions { | ||
137 | + sourceCompatibility JavaVersion.VERSION_1_8 | ||
138 | + targetCompatibility JavaVersion.VERSION_1_8 | ||
139 | + } | ||
140 | +} | ||
141 | + | ||
142 | +signing { | ||
143 | + sign configurations.archives | ||
144 | +} | ||
145 | + | ||
146 | +dependencies { | ||
147 | + compileOnly 'com.facebook.react:react-native:+' | ||
148 | + compileOnly files('src/main/assets') | ||
149 | +} | ||
150 | + | ||
151 | +``` | ||
152 | + |
android/build.gradle
0 → 100644
1 | +++ a/android/build.gradle | ||
1 | +apply plugin: 'com.android.library' | ||
2 | +apply plugin: 'maven' | ||
3 | +apply plugin: 'signing' | ||
4 | + | ||
5 | +buildscript { | ||
6 | + repositories { | ||
7 | + mavenLocal() | ||
8 | + google() | ||
9 | + jcenter() | ||
10 | + maven() { | ||
11 | + url '/usr/local/node/lib/node_modules/react-native/android' | ||
12 | + } | ||
13 | + } | ||
14 | + | ||
15 | + dependencies { | ||
16 | + classpath 'com.android.tools.build:gradle:3.4.0' | ||
17 | + } | ||
18 | +} | ||
19 | + | ||
20 | +repositories { | ||
21 | + mavenLocal() | ||
22 | + google() | ||
23 | + jcenter() | ||
24 | + maven { | ||
25 | + url '/usr/local/node/lib/node_modules/react-native/android' | ||
26 | + } | ||
27 | +} | ||
28 | + | ||
29 | + | ||
30 | +apply plugin: 'com.android.library' | ||
31 | + | ||
32 | +android { | ||
33 | + compileSdkVersion 23 | ||
34 | + buildToolsVersion "23.0.1" | ||
35 | + | ||
36 | + defaultConfig { | ||
37 | + minSdkVersion 16 | ||
38 | + targetSdkVersion 22 | ||
39 | + versionCode 1 | ||
40 | + versionName "1.0" | ||
41 | + } | ||
42 | + | ||
43 | + buildTypes { | ||
44 | + release { | ||
45 | + minifyEnabled false | ||
46 | + } | ||
47 | + } | ||
48 | + | ||
49 | + compileOptions { | ||
50 | + sourceCompatibility JavaVersion.VERSION_1_8 | ||
51 | + targetCompatibility JavaVersion.VERSION_1_8 | ||
52 | + } | ||
53 | +} | ||
54 | + | ||
55 | +signing { | ||
56 | + sign configurations.archives | ||
57 | +} | ||
58 | + | ||
59 | +dependencies { | ||
60 | + compileOnly 'com.facebook.react:react-native:+' | ||
61 | + compileOnly files('src/main/assets') | ||
62 | +} |
android/gradle/wrapper/gradle-wrapper.jar
0 → 100644
No preview for this file type
android/gradle/wrapper/gradle-wrapper.properties
0 → 100644
android/gradlew
0 → 100755
1 | +++ a/android/gradlew | ||
1 | +#!/usr/bin/env sh | ||
2 | + | ||
3 | +# | ||
4 | +# Copyright 2015 the original author or authors. | ||
5 | +# | ||
6 | +# Licensed under the Apache License, Version 2.0 (the "License"); | ||
7 | +# you may not use this file except in compliance with the License. | ||
8 | +# You may obtain a copy of the License at | ||
9 | +# | ||
10 | +# https://www.apache.org/licenses/LICENSE-2.0 | ||
11 | +# | ||
12 | +# Unless required by applicable law or agreed to in writing, software | ||
13 | +# distributed under the License is distributed on an "AS IS" BASIS, | ||
14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
15 | +# See the License for the specific language governing permissions and | ||
16 | +# limitations under the License. | ||
17 | +# | ||
18 | + | ||
19 | +############################################################################## | ||
20 | +## | ||
21 | +## Gradle start up script for UN*X | ||
22 | +## | ||
23 | +############################################################################## | ||
24 | + | ||
25 | +# Attempt to set APP_HOME | ||
26 | +# Resolve links: $0 may be a link | ||
27 | +PRG="$0" | ||
28 | +# Need this for relative symlinks. | ||
29 | +while [ -h "$PRG" ] ; do | ||
30 | + ls=`ls -ld "$PRG"` | ||
31 | + link=`expr "$ls" : '.*-> \(.*\)$'` | ||
32 | + if expr "$link" : '/.*' > /dev/null; then | ||
33 | + PRG="$link" | ||
34 | + else | ||
35 | + PRG=`dirname "$PRG"`"/$link" | ||
36 | + fi | ||
37 | +done | ||
38 | +SAVED="`pwd`" | ||
39 | +cd "`dirname \"$PRG\"`/" >/dev/null | ||
40 | +APP_HOME="`pwd -P`" | ||
41 | +cd "$SAVED" >/dev/null | ||
42 | + | ||
43 | +APP_NAME="Gradle" | ||
44 | +APP_BASE_NAME=`basename "$0"` | ||
45 | + | ||
46 | +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
47 | +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' | ||
48 | + | ||
49 | +# Use the maximum available, or set MAX_FD != -1 to use that value. | ||
50 | +MAX_FD="maximum" | ||
51 | + | ||
52 | +warn () { | ||
53 | + echo "$*" | ||
54 | +} | ||
55 | + | ||
56 | +die () { | ||
57 | + echo | ||
58 | + echo "$*" | ||
59 | + echo | ||
60 | + exit 1 | ||
61 | +} | ||
62 | + | ||
63 | +# OS specific support (must be 'true' or 'false'). | ||
64 | +cygwin=false | ||
65 | +msys=false | ||
66 | +darwin=false | ||
67 | +nonstop=false | ||
68 | +case "`uname`" in | ||
69 | + CYGWIN* ) | ||
70 | + cygwin=true | ||
71 | + ;; | ||
72 | + Darwin* ) | ||
73 | + darwin=true | ||
74 | + ;; | ||
75 | + MINGW* ) | ||
76 | + msys=true | ||
77 | + ;; | ||
78 | + NONSTOP* ) | ||
79 | + nonstop=true | ||
80 | + ;; | ||
81 | +esac | ||
82 | + | ||
83 | +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||
84 | + | ||
85 | +# Determine the Java command to use to start the JVM. | ||
86 | +if [ -n "$JAVA_HOME" ] ; then | ||
87 | + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
88 | + # IBM's JDK on AIX uses strange locations for the executables | ||
89 | + JAVACMD="$JAVA_HOME/jre/sh/java" | ||
90 | + else | ||
91 | + JAVACMD="$JAVA_HOME/bin/java" | ||
92 | + fi | ||
93 | + if [ ! -x "$JAVACMD" ] ; then | ||
94 | + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||
95 | + | ||
96 | +Please set the JAVA_HOME variable in your environment to match the | ||
97 | +location of your Java installation." | ||
98 | + fi | ||
99 | +else | ||
100 | + JAVACMD="java" | ||
101 | + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
102 | + | ||
103 | +Please set the JAVA_HOME variable in your environment to match the | ||
104 | +location of your Java installation." | ||
105 | +fi | ||
106 | + | ||
107 | +# Increase the maximum file descriptors if we can. | ||
108 | +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | ||
109 | + MAX_FD_LIMIT=`ulimit -H -n` | ||
110 | + if [ $? -eq 0 ] ; then | ||
111 | + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||
112 | + MAX_FD="$MAX_FD_LIMIT" | ||
113 | + fi | ||
114 | + ulimit -n $MAX_FD | ||
115 | + if [ $? -ne 0 ] ; then | ||
116 | + warn "Could not set maximum file descriptor limit: $MAX_FD" | ||
117 | + fi | ||
118 | + else | ||
119 | + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||
120 | + fi | ||
121 | +fi | ||
122 | + | ||
123 | +# For Darwin, add options to specify how the application appears in the dock | ||
124 | +if $darwin; then | ||
125 | + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||
126 | +fi | ||
127 | + | ||
128 | +# For Cygwin or MSYS, switch paths to Windows format before running java | ||
129 | +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then | ||
130 | + APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||
131 | + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||
132 | + JAVACMD=`cygpath --unix "$JAVACMD"` | ||
133 | + | ||
134 | + # We build the pattern for arguments to be converted via cygpath | ||
135 | + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
136 | + SEP="" | ||
137 | + for dir in $ROOTDIRSRAW ; do | ||
138 | + ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
139 | + SEP="|" | ||
140 | + done | ||
141 | + OURCYGPATTERN="(^($ROOTDIRS))" | ||
142 | + # Add a user-defined pattern to the cygpath arguments | ||
143 | + if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
144 | + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
145 | + fi | ||
146 | + # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||
147 | + i=0 | ||
148 | + for arg in "$@" ; do | ||
149 | + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||
150 | + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | ||
151 | + | ||
152 | + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | ||
153 | + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||
154 | + else | ||
155 | + eval `echo args$i`="\"$arg\"" | ||
156 | + fi | ||
157 | + i=`expr $i + 1` | ||
158 | + done | ||
159 | + case $i in | ||
160 | + 0) set -- ;; | ||
161 | + 1) set -- "$args0" ;; | ||
162 | + 2) set -- "$args0" "$args1" ;; | ||
163 | + 3) set -- "$args0" "$args1" "$args2" ;; | ||
164 | + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
165 | + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
166 | + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
167 | + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
168 | + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
169 | + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
170 | + esac | ||
171 | +fi | ||
172 | + | ||
173 | +# Escape application args | ||
174 | +save () { | ||
175 | + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | ||
176 | + echo " " | ||
177 | +} | ||
178 | +APP_ARGS=`save "$@"` | ||
179 | + | ||
180 | +# Collect all arguments for the java command, following the shell quoting and substitution rules | ||
181 | +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | ||
182 | + | ||
183 | +exec "$JAVACMD" "$@" |
android/gradlew.bat
0 → 100644
1 | +++ a/android/gradlew.bat | ||
1 | +@rem | ||
2 | +@rem Copyright 2015 the original author or authors. | ||
3 | +@rem | ||
4 | +@rem Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | +@rem you may not use this file except in compliance with the License. | ||
6 | +@rem You may obtain a copy of the License at | ||
7 | +@rem | ||
8 | +@rem https://www.apache.org/licenses/LICENSE-2.0 | ||
9 | +@rem | ||
10 | +@rem Unless required by applicable law or agreed to in writing, software | ||
11 | +@rem distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | +@rem See the License for the specific language governing permissions and | ||
14 | +@rem limitations under the License. | ||
15 | +@rem | ||
16 | + | ||
17 | +@if "%DEBUG%" == "" @echo off | ||
18 | +@rem ########################################################################## | ||
19 | +@rem | ||
20 | +@rem Gradle startup script for Windows | ||
21 | +@rem | ||
22 | +@rem ########################################################################## | ||
23 | + | ||
24 | +@rem Set local scope for the variables with windows NT shell | ||
25 | +if "%OS%"=="Windows_NT" setlocal | ||
26 | + | ||
27 | +set DIRNAME=%~dp0 | ||
28 | +if "%DIRNAME%" == "" set DIRNAME=. | ||
29 | +set APP_BASE_NAME=%~n0 | ||
30 | +set APP_HOME=%DIRNAME% | ||
31 | + | ||
32 | +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
33 | +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" | ||
34 | + | ||
35 | +@rem Find java.exe | ||
36 | +if defined JAVA_HOME goto findJavaFromJavaHome | ||
37 | + | ||
38 | +set JAVA_EXE=java.exe | ||
39 | +%JAVA_EXE% -version >NUL 2>&1 | ||
40 | +if "%ERRORLEVEL%" == "0" goto init | ||
41 | + | ||
42 | +echo. | ||
43 | +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
44 | +echo. | ||
45 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
46 | +echo location of your Java installation. | ||
47 | + | ||
48 | +goto fail | ||
49 | + | ||
50 | +:findJavaFromJavaHome | ||
51 | +set JAVA_HOME=%JAVA_HOME:"=% | ||
52 | +set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||
53 | + | ||
54 | +if exist "%JAVA_EXE%" goto init | ||
55 | + | ||
56 | +echo. | ||
57 | +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||
58 | +echo. | ||
59 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
60 | +echo location of your Java installation. | ||
61 | + | ||
62 | +goto fail | ||
63 | + | ||
64 | +:init | ||
65 | +@rem Get command-line arguments, handling Windows variants | ||
66 | + | ||
67 | +if not "%OS%" == "Windows_NT" goto win9xME_args | ||
68 | + | ||
69 | +:win9xME_args | ||
70 | +@rem Slurp the command line arguments. | ||
71 | +set CMD_LINE_ARGS= | ||
72 | +set _SKIP=2 | ||
73 | + | ||
74 | +:win9xME_args_slurp | ||
75 | +if "x%~1" == "x" goto execute | ||
76 | + | ||
77 | +set CMD_LINE_ARGS=%* | ||
78 | + | ||
79 | +:execute | ||
80 | +@rem Setup the command line | ||
81 | + | ||
82 | +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||
83 | + | ||
84 | +@rem Execute Gradle | ||
85 | +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% | ||
86 | + | ||
87 | +:end | ||
88 | +@rem End local scope for the variables with windows NT shell | ||
89 | +if "%ERRORLEVEL%"=="0" goto mainEnd | ||
90 | + | ||
91 | +:fail | ||
92 | +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||
93 | +rem the _cmd.exe /c_ return code! | ||
94 | +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||
95 | +exit /b 1 | ||
96 | + | ||
97 | +:mainEnd | ||
98 | +if "%OS%"=="Windows_NT" endlocal | ||
99 | + | ||
100 | +:omega |
android/src/main/AndroidManifest.xml
0 → 100644
android/src/main/java/com/feewee/aliface/RNFwRnAlifaceModule.java
0 → 100644
1 | +++ a/android/src/main/java/com/feewee/aliface/RNFwRnAlifaceModule.java | ||
1 | + | ||
2 | +package com.feewee.aliface; | ||
3 | + | ||
4 | +import com.facebook.react.bridge.ReactApplicationContext; | ||
5 | +import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
6 | +import com.facebook.react.bridge.ReactMethod; | ||
7 | +import com.facebook.react.bridge.Callback; | ||
8 | + | ||
9 | +public class RNFwRnAlifaceModule extends ReactContextBaseJavaModule { | ||
10 | + | ||
11 | + private final ReactApplicationContext reactContext; | ||
12 | + | ||
13 | + public RNFwRnAlifaceModule(ReactApplicationContext reactContext) { | ||
14 | + super(reactContext); | ||
15 | + this.reactContext = reactContext; | ||
16 | + } | ||
17 | + | ||
18 | + @Override | ||
19 | + public String getName() { | ||
20 | + return "RNFwRnAliface"; | ||
21 | + } | ||
22 | +} |
android/src/main/java/com/feewee/aliface/RNFwRnAlifacePackage.java
0 → 100644
1 | +++ a/android/src/main/java/com/feewee/aliface/RNFwRnAlifacePackage.java | ||
1 | + | ||
2 | +package com.feewee.aliface; | ||
3 | + | ||
4 | +import java.util.Arrays; | ||
5 | +import java.util.Collections; | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +import com.facebook.react.ReactPackage; | ||
9 | +import com.facebook.react.bridge.NativeModule; | ||
10 | +import com.facebook.react.bridge.ReactApplicationContext; | ||
11 | +import com.facebook.react.uimanager.ViewManager; | ||
12 | +import com.facebook.react.bridge.JavaScriptModule; | ||
13 | +public class RNFwRnAlifacePackage implements ReactPackage { | ||
14 | + @Override | ||
15 | + public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { | ||
16 | + return Arrays.<NativeModule>asList(new RNFwRnAlifaceModule(reactContext)); | ||
17 | + } | ||
18 | + | ||
19 | + // Deprecated from RN 0.47 | ||
20 | + public List<Class<? extends JavaScriptModule>> createJSModules() { | ||
21 | + return Collections.emptyList(); | ||
22 | + } | ||
23 | + | ||
24 | + @Override | ||
25 | + public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { | ||
26 | + return Collections.emptyList(); | ||
27 | + } | ||
28 | +} |
index.js
0 → 100644
ios/RNFwRnAliface.h
0 → 100644
1 | +++ a/ios/RNFwRnAliface.h | ||
1 | + | ||
2 | +#if __has_include("RCTBridgeModule.h") | ||
3 | +#import "RCTBridgeModule.h" | ||
4 | +#else | ||
5 | +#import <React/RCTBridgeModule.h> | ||
6 | +#endif | ||
7 | + | ||
8 | +@interface RNFwRnAliface : NSObject <RCTBridgeModule> | ||
9 | + | ||
10 | +@end | ||
11 | + | ||
0 | \ No newline at end of file | 12 | \ No newline at end of file |
ios/RNFwRnAliface.m
0 → 100644
ios/RNFwRnAliface.podspec
0 → 100644
1 | +++ a/ios/RNFwRnAliface.podspec | ||
1 | + | ||
2 | +Pod::Spec.new do |s| | ||
3 | + s.name = "RNFwRnAliface" | ||
4 | + s.version = "1.0.0" | ||
5 | + s.summary = "RNFwRnAliface" | ||
6 | + s.description = <<-DESC | ||
7 | + RNFwRnAliface | ||
8 | + DESC | ||
9 | + s.homepage = "" | ||
10 | + s.license = "MIT" | ||
11 | + # s.license = { :type => "MIT", :file => "FILE_LICENSE" } | ||
12 | + s.author = { "author" => "author@domain.cn" } | ||
13 | + s.platform = :ios, "7.0" | ||
14 | + s.source = { :git => "https://github.com/author/RNFwRnAliface.git", :tag => "master" } | ||
15 | + s.source_files = "RNFwRnAliface/**/*.{h,m}" | ||
16 | + s.requires_arc = true | ||
17 | + | ||
18 | + | ||
19 | + s.dependency "React" | ||
20 | + #s.dependency "others" | ||
21 | + | ||
22 | +end | ||
23 | + | ||
24 | + | ||
0 | \ No newline at end of file | 25 | \ No newline at end of file |
ios/RNFwRnAliface.xcodeproj/project.pbxproj
0 → 100644
1 | +++ a/ios/RNFwRnAliface.xcodeproj/project.pbxproj | ||
1 | +// !$*UTF8*$! | ||
2 | +{ | ||
3 | + archiveVersion = 1; | ||
4 | + classes = { | ||
5 | + }; | ||
6 | + objectVersion = 46; | ||
7 | + objects = { | ||
8 | + | ||
9 | +/* Begin PBXBuildFile section */ | ||
10 | + B3E7B58A1CC2AC0600A0062D /* RNFwRnAliface.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNFwRnAliface.m */; }; | ||
11 | +/* End PBXBuildFile section */ | ||
12 | + | ||
13 | +/* Begin PBXCopyFilesBuildPhase section */ | ||
14 | + 58B511D91A9E6C8500147676 /* CopyFiles */ = { | ||
15 | + isa = PBXCopyFilesBuildPhase; | ||
16 | + buildActionMask = 2147483647; | ||
17 | + dstPath = "include/$(PRODUCT_NAME)"; | ||
18 | + dstSubfolderSpec = 16; | ||
19 | + files = ( | ||
20 | + ); | ||
21 | + runOnlyForDeploymentPostprocessing = 0; | ||
22 | + }; | ||
23 | +/* End PBXCopyFilesBuildPhase section */ | ||
24 | + | ||
25 | +/* Begin PBXFileReference section */ | ||
26 | + 134814201AA4EA6300B7C361 /* libRNFwRnAliface.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFwRnAliface.a; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
27 | + B3E7B5881CC2AC0600A0062D /* RNFwRnAliface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNFwRnAliface.h; sourceTree = "<group>"; }; | ||
28 | + B3E7B5891CC2AC0600A0062D /* RNFwRnAliface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNFwRnAliface.m; sourceTree = "<group>"; }; | ||
29 | +/* End PBXFileReference section */ | ||
30 | + | ||
31 | +/* Begin PBXFrameworksBuildPhase section */ | ||
32 | + 58B511D81A9E6C8500147676 /* Frameworks */ = { | ||
33 | + isa = PBXFrameworksBuildPhase; | ||
34 | + buildActionMask = 2147483647; | ||
35 | + files = ( | ||
36 | + ); | ||
37 | + runOnlyForDeploymentPostprocessing = 0; | ||
38 | + }; | ||
39 | +/* End PBXFrameworksBuildPhase section */ | ||
40 | + | ||
41 | +/* Begin PBXGroup section */ | ||
42 | + 134814211AA4EA7D00B7C361 /* Products */ = { | ||
43 | + isa = PBXGroup; | ||
44 | + children = ( | ||
45 | + 134814201AA4EA6300B7C361 /* libRNFwRnAliface.a */, | ||
46 | + ); | ||
47 | + name = Products; | ||
48 | + sourceTree = "<group>"; | ||
49 | + }; | ||
50 | + 58B511D21A9E6C8500147676 = { | ||
51 | + isa = PBXGroup; | ||
52 | + children = ( | ||
53 | + B3E7B5881CC2AC0600A0062D /* RNFwRnAliface.h */, | ||
54 | + B3E7B5891CC2AC0600A0062D /* RNFwRnAliface.m */, | ||
55 | + 134814211AA4EA7D00B7C361 /* Products */, | ||
56 | + ); | ||
57 | + sourceTree = "<group>"; | ||
58 | + }; | ||
59 | +/* End PBXGroup section */ | ||
60 | + | ||
61 | +/* Begin PBXNativeTarget section */ | ||
62 | + 58B511DA1A9E6C8500147676 /* RNFwRnAliface */ = { | ||
63 | + isa = PBXNativeTarget; | ||
64 | + buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNFwRnAliface" */; | ||
65 | + buildPhases = ( | ||
66 | + 58B511D71A9E6C8500147676 /* Sources */, | ||
67 | + 58B511D81A9E6C8500147676 /* Frameworks */, | ||
68 | + 58B511D91A9E6C8500147676 /* CopyFiles */, | ||
69 | + ); | ||
70 | + buildRules = ( | ||
71 | + ); | ||
72 | + dependencies = ( | ||
73 | + ); | ||
74 | + name = RNFwRnAliface; | ||
75 | + productName = RCTDataManager; | ||
76 | + productReference = 134814201AA4EA6300B7C361 /* libRNFwRnAliface.a */; | ||
77 | + productType = "com.apple.product-type.library.static"; | ||
78 | + }; | ||
79 | +/* End PBXNativeTarget section */ | ||
80 | + | ||
81 | +/* Begin PBXProject section */ | ||
82 | + 58B511D31A9E6C8500147676 /* Project object */ = { | ||
83 | + isa = PBXProject; | ||
84 | + attributes = { | ||
85 | + LastUpgradeCheck = 0830; | ||
86 | + ORGANIZATIONNAME = Facebook; | ||
87 | + TargetAttributes = { | ||
88 | + 58B511DA1A9E6C8500147676 = { | ||
89 | + CreatedOnToolsVersion = 6.1.1; | ||
90 | + }; | ||
91 | + }; | ||
92 | + }; | ||
93 | + buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNFwRnAliface" */; | ||
94 | + compatibilityVersion = "Xcode 3.2"; | ||
95 | + developmentRegion = English; | ||
96 | + hasScannedForEncodings = 0; | ||
97 | + knownRegions = ( | ||
98 | + en, | ||
99 | + ); | ||
100 | + mainGroup = 58B511D21A9E6C8500147676; | ||
101 | + productRefGroup = 58B511D21A9E6C8500147676; | ||
102 | + projectDirPath = ""; | ||
103 | + projectRoot = ""; | ||
104 | + targets = ( | ||
105 | + 58B511DA1A9E6C8500147676 /* RNFwRnAliface */, | ||
106 | + ); | ||
107 | + }; | ||
108 | +/* End PBXProject section */ | ||
109 | + | ||
110 | +/* Begin PBXSourcesBuildPhase section */ | ||
111 | + 58B511D71A9E6C8500147676 /* Sources */ = { | ||
112 | + isa = PBXSourcesBuildPhase; | ||
113 | + buildActionMask = 2147483647; | ||
114 | + files = ( | ||
115 | + B3E7B58A1CC2AC0600A0062D /* RNFwRnAliface.m in Sources */, | ||
116 | + ); | ||
117 | + runOnlyForDeploymentPostprocessing = 0; | ||
118 | + }; | ||
119 | +/* End PBXSourcesBuildPhase section */ | ||
120 | + | ||
121 | +/* Begin XCBuildConfiguration section */ | ||
122 | + 58B511ED1A9E6C8500147676 /* Debug */ = { | ||
123 | + isa = XCBuildConfiguration; | ||
124 | + buildSettings = { | ||
125 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
126 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
127 | + CLANG_CXX_LIBRARY = "libc++"; | ||
128 | + CLANG_ENABLE_MODULES = YES; | ||
129 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
130 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
131 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
132 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
133 | + CLANG_WARN_EMPTY_BODY = YES; | ||
134 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
135 | + CLANG_WARN_INFINITE_RECURSION = YES; | ||
136 | + CLANG_WARN_INT_CONVERSION = YES; | ||
137 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
138 | + CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
139 | + CLANG_WARN_UNREACHABLE_CODE = YES; | ||
140 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
141 | + COPY_PHASE_STRIP = NO; | ||
142 | + ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
143 | + ENABLE_TESTABILITY = YES; | ||
144 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
145 | + GCC_DYNAMIC_NO_PIC = NO; | ||
146 | + GCC_NO_COMMON_BLOCKS = YES; | ||
147 | + GCC_OPTIMIZATION_LEVEL = 0; | ||
148 | + GCC_PREPROCESSOR_DEFINITIONS = ( | ||
149 | + "DEBUG=1", | ||
150 | + "$(inherited)", | ||
151 | + ); | ||
152 | + GCC_SYMBOLS_PRIVATE_EXTERN = NO; | ||
153 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
154 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
155 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
156 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
157 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
158 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
159 | + IPHONEOS_DEPLOYMENT_TARGET = 8.0; | ||
160 | + MTL_ENABLE_DEBUG_INFO = YES; | ||
161 | + ONLY_ACTIVE_ARCH = YES; | ||
162 | + SDKROOT = iphoneos; | ||
163 | + }; | ||
164 | + name = Debug; | ||
165 | + }; | ||
166 | + 58B511EE1A9E6C8500147676 /* Release */ = { | ||
167 | + isa = XCBuildConfiguration; | ||
168 | + buildSettings = { | ||
169 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
170 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
171 | + CLANG_CXX_LIBRARY = "libc++"; | ||
172 | + CLANG_ENABLE_MODULES = YES; | ||
173 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
174 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
175 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
176 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
177 | + CLANG_WARN_EMPTY_BODY = YES; | ||
178 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
179 | + CLANG_WARN_INFINITE_RECURSION = YES; | ||
180 | + CLANG_WARN_INT_CONVERSION = YES; | ||
181 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
182 | + CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
183 | + CLANG_WARN_UNREACHABLE_CODE = YES; | ||
184 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
185 | + COPY_PHASE_STRIP = YES; | ||
186 | + ENABLE_NS_ASSERTIONS = NO; | ||
187 | + ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
188 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
189 | + GCC_NO_COMMON_BLOCKS = YES; | ||
190 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
191 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
192 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
193 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
194 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
195 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
196 | + IPHONEOS_DEPLOYMENT_TARGET = 8.0; | ||
197 | + MTL_ENABLE_DEBUG_INFO = NO; | ||
198 | + SDKROOT = iphoneos; | ||
199 | + VALIDATE_PRODUCT = YES; | ||
200 | + }; | ||
201 | + name = Release; | ||
202 | + }; | ||
203 | + 58B511F01A9E6C8500147676 /* Debug */ = { | ||
204 | + isa = XCBuildConfiguration; | ||
205 | + buildSettings = { | ||
206 | + HEADER_SEARCH_PATHS = ( | ||
207 | + "$(inherited)", | ||
208 | + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, | ||
209 | + "$(SRCROOT)/../../../React/**", | ||
210 | + "$(SRCROOT)/../../react-native/React/**", | ||
211 | + ); | ||
212 | + LIBRARY_SEARCH_PATHS = "$(inherited)"; | ||
213 | + OTHER_LDFLAGS = "-ObjC"; | ||
214 | + PRODUCT_NAME = RNFwRnAliface; | ||
215 | + SKIP_INSTALL = YES; | ||
216 | + }; | ||
217 | + name = Debug; | ||
218 | + }; | ||
219 | + 58B511F11A9E6C8500147676 /* Release */ = { | ||
220 | + isa = XCBuildConfiguration; | ||
221 | + buildSettings = { | ||
222 | + HEADER_SEARCH_PATHS = ( | ||
223 | + "$(inherited)", | ||
224 | + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, | ||
225 | + "$(SRCROOT)/../../../React/**", | ||
226 | + "$(SRCROOT)/../../react-native/React/**", | ||
227 | + ); | ||
228 | + LIBRARY_SEARCH_PATHS = "$(inherited)"; | ||
229 | + OTHER_LDFLAGS = "-ObjC"; | ||
230 | + PRODUCT_NAME = RNFwRnAliface; | ||
231 | + SKIP_INSTALL = YES; | ||
232 | + }; | ||
233 | + name = Release; | ||
234 | + }; | ||
235 | +/* End XCBuildConfiguration section */ | ||
236 | + | ||
237 | +/* Begin XCConfigurationList section */ | ||
238 | + 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNFwRnAliface" */ = { | ||
239 | + isa = XCConfigurationList; | ||
240 | + buildConfigurations = ( | ||
241 | + 58B511ED1A9E6C8500147676 /* Debug */, | ||
242 | + 58B511EE1A9E6C8500147676 /* Release */, | ||
243 | + ); | ||
244 | + defaultConfigurationIsVisible = 0; | ||
245 | + defaultConfigurationName = Release; | ||
246 | + }; | ||
247 | + 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNFwRnAliface" */ = { | ||
248 | + isa = XCConfigurationList; | ||
249 | + buildConfigurations = ( | ||
250 | + 58B511F01A9E6C8500147676 /* Debug */, | ||
251 | + 58B511F11A9E6C8500147676 /* Release */, | ||
252 | + ); | ||
253 | + defaultConfigurationIsVisible = 0; | ||
254 | + defaultConfigurationName = Release; | ||
255 | + }; | ||
256 | +/* End XCConfigurationList section */ | ||
257 | + }; | ||
258 | + rootObject = 58B511D31A9E6C8500147676 /* Project object */; | ||
259 | +} |
package.json
0 → 100644
1 | +++ a/package.json | ||
1 | + | ||
2 | +{ | ||
3 | + "name": "fw-rn-aliface", | ||
4 | + "version": "1.0.0", | ||
5 | + "description": "阿里人脸活体检测", | ||
6 | + "main": "index.js", | ||
7 | + "scripts": { | ||
8 | + "test": "echo \"Error: no test specified\" && exit 1", | ||
9 | + "npm:publish": "npm --registry https://registry.npmjs.org/ publish", | ||
10 | + "npm:sync": "curl -i https://npm.taobao.org/sync/fw-rn-aliface", | ||
11 | + "pod:lint": "export LANG=en_US.UTF-8 && pod lib lint TXIm.podspec", | ||
12 | + "pod:install": "cd ios && export LANG=en_US.UTF-8 && pod install" | ||
13 | + }, | ||
14 | + "keywords": [ | ||
15 | + "aliface" | ||
16 | + ], | ||
17 | + "repository": { | ||
18 | + "type": "git", | ||
19 | + "url": "git@gitlab.feewee.cn:FEV2/fw-rn-aliface.git" | ||
20 | + }, | ||
21 | + "homepage": "http://gitlab.feewee.cn/FEV2/fw-rn-aliface", | ||
22 | + "author": "baiyun", | ||
23 | + "license": "MIT", | ||
24 | + "dependencies": { | ||
25 | + "prop-types": "^15.7.2" | ||
26 | + }, | ||
27 | + "peerDependencies": { | ||
28 | + "react": "16.9.0", | ||
29 | + "react-native": "0.61.5" | ||
30 | + } | ||
31 | +} |