react-native-update 10.28.3-beta.0 → 10.28.4-beta.0
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.
|
@@ -120,14 +120,13 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
@Override
|
|
123
|
-
protected void onProgressUpdate(long[]... values) {
|
|
123
|
+
protected void onProgressUpdate(final long[]... values) {
|
|
124
124
|
super.onProgressUpdate(values);
|
|
125
125
|
WritableMap params = Arguments.createMap();
|
|
126
126
|
params.putDouble("received", (values[0][0]));
|
|
127
127
|
params.putDouble("total", (values[0][1]));
|
|
128
128
|
params.putString("hash", this.hash);
|
|
129
129
|
sendEvent("RCTPushyDownloadProgress", params);
|
|
130
|
-
|
|
131
130
|
}
|
|
132
131
|
|
|
133
132
|
byte[] buffer = new byte[1024*4];
|
|
@@ -452,7 +451,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|
|
452
451
|
}
|
|
453
452
|
|
|
454
453
|
@Override
|
|
455
|
-
protected Void doInBackground(DownloadTaskParams... params) {
|
|
454
|
+
protected Void doInBackground(final DownloadTaskParams... params) {
|
|
456
455
|
int taskType = params[0].type;
|
|
457
456
|
try {
|
|
458
457
|
switch (taskType) {
|
|
@@ -24,7 +24,7 @@ public class UpdateModuleImpl {
|
|
|
24
24
|
|
|
25
25
|
public static final String NAME = "Pushy";
|
|
26
26
|
|
|
27
|
-
public static void downloadFullUpdate(UpdateContext updateContext, ReadableMap options, Promise promise) {
|
|
27
|
+
public static void downloadFullUpdate(UpdateContext updateContext, final ReadableMap options, final Promise promise) {
|
|
28
28
|
String url = options.getString("updateUrl");
|
|
29
29
|
String hash = options.getString("hash");
|
|
30
30
|
updateContext.downloadFullUpdate(url, hash, new UpdateContext.DownloadFileListener() {
|
|
@@ -40,7 +40,7 @@ public class UpdateModuleImpl {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
public static void downloadAndInstallApk(UpdateContext updateContext, ReadableMap options, Promise promise) {
|
|
43
|
+
public static void downloadAndInstallApk(UpdateContext updateContext, final ReadableMap options, final Promise promise) {
|
|
44
44
|
String url = options.getString("url");
|
|
45
45
|
String hash = options.getString("hash");
|
|
46
46
|
String target = options.getString("target");
|
|
@@ -63,7 +63,7 @@ public class UpdateModuleImpl {
|
|
|
63
63
|
UpdateModule.installApk(toInstall);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
public static void downloadPatchFromPackage(UpdateContext updateContext, ReadableMap options, Promise promise) {
|
|
66
|
+
public static void downloadPatchFromPackage(UpdateContext updateContext, final ReadableMap options, final Promise promise) {
|
|
67
67
|
String url = options.getString("updateUrl");
|
|
68
68
|
String hash = options.getString("hash");
|
|
69
69
|
updateContext.downloadPatchFromApk(url, hash, new UpdateContext.DownloadFileListener() {
|
|
@@ -79,7 +79,7 @@ public class UpdateModuleImpl {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
public static void downloadPatchFromPpk(UpdateContext updateContext, ReadableMap options, Promise promise) {
|
|
82
|
+
public static void downloadPatchFromPpk(UpdateContext updateContext, final ReadableMap options, final Promise promise) {
|
|
83
83
|
try {
|
|
84
84
|
String url = options.getString("updateUrl");
|
|
85
85
|
String hash = options.getString("hash");
|
|
@@ -102,7 +102,7 @@ public class UpdateModuleImpl {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
public static void reloadUpdate(UpdateContext updateContext, ReactApplicationContext mContext, ReadableMap options, Promise promise) {
|
|
105
|
+
public static void reloadUpdate(UpdateContext updateContext, ReactApplicationContext mContext, final ReadableMap options, final Promise promise) {
|
|
106
106
|
final String hash = options.getString("hash");
|
|
107
107
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
108
108
|
@Override
|
|
@@ -176,7 +176,7 @@ public class UpdateModuleImpl {
|
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
public static void restartApp(final ReactApplicationContext mContext, Promise promise) {
|
|
179
|
+
public static void restartApp(final ReactApplicationContext mContext, final Promise promise) {
|
|
180
180
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
181
181
|
@Override
|
|
182
182
|
public void run() {
|
|
@@ -206,7 +206,7 @@ public class UpdateModuleImpl {
|
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
public static void setNeedUpdate(UpdateContext updateContext, ReadableMap options, Promise promise) {
|
|
209
|
+
public static void setNeedUpdate(UpdateContext updateContext, final ReadableMap options, final Promise promise) {
|
|
210
210
|
final String hash = options.getString("hash");
|
|
211
211
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
212
212
|
@Override
|
|
@@ -222,7 +222,7 @@ public class UpdateModuleImpl {
|
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
public static void markSuccess(UpdateContext updateContext, Promise promise) {
|
|
225
|
+
public static void markSuccess(UpdateContext updateContext, final Promise promise) {
|
|
226
226
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
227
227
|
@Override
|
|
228
228
|
public void run() {
|
|
@@ -232,7 +232,7 @@ public class UpdateModuleImpl {
|
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
public static void setUuid(UpdateContext updateContext, String uuid, Promise promise) {
|
|
235
|
+
public static void setUuid(UpdateContext updateContext, final String uuid, final Promise promise) {
|
|
236
236
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
237
237
|
@Override
|
|
238
238
|
public void run() {
|
|
@@ -253,7 +253,7 @@ public class UpdateModuleImpl {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
|
|
256
|
-
public static void setLocalHashInfo(UpdateContext updateContext, final String hash, final String info, Promise promise) {
|
|
256
|
+
public static void setLocalHashInfo(UpdateContext updateContext, final String hash, final String info, final Promise promise) {
|
|
257
257
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
258
258
|
@Override
|
|
259
259
|
public void run() {
|
|
@@ -268,7 +268,7 @@ public class UpdateModuleImpl {
|
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
public static void getLocalHashInfo(UpdateContext updateContext, final String hash, Promise promise) {
|
|
271
|
+
public static void getLocalHashInfo(UpdateContext updateContext, final String hash, final Promise promise) {
|
|
272
272
|
String value = updateContext.getKv("hash_" + hash);
|
|
273
273
|
if (check(value)) {
|
|
274
274
|
promise.resolve(value);
|