react-native-update 10.29.0 → 10.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,37 @@
1
+ # Keep our update module classes
1
2
  -keepnames class cn.reactnative.modules.update.DownloadTask { *; }
2
3
  -keepnames class cn.reactnative.modules.update.UpdateModuleImpl { *; }
3
- -keepnames class com.facebook.react.ReactInstanceManager { *; }
4
+ -keepnames class cn.reactnative.modules.update.** { *; }
5
+
6
+ # Keep React Native classes
7
+ -keepnames class com.facebook.react.ReactInstanceManager { *; }
8
+ -keepnames class com.facebook.react.** { *; }
9
+ -keepnames class com.facebook.react.bridge.** { *; }
10
+ -keepnames class com.facebook.react.devsupport.** { *; }
11
+
12
+ # Keep fields used in reflection
13
+ -keepclassmembers class com.facebook.react.ReactInstanceManager {
14
+ private JSBundleLoader mBundleLoader;
15
+ private String mJSBundleFile;
16
+ }
17
+
18
+ -keepclassmembers class com.facebook.react.ReactDelegate {
19
+ private ReactHost mReactHost;
20
+ }
21
+
22
+ -keepclassmembers class com.facebook.react.ReactHost {
23
+ private boolean mUseDevSupport;
24
+ private ReactHostDelegate mReactHostDelegate;
25
+ }
26
+
27
+ # Keep Expo related classes
28
+ -keepnames class expo.modules.ExpoReactHostFactory$ExpoReactHostDelegate { *; }
29
+
30
+ # Keep methods used in reflection
31
+ -keepclassmembers class com.facebook.react.ReactActivity {
32
+ public ReactDelegate getReactDelegate();
33
+ }
34
+
35
+ -keepclassmembers class com.facebook.react.ReactHost {
36
+ public void reload(java.lang.String);
37
+ }
@@ -169,17 +169,19 @@ public class UpdateContext {
169
169
  }
170
170
 
171
171
  public void markSuccess() {
172
- SharedPreferences.Editor editor = sp.edit();
173
- editor.putBoolean("firstTimeOk", true);
174
- String lastVersion = sp.getString("lastVersion", null);
175
- String curVersion = sp.getString("currentVersion", null);
176
- if (lastVersion != null && !lastVersion.equals(curVersion)) {
177
- editor.remove("lastVersion");
178
- editor.remove("hash_" + lastVersion);
179
- }
180
- editor.apply();
172
+ if (!BuildConfig.DEBUG) {
173
+ SharedPreferences.Editor editor = sp.edit();
174
+ editor.putBoolean("firstTimeOk", true);
175
+ String lastVersion = sp.getString("lastVersion", null);
176
+ String curVersion = sp.getString("currentVersion", null);
177
+ if (lastVersion != null && !lastVersion.equals(curVersion)) {
178
+ editor.remove("lastVersion");
179
+ editor.remove("hash_" + lastVersion);
180
+ }
181
+ editor.apply();
181
182
 
182
- this.cleanUp();
183
+ this.cleanUp();
184
+ }
183
185
  }
184
186
 
185
187
  public void clearFirstTime() {
@@ -147,6 +147,10 @@ public class UpdateModuleImpl {
147
147
  reactHostField.setAccessible(true);
148
148
  Object reactHost = reactHostField.get(reactDelegate);
149
149
 
150
+ Field devSupport = reactHost.getClass().getDeclaredField("mUseDevSupport");
151
+ devSupport.setAccessible(true);
152
+ devSupport.set(reactHost, false);
153
+
150
154
  // Access the mReactHostDelegate field
151
155
  Field reactHostDelegateField = reactHost.getClass().getDeclaredField("mReactHostDelegate");
152
156
  reactHostDelegateField.setAccessible(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.29.0",
3
+ "version": "10.29.1",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {