react-native-update 10.19.5 → 10.20.0-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.
- package/android/.project +28 -0
- package/android/bin/.project +34 -0
- package/android/bin/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/bin/jni/HDiffPatch/builds/android_ndk_jni_mk/java/com/github/sisong/HPatch.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/CRC.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZ/BinTree.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZ/InWindow.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZ/OutWindow.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Base.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Decoder$LenDecoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Decoder$LiteralDecoder$Decoder2.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Decoder$LiteralDecoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Decoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Encoder$LenEncoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Encoder$LenPriceTableEncoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Encoder$LiteralEncoder$Encoder2.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Encoder$LiteralEncoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Encoder$Optimal.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Encoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/RangeCoder/Decoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/Compression/RangeCoder/Encoder.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/ICodeProgress.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaAlone$CommandLine.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaAlone.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaBench$CBenchRandomGenerator.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaBench$CBitRandomGenerator.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaBench$CProgressInfo.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaBench$CRandomGenerator.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaBench$CrcOutStream.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaBench$MyInputStream.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaBench$MyOutputStream.class +0 -0
- package/android/bin/jni/lzma/Java/SevenZip/LzmaBench.class +0 -0
- package/android/bin/src/main/java/cn/reactnative/modules/update/DownloadTask.class +0 -0
- package/android/bin/src/main/java/cn/reactnative/modules/update/DownloadTaskParams.class +0 -0
- package/android/bin/src/main/java/cn/reactnative/modules/update/PushyFileProvider.class +0 -0
- package/android/bin/src/main/java/cn/reactnative/modules/update/SafeZipFile$SafeZipEntryIterator.class +0 -0
- package/android/bin/src/main/java/cn/reactnative/modules/update/SafeZipFile.class +0 -0
- package/android/bin/src/main/java/cn/reactnative/modules/update/UpdateContext$DownloadFileListener.class +0 -0
- package/android/bin/src/main/java/cn/reactnative/modules/update/UpdateContext.class +0 -0
- package/android/bin/src/main/java/cn/reactnative/modules/update/UpdateModuleImpl.class +0 -0
- package/android/bin/src/main/java/cn/reactnative/modules/update/UpdatePackage.class +0 -0
- package/android/bin/src/newarch/cn/reactnative/modules/update/UpdateModule.class +0 -0
- package/android/bin/src/oldarch/cn/reactnative/modules/update/UpdateModule.class +0 -0
- package/android/src/main/java/cn/reactnative/modules/update/UpdateModuleImpl.java +20 -23
- package/android/src/main/java/cn/reactnative/modules/update/UpdatePackage.java +18 -18
- package/package.json +1 -1
- package/.yarnrc.yml +0 -1
package/android/.project
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<projectDescription>
|
|
3
|
+
<name>react-native-update</name>
|
|
4
|
+
<comment>Project react-native-update created by Buildship.</comment>
|
|
5
|
+
<projects>
|
|
6
|
+
</projects>
|
|
7
|
+
<buildSpec>
|
|
8
|
+
<buildCommand>
|
|
9
|
+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
10
|
+
<arguments>
|
|
11
|
+
</arguments>
|
|
12
|
+
</buildCommand>
|
|
13
|
+
</buildSpec>
|
|
14
|
+
<natures>
|
|
15
|
+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
16
|
+
</natures>
|
|
17
|
+
<filteredResources>
|
|
18
|
+
<filter>
|
|
19
|
+
<id>1727963310481</id>
|
|
20
|
+
<name></name>
|
|
21
|
+
<type>30</type>
|
|
22
|
+
<matcher>
|
|
23
|
+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
24
|
+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
25
|
+
</matcher>
|
|
26
|
+
</filter>
|
|
27
|
+
</filteredResources>
|
|
28
|
+
</projectDescription>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<projectDescription>
|
|
3
|
+
<name>react-native-update</name>
|
|
4
|
+
<comment>Project react-native-update created by Buildship.</comment>
|
|
5
|
+
<projects>
|
|
6
|
+
</projects>
|
|
7
|
+
<buildSpec>
|
|
8
|
+
<buildCommand>
|
|
9
|
+
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
10
|
+
<arguments>
|
|
11
|
+
</arguments>
|
|
12
|
+
</buildCommand>
|
|
13
|
+
<buildCommand>
|
|
14
|
+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
15
|
+
<arguments>
|
|
16
|
+
</arguments>
|
|
17
|
+
</buildCommand>
|
|
18
|
+
</buildSpec>
|
|
19
|
+
<natures>
|
|
20
|
+
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
21
|
+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
22
|
+
</natures>
|
|
23
|
+
<filteredResources>
|
|
24
|
+
<filter>
|
|
25
|
+
<id>1727963310481</id>
|
|
26
|
+
<name></name>
|
|
27
|
+
<type>30</type>
|
|
28
|
+
<matcher>
|
|
29
|
+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
30
|
+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
31
|
+
</matcher>
|
|
32
|
+
</filter>
|
|
33
|
+
</filteredResources>
|
|
34
|
+
</projectDescription>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
arguments=--init-script /var/folders/l6/0fn3x28s5s585ld3p04gsy1h0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/l6/0fn3x28s5s585ld3p04gsy1h0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
|
|
2
|
+
auto.sync=false
|
|
3
|
+
build.scans.enabled=false
|
|
4
|
+
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9))
|
|
5
|
+
connection.project.dir=
|
|
6
|
+
eclipse.preferences.version=1
|
|
7
|
+
gradle.user.home=
|
|
8
|
+
java.home=/Users/sunny/.sdkman/candidates/java/17.0.9-zulu/zulu-17.jdk/Contents/Home
|
|
9
|
+
jvm.arguments=
|
|
10
|
+
offline.mode=false
|
|
11
|
+
override.workspace.settings=true
|
|
12
|
+
show.console.view=true
|
|
13
|
+
show.executions.view=true
|
package/android/bin/jni/HDiffPatch/builds/android_ndk_jni_mk/java/com/github/sisong/HPatch.class
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Decoder$LiteralDecoder$Decoder2.class
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Encoder$LenPriceTableEncoder.class
ADDED
|
Binary file
|
package/android/bin/jni/lzma/Java/SevenZip/Compression/LZMA/Encoder$LiteralEncoder$Encoder2.class
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,10 @@ package cn.reactnative.modules.update;
|
|
|
3
3
|
import android.app.Activity;
|
|
4
4
|
import android.content.Context;
|
|
5
5
|
import android.util.Log;
|
|
6
|
+
|
|
7
|
+
import com.facebook.react.ReactActivity;
|
|
6
8
|
import com.facebook.react.ReactApplication;
|
|
9
|
+
import com.facebook.react.ReactDelegate;
|
|
7
10
|
import com.facebook.react.ReactInstanceManager;
|
|
8
11
|
import com.facebook.react.bridge.JSBundleLoader;
|
|
9
12
|
import com.facebook.react.bridge.Promise;
|
|
@@ -12,16 +15,10 @@ import com.facebook.react.bridge.ReadableMap;
|
|
|
12
15
|
import com.facebook.react.bridge.UiThreadUtil;
|
|
13
16
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
14
17
|
|
|
15
|
-
import org.json.JSONObject;
|
|
16
|
-
|
|
17
18
|
import java.io.File;
|
|
18
19
|
import java.io.IOException;
|
|
19
20
|
import java.lang.reflect.Field;
|
|
20
|
-
import java.util.HashMap;
|
|
21
21
|
import java.util.Map;
|
|
22
|
-
import java.util.Optional;
|
|
23
|
-
import java.util.regex.Matcher;
|
|
24
|
-
import java.util.regex.Pattern;
|
|
25
22
|
|
|
26
23
|
public class UpdateModuleImpl {
|
|
27
24
|
|
|
@@ -101,25 +98,11 @@ public class UpdateModuleImpl {
|
|
|
101
98
|
}
|
|
102
99
|
});
|
|
103
100
|
}catch (Exception e){
|
|
104
|
-
promise.reject("执行报错:"+e.getMessage());
|
|
101
|
+
promise.reject("执行报错:" + e.getMessage());
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
104
|
|
|
108
|
-
|
|
109
|
-
final Activity currentActivity = mContext.getCurrentActivity();
|
|
110
|
-
if (currentActivity == null) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
currentActivity.runOnUiThread(new Runnable() {
|
|
115
|
-
@Override
|
|
116
|
-
public void run() {
|
|
117
|
-
currentActivity.recreate();
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
public static void reloadUpdate(UpdateContext updateContext, ReactApplicationContext mContext, ReadableMap options,Promise promise) {
|
|
105
|
+
public static void reloadUpdate(UpdateContext updateContext, ReactApplicationContext mContext, ReadableMap options, Promise promise) {
|
|
123
106
|
final String hash = options.getString("hash");
|
|
124
107
|
|
|
125
108
|
if (hash == null || hash.isEmpty()) {
|
|
@@ -156,7 +139,21 @@ public class UpdateModuleImpl {
|
|
|
156
139
|
} catch (Throwable err) {
|
|
157
140
|
promise.reject(err);
|
|
158
141
|
Log.e("pushy", "switchVersion failed ", err);
|
|
159
|
-
|
|
142
|
+
final Activity currentActivity = mContext.getCurrentActivity();
|
|
143
|
+
if (currentActivity == null) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
final ReactDelegate reactDelegate = ((ReactActivity) currentActivity).getReactDelegate();
|
|
148
|
+
reactDelegate.reload();
|
|
149
|
+
} catch (Throwable e) {
|
|
150
|
+
currentActivity.runOnUiThread(new Runnable() {
|
|
151
|
+
@Override
|
|
152
|
+
public void run() {
|
|
153
|
+
currentActivity.recreate();
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
160
157
|
}
|
|
161
158
|
}
|
|
162
159
|
});
|
|
@@ -9,9 +9,6 @@ import com.facebook.react.module.model.ReactModuleInfoProvider;
|
|
|
9
9
|
import java.util.HashMap;
|
|
10
10
|
import java.util.Map;
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Created by tdzl2003 on 3/31/16.
|
|
14
|
-
*/
|
|
15
12
|
public class UpdatePackage extends TurboReactPackage {
|
|
16
13
|
@Nullable
|
|
17
14
|
@Override
|
|
@@ -25,21 +22,24 @@ public class UpdatePackage extends TurboReactPackage {
|
|
|
25
22
|
|
|
26
23
|
@Override
|
|
27
24
|
public ReactModuleInfoProvider getReactModuleInfoProvider() {
|
|
28
|
-
return ()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
return new ReactModuleInfoProvider() {
|
|
26
|
+
@Override
|
|
27
|
+
public Map<String, ReactModuleInfo> getReactModuleInfos() {
|
|
28
|
+
final Map<String, ReactModuleInfo> moduleInfos = new HashMap<>();
|
|
29
|
+
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
30
|
+
moduleInfos.put(
|
|
31
|
+
UpdateModuleImpl.NAME,
|
|
32
|
+
new ReactModuleInfo(
|
|
33
|
+
UpdateModuleImpl.NAME,
|
|
34
|
+
UpdateModuleImpl.NAME,
|
|
35
|
+
false, // canOverrideExistingModule
|
|
36
|
+
false, // needsEagerInit
|
|
37
|
+
true, // hasConstants
|
|
38
|
+
false, // isCxxModule
|
|
39
|
+
isTurboModule // isTurboModule
|
|
40
|
+
));
|
|
41
|
+
return moduleInfos;
|
|
42
|
+
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
}
|
package/package.json
CHANGED
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|