From 5703e8d6564892ef7db0e376ef1604117508f5c8 Mon Sep 17 00:00:00 2001 From: Varnius Date: Fri, 1 Jul 2022 14:54:08 +0300 Subject: [PATCH] update app configuration --- android/app/build.gradle | 6 ++--- android/app/proguard-rules.pro | 40 ++++++++++++++++++++++++++++++++++ android/build.gradle | 4 ++-- package-lock.json | 14 ++++++------ package.json | 2 +- 5 files changed, 53 insertions(+), 13 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index c8bebde..b0a47c1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -82,7 +82,7 @@ import com.android.build.OutputFile project.ext.react = [ entryFile: "index.js", - enableHermes: false, // clean and rebuild if changing + enableHermes: true, // clean and rebuild if changing ] apply from: "../../node_modules/react-native/react.gradle" @@ -100,7 +100,7 @@ def enableSeparateBuildPerCPUArchitecture = false /** * Run Proguard to shrink the Java bytecode in release builds. */ -def enableProguardInReleaseBuilds = false +def enableProguardInReleaseBuilds = true /** * The preferred build flavor of JavaScriptCore. @@ -203,7 +203,7 @@ dependencies { implementation 'com.argyle:argyle-plugin-android-source:3.0.1' if (enableHermes) { - def hermesPath = "../../node_modules/hermesvm/android/"; + def hermesPath = "../../node_modules/hermes-engine/android/"; debugImplementation files(hermesPath + "hermes-debug.aar") releaseImplementation files(hermesPath + "hermes-release.aar") } else { diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 4a50efb..530684f 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -10,3 +10,43 @@ # Add any project specific keep options here: -keep class com.argyle.** { *; } + +-keepclassmembers enum * { *; } + +-keepclassmembers class * { public (...); } + +-keep class com.facebook.hermes.unicode.** { *; } +-keep class com.facebook.jni.** { *; } + +##---------------Begin: proguard configuration for Gson ---------- +# Gson uses generic type information stored in a class file when working with fields. Proguard +# removes such information by default, so configure it to keep all of it. +-keepattributes Signature + +# For using GSON @Expose annotation +-keepattributes *Annotation* + +# Gson specific classes +-dontwarn sun.misc.** +#-keep class com.google.gson.stream.** { *; } + +# Application classes that will be serialized/deserialized over Gson +-keep class com.google.gson.examples.android.model.** { ; } + +# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, +# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) +-keep class * extends com.google.gson.TypeAdapter +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer + +# Prevent R8 from leaving Data object members always null +-keepclassmembers,allowobfuscation class * { + @com.google.gson.annotations.SerializedName ; +} + +# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher. +-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken +-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken + +##---------------End: proguard configuration for Gson ---------- diff --git a/android/build.gradle b/android/build.gradle index ef166fb..078901b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,12 +2,12 @@ buildscript { ext { - buildToolsVersion = "29.0.3" + buildToolsVersion = "31.0.0" minSdkVersion = 23 compileSdkVersion = 31 targetSdkVersion = 30 supportLibVersion = "28.0.0" - // kotlin_version = '1.3.21' + kotlin_version = '1.6.21' ndkVersion = "20.1.5948944" } repositories { diff --git a/package-lock.json b/package-lock.json index a9df039..16c0be2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "argyle-link-react-native", "version": "0.0.1", "dependencies": { - "@argyleio/argyle-plugin-react-native": "4.2.2", + "@argyleio/argyle-plugin-react-native": "4.2.3", "@react-native-community/async-storage": "latest", "react": "17.0.2", "react-native": "^0.66.4", @@ -37,9 +37,9 @@ } }, "node_modules/@argyleio/argyle-plugin-react-native": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@argyleio/argyle-plugin-react-native/-/argyle-plugin-react-native-4.2.2.tgz", - "integrity": "sha512-d46Nf53FQKTTZHB3Zh3iFyi/pyOfHSE7Rc3rGeBkLoi3qMlM7fHBsyyof334icTmfZ5aOpAvoCv1aOXd/yJqSQ==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@argyleio/argyle-plugin-react-native/-/argyle-plugin-react-native-4.2.3.tgz", + "integrity": "sha512-P9RTRcZ5eOtGSwQLIKsnaDD4DmzLxx6uBlrAXnKKpVgZIM6CFTySJhlrDI0TMDt0iKYhsK6rqz3uqQSjPBwL/Q==", "peerDependencies": { "react": ">=16.0.0 <18.0.0", "react-native": ">=0.59.0-rc.0 <1.0.x" @@ -12020,9 +12020,9 @@ } }, "@argyleio/argyle-plugin-react-native": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@argyleio/argyle-plugin-react-native/-/argyle-plugin-react-native-4.2.2.tgz", - "integrity": "sha512-d46Nf53FQKTTZHB3Zh3iFyi/pyOfHSE7Rc3rGeBkLoi3qMlM7fHBsyyof334icTmfZ5aOpAvoCv1aOXd/yJqSQ==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@argyleio/argyle-plugin-react-native/-/argyle-plugin-react-native-4.2.3.tgz", + "integrity": "sha512-P9RTRcZ5eOtGSwQLIKsnaDD4DmzLxx6uBlrAXnKKpVgZIM6CFTySJhlrDI0TMDt0iKYhsK6rqz3uqQSjPBwL/Q==", "requires": {} }, "@babel/code-frame": { diff --git a/package.json b/package.json index 244fc64..5f365a4 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test": "jest" }, "dependencies": { - "@argyleio/argyle-plugin-react-native": "4.2.2", + "@argyleio/argyle-plugin-react-native": "4.2.3", "@react-native-community/async-storage": "latest", "react": "17.0.2", "react-native": "^0.66.4",