mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 08:41:37 +08:00
fix proguard
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
"react-native-paper": "^5.14.5",
|
"react-native-paper": "^5.14.5",
|
||||||
"react-native-safe-area-context": "^5.4.1",
|
"react-native-safe-area-context": "^5.4.1",
|
||||||
"react-native-svg": "^15.12.0",
|
"react-native-svg": "^15.12.0",
|
||||||
"react-native-update": "^10.28.11",
|
"react-native-update": "^10.29.0",
|
||||||
"react-native-vector-icons": "^10.2.0",
|
"react-native-vector-icons": "^10.2.0",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -1420,7 +1420,7 @@
|
|||||||
|
|
||||||
"react-native-svg": ["react-native-svg@15.12.0", "", { "dependencies": { "css-select": "^5.1.0", "css-tree": "^1.1.3", "warn-once": "0.1.1" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-iE25PxIJ6V0C6krReLquVw6R0QTsRTmEQc4K2Co3P6zsimU/jltcDBKYDy1h/5j9S/fqmMeXnpM+9LEWKJKI6A=="],
|
"react-native-svg": ["react-native-svg@15.12.0", "", { "dependencies": { "css-select": "^5.1.0", "css-tree": "^1.1.3", "warn-once": "0.1.1" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-iE25PxIJ6V0C6krReLquVw6R0QTsRTmEQc4K2Co3P6zsimU/jltcDBKYDy1h/5j9S/fqmMeXnpM+9LEWKJKI6A=="],
|
||||||
|
|
||||||
"react-native-update": ["react-native-update@10.28.11", "", { "dependencies": { "nanoid": "^3.3.3", "react-native-url-polyfill": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-native": ">=0.59.0" } }, "sha512-afoaUsUFwIKj4lETWm5ilfMcWkbcTId0HJ9PaL9G0sPUBNokT0TdLPPezVglYqVWFTe8I+KAS0yD7hLG9F9StA=="],
|
"react-native-update": ["react-native-update@10.29.0", "", { "dependencies": { "nanoid": "^3.3.3", "react-native-url-polyfill": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-native": ">=0.59.0" } }, "sha512-TFGwJxI62OHPJimxMnI8PDvUBhZio1alsgIvXHYh1oYAZYYejkUvwl+Ojdbm58IKoZzxAaT7RvD1qGdvlg/oKg=="],
|
||||||
|
|
||||||
"react-native-url-polyfill": ["react-native-url-polyfill@2.0.0", "", { "dependencies": { "whatwg-url-without-unicode": "8.0.0-3" }, "peerDependencies": { "react-native": "*" } }, "sha512-My330Do7/DvKnEvwQc0WdcBnFPploYKp9CYlefDXzIdEaA+PAhDYllkvGeEroEzvc4Kzzj2O4yVdz8v6fjRvhA=="],
|
"react-native-url-polyfill": ["react-native-url-polyfill@2.0.0", "", { "dependencies": { "whatwg-url-without-unicode": "8.0.0-3" }, "peerDependencies": { "react-native": "*" } }, "sha512-My330Do7/DvKnEvwQc0WdcBnFPploYKp9CYlefDXzIdEaA+PAhDYllkvGeEroEzvc4Kzzj2O4yVdz8v6fjRvhA=="],
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
"react-native-paper": "^5.14.5",
|
"react-native-paper": "^5.14.5",
|
||||||
"react-native-safe-area-context": "^5.4.1",
|
"react-native-safe-area-context": "^5.4.1",
|
||||||
"react-native-svg": "^15.12.0",
|
"react-native-svg": "^15.12.0",
|
||||||
"react-native-update": "^10.28.11",
|
"react-native-update": "^10.29.0",
|
||||||
"react-native-vector-icons": "^10.2.0"
|
"react-native-vector-icons": "^10.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -52,4 +52,4 @@
|
|||||||
"detox",
|
"detox",
|
||||||
"dtrace-provider"
|
"dtrace-provider"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
36
android/proguard.pro
vendored
36
android/proguard.pro
vendored
@@ -1,3 +1,37 @@
|
|||||||
|
# Keep our update module classes
|
||||||
-keepnames class cn.reactnative.modules.update.DownloadTask { *; }
|
-keepnames class cn.reactnative.modules.update.DownloadTask { *; }
|
||||||
-keepnames class cn.reactnative.modules.update.UpdateModuleImpl { *; }
|
-keepnames class cn.reactnative.modules.update.UpdateModuleImpl { *; }
|
||||||
-keepnames class com.facebook.react.ReactInstanceManager { *; }
|
-keepnames class cn.reactnative.modules.update.** { *; }
|
||||||
|
|
||||||
|
# Keep React Native classes
|
||||||
|
-keepnames class com.facebook.react.ReactInstanceManager { *; }
|
||||||
|
-keepnames class com.facebook.react.** { *; }
|
||||||
|
-keepnames class com.facebook.react.bridge.** { *; }
|
||||||
|
-keepnames class com.facebook.react.devsupport.** { *; }
|
||||||
|
|
||||||
|
# Keep fields used in reflection
|
||||||
|
-keepclassmembers class com.facebook.react.ReactInstanceManager {
|
||||||
|
private JSBundleLoader mBundleLoader;
|
||||||
|
private String mJSBundleFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
-keepclassmembers class com.facebook.react.ReactDelegate {
|
||||||
|
private ReactHost mReactHost;
|
||||||
|
}
|
||||||
|
|
||||||
|
-keepclassmembers class com.facebook.react.ReactHost {
|
||||||
|
private boolean mUseDevSupport;
|
||||||
|
private ReactHostDelegate mReactHostDelegate;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keep Expo related classes
|
||||||
|
-keepnames class expo.modules.ExpoReactHostFactory$ExpoReactHostDelegate { *; }
|
||||||
|
|
||||||
|
# Keep methods used in reflection
|
||||||
|
-keepclassmembers class com.facebook.react.ReactActivity {
|
||||||
|
public ReactDelegate getReactDelegate();
|
||||||
|
}
|
||||||
|
|
||||||
|
-keepclassmembers class com.facebook.react.ReactHost {
|
||||||
|
public void reload(java.lang.String);
|
||||||
|
}
|
@@ -169,17 +169,19 @@ public class UpdateContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void markSuccess() {
|
public void markSuccess() {
|
||||||
SharedPreferences.Editor editor = sp.edit();
|
if (!BuildConfig.DEBUG) {
|
||||||
editor.putBoolean("firstTimeOk", true);
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
String lastVersion = sp.getString("lastVersion", null);
|
editor.putBoolean("firstTimeOk", true);
|
||||||
String curVersion = sp.getString("currentVersion", null);
|
String lastVersion = sp.getString("lastVersion", null);
|
||||||
if (lastVersion != null && !lastVersion.equals(curVersion)) {
|
String curVersion = sp.getString("currentVersion", null);
|
||||||
editor.remove("lastVersion");
|
if (lastVersion != null && !lastVersion.equals(curVersion)) {
|
||||||
editor.remove("hash_" + lastVersion);
|
editor.remove("lastVersion");
|
||||||
}
|
editor.remove("hash_" + lastVersion);
|
||||||
editor.apply();
|
}
|
||||||
|
editor.apply();
|
||||||
|
|
||||||
this.cleanUp();
|
this.cleanUp();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearFirstTime() {
|
public void clearFirstTime() {
|
||||||
|
@@ -147,6 +147,10 @@ public class UpdateModuleImpl {
|
|||||||
reactHostField.setAccessible(true);
|
reactHostField.setAccessible(true);
|
||||||
Object reactHost = reactHostField.get(reactDelegate);
|
Object reactHost = reactHostField.get(reactDelegate);
|
||||||
|
|
||||||
|
Field devSupport = reactHost.getClass().getDeclaredField("mUseDevSupport");
|
||||||
|
devSupport.setAccessible(true);
|
||||||
|
devSupport.set(reactHost, false);
|
||||||
|
|
||||||
// Access the mReactHostDelegate field
|
// Access the mReactHostDelegate field
|
||||||
Field reactHostDelegateField = reactHost.getClass().getDeclaredField("mReactHostDelegate");
|
Field reactHostDelegateField = reactHost.getClass().getDeclaredField("mReactHostDelegate");
|
||||||
reactHostDelegateField.setAccessible(true);
|
reactHostDelegateField.setAccessible(true);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-update",
|
"name": "react-native-update",
|
||||||
"version": "10.29.0",
|
"version": "10.29.1",
|
||||||
"description": "react-native hot update",
|
"description": "react-native hot update",
|
||||||
"main": "src/index",
|
"main": "src/index",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Reference in New Issue
Block a user