diff --git a/android/.gradle/3.3/taskArtifacts/fileHashes.bin b/android/.gradle/3.3/taskArtifacts/fileHashes.bin new file mode 100644 index 0000000..3322578 Binary files /dev/null and b/android/.gradle/3.3/taskArtifacts/fileHashes.bin differ diff --git a/android/.gradle/3.3/taskArtifacts/fileSnapshots.bin b/android/.gradle/3.3/taskArtifacts/fileSnapshots.bin new file mode 100644 index 0000000..1eb37ee Binary files /dev/null and b/android/.gradle/3.3/taskArtifacts/fileSnapshots.bin differ diff --git a/android/.gradle/3.3/taskArtifacts/taskArtifacts.bin b/android/.gradle/3.3/taskArtifacts/taskArtifacts.bin new file mode 100644 index 0000000..841cc3c Binary files /dev/null and b/android/.gradle/3.3/taskArtifacts/taskArtifacts.bin differ diff --git a/android/.gradle/3.3/taskArtifacts/taskArtifacts.lock b/android/.gradle/3.3/taskArtifacts/taskArtifacts.lock new file mode 100644 index 0000000..6374f45 Binary files /dev/null and b/android/.gradle/3.3/taskArtifacts/taskArtifacts.lock differ diff --git a/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin new file mode 100644 index 0000000..3e90666 Binary files /dev/null and b/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin differ diff --git a/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock new file mode 100644 index 0000000..6949929 Binary files /dev/null and b/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock differ diff --git a/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin new file mode 100644 index 0000000..5a9e061 Binary files /dev/null and b/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin differ diff --git a/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock new file mode 100644 index 0000000..afc8406 Binary files /dev/null and b/android/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock differ diff --git a/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin new file mode 100644 index 0000000..2731a94 Binary files /dev/null and b/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin differ diff --git a/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock new file mode 100644 index 0000000..a911342 Binary files /dev/null and b/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock differ diff --git a/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin new file mode 100644 index 0000000..0f9c595 Binary files /dev/null and b/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin differ diff --git a/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock new file mode 100644 index 0000000..378ee42 Binary files /dev/null and b/android/.gradle/3.3/tasks/_app_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock differ diff --git a/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin new file mode 100644 index 0000000..7198e7a Binary files /dev/null and b/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin differ diff --git a/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock new file mode 100644 index 0000000..2bb339c Binary files /dev/null and b/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock differ diff --git a/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin new file mode 100644 index 0000000..0fa7ec9 Binary files /dev/null and b/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin differ diff --git a/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock new file mode 100644 index 0000000..34c115a Binary files /dev/null and b/android/.gradle/3.3/tasks/_mylibrary_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock differ diff --git a/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin new file mode 100644 index 0000000..7198e7a Binary files /dev/null and b/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin differ diff --git a/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock new file mode 100644 index 0000000..092d459 Binary files /dev/null and b/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock differ diff --git a/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin new file mode 100644 index 0000000..0fa7ec9 Binary files /dev/null and b/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin differ diff --git a/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock new file mode 100644 index 0000000..1e30575 Binary files /dev/null and b/android/.gradle/3.3/tasks/_mylibrary_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock differ diff --git a/android/.idea/.name b/android/.idea/.name new file mode 100644 index 0000000..f7cc9d7 --- /dev/null +++ b/android/.idea/.name @@ -0,0 +1 @@ +updataDemo \ No newline at end of file diff --git a/android/.idea/compiler.xml b/android/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/android/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/copyright/profiles_settings.xml b/android/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/android/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml new file mode 100644 index 0000000..08d2b7a --- /dev/null +++ b/android/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/android_jsc_r174650.xml b/android/.idea/libraries/android_jsc_r174650.xml new file mode 100644 index 0000000..6b46cda --- /dev/null +++ b/android/.idea/libraries/android_jsc_r174650.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/appcompat_v7_23_0_1.xml b/android/.idea/libraries/appcompat_v7_23_0_1.xml new file mode 100644 index 0000000..0f4c970 --- /dev/null +++ b/android/.idea/libraries/appcompat_v7_23_0_1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/bolts_tasks_1_4_0.xml b/android/.idea/libraries/bolts_tasks_1_4_0.xml new file mode 100644 index 0000000..3f0dbce --- /dev/null +++ b/android/.idea/libraries/bolts_tasks_1_4_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/drawee_1_0_1.xml b/android/.idea/libraries/drawee_1_0_1.xml new file mode 100644 index 0000000..d268471 --- /dev/null +++ b/android/.idea/libraries/drawee_1_0_1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/fastjson_1_2_37.xml b/android/.idea/libraries/fastjson_1_2_37.xml new file mode 100644 index 0000000..6605696 --- /dev/null +++ b/android/.idea/libraries/fastjson_1_2_37.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/fbcore_1_0_1.xml b/android/.idea/libraries/fbcore_1_0_1.xml new file mode 100644 index 0000000..3744a78 --- /dev/null +++ b/android/.idea/libraries/fbcore_1_0_1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/fresco_1_0_1.xml b/android/.idea/libraries/fresco_1_0_1.xml new file mode 100644 index 0000000..611b1ff --- /dev/null +++ b/android/.idea/libraries/fresco_1_0_1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/imagepipeline_1_0_1.xml b/android/.idea/libraries/imagepipeline_1_0_1.xml new file mode 100644 index 0000000..75a34c8 --- /dev/null +++ b/android/.idea/libraries/imagepipeline_1_0_1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/imagepipeline_base_1_0_1.xml b/android/.idea/libraries/imagepipeline_base_1_0_1.xml new file mode 100644 index 0000000..e981b8a --- /dev/null +++ b/android/.idea/libraries/imagepipeline_base_1_0_1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/imagepipeline_okhttp3_1_0_1.xml b/android/.idea/libraries/imagepipeline_okhttp3_1_0_1.xml new file mode 100644 index 0000000..f189601 --- /dev/null +++ b/android/.idea/libraries/imagepipeline_okhttp3_1_0_1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/javax_inject_1.xml b/android/.idea/libraries/javax_inject_1.xml new file mode 100644 index 0000000..eebeedd --- /dev/null +++ b/android/.idea/libraries/javax_inject_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/jsr305_3_0_0.xml b/android/.idea/libraries/jsr305_3_0_0.xml new file mode 100644 index 0000000..b9fbaab --- /dev/null +++ b/android/.idea/libraries/jsr305_3_0_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/library_1_6_3.xml b/android/.idea/libraries/library_1_6_3.xml new file mode 100644 index 0000000..a764ef5 --- /dev/null +++ b/android/.idea/libraries/library_1_6_3.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/okhttp_3_6_0.xml b/android/.idea/libraries/okhttp_3_6_0.xml new file mode 100644 index 0000000..472aed6 --- /dev/null +++ b/android/.idea/libraries/okhttp_3_6_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/okhttp_urlconnection_3_6_0.xml b/android/.idea/libraries/okhttp_urlconnection_3_6_0.xml new file mode 100644 index 0000000..a34993b --- /dev/null +++ b/android/.idea/libraries/okhttp_urlconnection_3_6_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/okio_1_13_0.xml b/android/.idea/libraries/okio_1_13_0.xml new file mode 100644 index 0000000..a855abb --- /dev/null +++ b/android/.idea/libraries/okio_1_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/react_native_0_47_1.xml b/android/.idea/libraries/react_native_0_47_1.xml new file mode 100644 index 0000000..667f2d3 --- /dev/null +++ b/android/.idea/libraries/react_native_0_47_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/soloader_0_1_0.xml b/android/.idea/libraries/soloader_0_1_0.xml new file mode 100644 index 0000000..114fadb --- /dev/null +++ b/android/.idea/libraries/soloader_0_1_0.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/staticlayout_proxy_1_0.xml b/android/.idea/libraries/staticlayout_proxy_1_0.xml new file mode 100644 index 0000000..547ad80 --- /dev/null +++ b/android/.idea/libraries/staticlayout_proxy_1_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/support_annotations_23_0_1.xml b/android/.idea/libraries/support_annotations_23_0_1.xml new file mode 100644 index 0000000..f11118e --- /dev/null +++ b/android/.idea/libraries/support_annotations_23_0_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/support_v4_23_0_1.xml b/android/.idea/libraries/support_v4_23_0_1.xml new file mode 100644 index 0000000..aef7719 --- /dev/null +++ b/android/.idea/libraries/support_v4_23_0_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/textlayoutbuilder_1_0_0.xml b/android/.idea/libraries/textlayoutbuilder_1_0_0.xml new file mode 100644 index 0000000..5e29fdc --- /dev/null +++ b/android/.idea/libraries/textlayoutbuilder_1_0_0.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml new file mode 100644 index 0000000..3f43bef --- /dev/null +++ b/android/.idea/misc.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/modules.xml b/android/.idea/modules.xml new file mode 100644 index 0000000..4ba415f --- /dev/null +++ b/android/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/runConfigurations.xml b/android/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/android/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/workspace.xml b/android/.idea/workspace.xml new file mode 100644 index 0000000..b593480 --- /dev/null +++ b/android/.idea/workspace.xml @@ -0,0 +1,3603 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1502864846742 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/BUCK b/android/app/BUCK new file mode 100644 index 0000000..63aa929 --- /dev/null +++ b/android/app/BUCK @@ -0,0 +1,65 @@ +# To learn about Buck see [Docs](https://buckbuild.com/). +# To run your application with Buck: +# - install Buck +# - `npm start` - to start the packager +# - `cd android` +# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` +# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck +# - `buck install -r android/app` - compile, install and run application +# + +lib_deps = [] + +for jarfile in glob(['libs/*.jar']): + name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] + lib_deps.append(':' + name) + prebuilt_jar( + name = name, + binary_jar = jarfile, + ) + +for aarfile in glob(['libs/*.aar']): + name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] + lib_deps.append(':' + name) + android_prebuilt_aar( + name = name, + aar = aarfile, + ) + +android_library( + name = "all-libs", + exported_deps = lib_deps, +) + +android_library( + name = "app-code", + srcs = glob([ + "src/main/java/**/*.java", + ]), + deps = [ + ":all-libs", + ":build_config", + ":res", + ], +) + +android_build_config( + name = "build_config", + package = "com.updatademo", +) + +android_resource( + name = "res", + package = "com.updatademo", + res = "src/main/res", +) + +android_binary( + name = "app", + keystore = "//android/keystores:debug", + manifest = "src/main/AndroidManifest.xml", + package_type = "debug", + deps = [ + ":app-code", + ], +) diff --git a/android/app/app.iml b/android/app/app.iml new file mode 100644 index 0000000..7df8f75 --- /dev/null +++ b/android/app/app.iml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..40d9863 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,157 @@ +apply plugin: "com.android.application" +/** + * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets + * and bundleReleaseJsAndAssets). + * These basically call `react-native bundle` with the correct arguments during the Android build + * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the + * bundle directly from the development server. Below you can see all the possible configurations + * and their defaults. If you decide to add a configuration block, make sure to add it before the + * `apply from: "../../node_modules/react-native/react.gradle"` line. + * + * project.ext.react = [ + * // the name of the generated asset file containing your JS bundle + * bundleAssetName: "index.android.bundle", + * + * // the entry file for bundle generation + * entryFile: "index.android.js", + * + * // whether to bundle JS and assets in debug mode + * bundleInDebug: false, + * + * // whether to bundle JS and assets in release mode + * bundleInRelease: true, + * + * // whether to bundle JS and assets in another build variant (if configured). + * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants + * // The configuration property can be in the following formats + * // 'bundleIn${productFlavor}${buildType}' + * // 'bundleIn${buildType}' + * // bundleInFreeDebug: true, + * // bundleInPaidRelease: true, + * // bundleInBeta: true, + * + * // whether to disable dev mode in custom build variants (by default only disabled in release) + * // for example: to disable dev mode in the staging build type (if configured) + * devDisabledInStaging: true, + * // The configuration property can be in the following formats + * // 'devDisabledIn${productFlavor}${buildType}' + * // 'devDisabledIn${buildType}' + * + * // the root of your project, i.e. where "package.json" lives + * root: "../../", + * + * // where to put the JS bundle asset in debug mode + * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", + * + * // where to put the JS bundle asset in release mode + * jsBundleDirRelease: "$buildDir/intermediates/assets/release", + * + * // where to put drawable resources / React Native assets, e.g. the ones you use via + * // require('./image.png')), in debug mode + * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", + * + * // where to put drawable resources / React Native assets, e.g. the ones you use via + * // require('./image.png')), in release mode + * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", + * + * // by default the gradle tasks are skipped if none of the JS files or assets change; this means + * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to + * // date; if you have any other folders that you want to ignore for performance reasons (gradle + * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ + * // for example, you might want to remove it from here. + * inputExcludes: ["android/**", "ios/**"], + * + * // override which node gets called and with what additional arguments + * nodeExecutableAndArgs: ["node"], + * + * // supply additional arguments to the packager + * extraPackagerArgs: [] + * ] + */ + +apply from: "../../node_modules/react-native/react.gradle" + +/** + * Set this to true to create two separate APKs instead of one: + * - An APK that only works on ARM devices + * - An APK that only works on x86 devices + * The advantage is the size of the APK is reduced by about 4MB. + * Upload all the APKs to the Play Store and people will download + * the correct one based on the CPU architecture of their device. + */ +def enableSeparateBuildPerCPUArchitecture = false + +/** + * Run Proguard to shrink the Java bytecode in release builds. + */ +def enableProguardInReleaseBuilds = false + +android { + compileSdkVersion 23 + buildToolsVersion '25.0.0' + + defaultConfig { + applicationId "com.updatademo" + minSdkVersion 16 + targetSdkVersion 21 + versionCode 1 + versionName "1.0" + ndk { + abiFilters "armeabi-v7a", "x86" + } + } + splits { + abi { + reset() + enable enableSeparateBuildPerCPUArchitecture + universalApk false // If true, also generate a universal APK + include "armeabi-v7a", "x86" + } + } + + sourceSets { + main { + jniLibs.srcDirs = ['libs'] // 若不想编译jni代码,可直接引用so库,ndk编译相关脚本注释掉 + } + } + + buildTypes { + release { + minifyEnabled enableProguardInReleaseBuilds + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + } + } + // applicationVariants are e.g. debug, release +// applicationVariants.all { variant -> +// variant.outputs.each { output -> +// // For each separate APK per architecture, set a unique version code as described here: +// // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits +// def versionCodes = ["armeabi-v7a":1, "x86":2] +// def abi = output.getFilter(OutputFile.ABI) +// if (abi != null) { // null for the universal-debug, universal-release variants +// output.versionCodeOverride = +// versionCodes.get(abi) * 1048576 + defaultConfig.versionCode +// } +// } +// } + + lintOptions { + abortOnError false + } + + +} + +dependencies { + compile fileTree(include: ['*.jar'], dir: 'libs') + compile 'com.android.support:appcompat-v7:23.0.1' + compile 'com.facebook.react:react-native:+' + compile project(':mylibrary') +} + +// Run this once to be able to run the application with BUCK +// puts all compile dependencies into folder libs for BUCK to use +task copyDownloadableDepsToLibs(type: Copy) { + from configurations.compile + into 'libs' +} diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 0000000..6e8516c --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,70 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# 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 *; +#} + +# Disabling obfuscation is useful if you collect stack traces from production crashes +# (unless you are using a system that supports de-obfuscate the stack traces). +-dontobfuscate + +# React Native + +# Keep our interfaces so they can be used by other ProGuard rules. +# See http://sourceforge.net/p/proguard/bugs/466/ +-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip +-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters +-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip + +# Do not strip any method/class that is annotated with @DoNotStrip +-keep @com.facebook.proguard.annotations.DoNotStrip class * +-keep @com.facebook.common.internal.DoNotStrip class * +-keepclassmembers class * { + @com.facebook.proguard.annotations.DoNotStrip *; + @com.facebook.common.internal.DoNotStrip *; +} + +-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { + void set*(***); + *** get*(); +} + +-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } +-keep class * extends com.facebook.react.bridge.NativeModule { *; } +-keepclassmembers,includedescriptorclasses class * { native ; } +-keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } +-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } +-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } + +-dontwarn com.facebook.react.** + +# TextLayoutBuilder uses a non-public Android constructor within StaticLayout. +# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. +-dontwarn android.text.StaticLayout + +# okhttp + +-keepattributes Signature +-keepattributes *Annotation* +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okhttp3.** + +# okio + +-keep class sun.misc.Unsafe { *; } +-dontwarn java.nio.file.* +-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement +-dontwarn okio.** diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..5855b19 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/assets/updataDemo.zip b/android/app/src/main/assets/updataDemo.zip new file mode 100644 index 0000000..8f283bf Binary files /dev/null and b/android/app/src/main/assets/updataDemo.zip differ diff --git a/android/app/src/main/java/com/updatademo/MyApplication.java b/android/app/src/main/java/com/updatademo/MyApplication.java new file mode 100644 index 0000000..5dc8d1e --- /dev/null +++ b/android/app/src/main/java/com/updatademo/MyApplication.java @@ -0,0 +1,18 @@ +package com.updatademo; + +import android.app.Application; + +import com.liulishuo.filedownloader.FileDownloader; + +/** + * Created by Lynn on 2017/8/17. + */ + +public class MyApplication extends Application { + + @Override + public void onCreate() { + super.onCreate(); + FileDownloader.setupOnApplicationOnCreate(this); + } +} diff --git a/android/app/src/main/java/com/updatademo/MyReactActivity.java b/android/app/src/main/java/com/updatademo/MyReactActivity.java new file mode 100644 index 0000000..efce687 --- /dev/null +++ b/android/app/src/main/java/com/updatademo/MyReactActivity.java @@ -0,0 +1,130 @@ +package com.updatademo; + +import android.app.Activity; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.provider.Settings; +import android.view.KeyEvent; + +import com.facebook.react.ReactInstanceManager; +import com.facebook.react.ReactRootView; +import com.facebook.react.common.LifecycleState; +import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; +import com.facebook.react.shell.MainReactPackage; + +/** + * Created by Lynn on 2017/8/16. + */ + +public class MyReactActivity extends Activity implements DefaultHardwareBackBtnHandler { + private static final int OVERLAY_PERMISSION_REQ_CODE = 1000; + private ReactRootView mReactRootView; + private ReactInstanceManager mReactInstanceManager; + + + + private String jsBundlePath=""; + private String moduleName=""; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + this.jsBundlePath=getIntent().getExtras().getString("jsbundlePath"); + this.moduleName=getIntent().getExtras().getString("moduleName"); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (!Settings.canDrawOverlays(this)) { + Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, + Uri.parse("package:" + getPackageName())); + startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE); + } + } + + + mReactRootView = new ReactRootView(this); + mReactInstanceManager = ReactInstanceManager.builder() + .setApplication(getApplication()) +// .setBundleAssetName("index.android.bundle") +// .setJSMainModuleName("index.android") + .setJSBundleFile(this.jsBundlePath) + .addPackage(new MainReactPackage()) + .setUseDeveloperSupport(false) + .setInitialLifecycleState(LifecycleState.RESUMED) + .build(); + + // 注意这里的MyReactNativeApp必须对应“index.android.js”中的 + // “AppRegistry.registerComponent()”的第一个参数 + mReactRootView.startReactApplication(mReactInstanceManager, this.moduleName, null); + + setContentView(mReactRootView); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + if (requestCode == OVERLAY_PERMISSION_REQ_CODE) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (!Settings.canDrawOverlays(this)) { + + } + } + } + } + + + @Override + public void invokeDefaultOnBackPressed() { + super.onBackPressed(); + } + + + @Override + protected void onPause() { + super.onPause(); + + if (mReactInstanceManager != null) { + mReactInstanceManager.onHostPause(this); + } + } + + @Override + protected void onResume() { + super.onResume(); + + if (mReactInstanceManager != null) { + mReactInstanceManager.onHostResume(this, this); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + + if (mReactInstanceManager != null) { + mReactInstanceManager.onHostDestroy(); + } + } + + + @Override + public void onBackPressed() { + if (mReactInstanceManager != null) { + mReactInstanceManager.onBackPressed(); + } else { + super.onBackPressed(); + } + } + + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) { + if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) { + mReactInstanceManager.showDevOptionsDialog(); + return true; + } + return super.onKeyUp(keyCode, event); + } + + +} diff --git a/android/app/src/main/java/com/updatademo/StartPage.java b/android/app/src/main/java/com/updatademo/StartPage.java new file mode 100644 index 0000000..f6adfdd --- /dev/null +++ b/android/app/src/main/java/com/updatademo/StartPage.java @@ -0,0 +1,65 @@ +package com.updatademo; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.view.View; +import android.widget.Button; + +import com.yyh.lib.bsdiff.downloader.ModuleManager; +import com.yyh.lib.bsdiff.downloader.RnModuleDiffUpdateService; + + +/** + * Created by Lynn on 2017/8/16. + */ + +public class StartPage extends Activity implements View.OnClickListener { + + + private Button action_bt0; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.startpage_layout); + initView(); + Intent intent = new Intent(this, RnModuleDiffUpdateService.class); + startService(intent); + } + + + private void initView() { + action_bt0 = (Button) findViewById(R.id.action_bt0); + action_bt0.setOnClickListener(this); + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.action_bt0: + action(); + break; + } + } + + + private void action() { + String moduleName = "updataDemo"; + String path = ModuleManager.getMoudleJsBundleFile(this, moduleName); + Intent intent = new Intent(this, MyReactActivity.class); + intent.putExtra("jsbundlePath", path); + intent.putExtra("moduleName", moduleName); + startActivity(intent); + } + + + + @Override + public void onBackPressed() { + Intent intent = new Intent(this, RnModuleDiffUpdateService.class); + stopService(intent); + super.onBackPressed(); + } +} diff --git a/android/app/src/main/res/layout/startpage_layout.xml b/android/app/src/main/res/layout/startpage_layout.xml new file mode 100644 index 0000000..7310676 --- /dev/null +++ b/android/app/src/main/res/layout/startpage_layout.xml @@ -0,0 +1,16 @@ + + + + + +