react-native-update 10.19.4 → 10.19.5

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.
@@ -105,7 +105,7 @@ public class UpdateModuleImpl {
105
105
  }
106
106
  }
107
107
 
108
- private void loadBundleLegacy() {
108
+ private void loadBundleLegacy(ReactApplicationContext mContext) {
109
109
  final Activity currentActivity = mContext.getCurrentActivity();
110
110
  if (currentActivity == null) {
111
111
  return;
@@ -122,7 +122,7 @@ public class UpdateModuleImpl {
122
122
  public static void reloadUpdate(UpdateContext updateContext, ReactApplicationContext mContext, ReadableMap options,Promise promise) {
123
123
  final String hash = options.getString("hash");
124
124
 
125
- if(hash==null || hash.isEmpty()){
125
+ if (hash == null || hash.isEmpty()) {
126
126
  promise.reject("hash不能为空");
127
127
  return;
128
128
  }
@@ -156,7 +156,7 @@ public class UpdateModuleImpl {
156
156
  } catch (Throwable err) {
157
157
  promise.reject(err);
158
158
  Log.e("pushy", "switchVersion failed ", err);
159
- loadBundleLegacy();
159
+ loadBundleLegacy(mContext);
160
160
  }
161
161
  }
162
162
  });
@@ -182,7 +182,7 @@ public class UpdateModuleImpl {
182
182
  }
183
183
  }
184
184
  });
185
- }catch (Exception e){
185
+ } catch (Exception e){
186
186
  promise.reject("执行报错:"+e.getMessage());
187
187
  }
188
188
  }
@@ -196,7 +196,7 @@ public class UpdateModuleImpl {
196
196
  promise.resolve(true);
197
197
  }
198
198
  });
199
- }catch (Exception e){
199
+ } catch (Exception e){
200
200
  promise.reject("执行报错:"+e.getMessage());
201
201
  }
202
202
  }
@@ -210,7 +210,7 @@ public class UpdateModuleImpl {
210
210
  promise.resolve(true);
211
211
  }
212
212
  });
213
- }catch (Exception e){
213
+ } catch (Exception e){
214
214
  promise.reject("执行报错:"+e.getMessage());
215
215
  }
216
216
 
@@ -246,9 +246,9 @@ public class UpdateModuleImpl {
246
246
 
247
247
  public static void getLocalHashInfo(UpdateContext updateContext, final String hash, Promise promise) {
248
248
  String value = updateContext.getKv("hash_" + hash);
249
- if(check(value)){
249
+ if (check(value)) {
250
250
  promise.resolve(value);
251
- }else {
251
+ } else {
252
252
  promise.reject("校验报错:json字符串格式错误");
253
253
  }
254
254
 
@@ -9,7 +9,7 @@ import android.util.Log;
9
9
 
10
10
  import com.facebook.react.ReactApplication;
11
11
  import com.facebook.react.ReactInstanceManager;
12
- import com.facebook.react.bridge.LifecycleEventListener;
12
+ // import com.facebook.react.bridge.LifecycleEventListener;
13
13
  import com.facebook.react.bridge.Promise;
14
14
  import com.facebook.react.bridge.ReactApplicationContext;
15
15
  import com.facebook.react.bridge.ReactContext;
@@ -32,7 +32,7 @@ import static androidx.core.content.FileProvider.getUriForFile;
32
32
  public class UpdateModule extends ReactContextBaseJavaModule {
33
33
  UpdateContext updateContext;
34
34
  public static ReactApplicationContext mContext;
35
- private LifecycleEventListener mLifecycleEventListener = null;
35
+ // private LifecycleEventListener mLifecycleEventListener = null;
36
36
 
37
37
  public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) {
38
38
  super(reactContext);
@@ -171,7 +171,7 @@ public class UpdateModule extends ReactContextBaseJavaModule {
171
171
  }
172
172
 
173
173
  private void loadBundleLegacy() {
174
- final Activity currentActivity = mContext.getCurrentActivity();
174
+ final Activity currentActivity = getCurrentActivity();
175
175
  if (currentActivity == null) {
176
176
  return;
177
177
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.19.4",
3
+ "version": "10.19.5",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {