1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 10:21:37 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

...

3 Commits

Author SHA1 Message Date
Sunny Luo
1cab582bd0 Update package.json 2025-06-17 22:29:46 +08:00
波仔糕
7da5a165fd modify harmony download logic to async (#502) 2025-06-17 22:29:28 +08:00
sunnylqm
d5194a1ad1 bump version to 10.29.2 and add delayed execution for clearing first-time and rollback marks in UpdateModule 2025-06-16 12:00:19 +08:00
3 changed files with 20 additions and 7 deletions

View File

@@ -4,6 +4,8 @@ import static androidx.core.content.FileProvider.getUriForFile;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
@@ -17,6 +19,7 @@ import java.util.Map;
public class UpdateModule extends NativePushySpec {
UpdateContext updateContext;
public static ReactApplicationContext mContext;
private final Handler handler = new Handler(Looper.getMainLooper());
public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) {
super(reactContext);
this.updateContext = updateContext;
@@ -38,12 +41,22 @@ public class UpdateModule extends NativePushySpec {
boolean isFirstTime = updateContext.isFirstTime();
constants.put("isFirstTime", isFirstTime);
if (isFirstTime) {
updateContext.clearFirstTime();
handler.postDelayed(new Runnable() {
@Override
public void run() {
updateContext.clearFirstTime();
}
}, 2000);
}
String rolledBackVersion = updateContext.rolledBackVersion();
constants.put("rolledBackVersion", rolledBackVersion);
if (rolledBackVersion != null) {
updateContext.clearRollbackMark();
handler.postDelayed(new Runnable() {
@Override
public void run() {
updateContext.clearRollbackMark();
}
}, 2000);
}
constants.put("uuid", updateContext.getKv("uuid"));
return constants;

View File

@@ -73,7 +73,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPpk(
const jsi::Value* args,
size_t count)
{
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadPatchFromPpk", args, count));
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadPatchFromPpk", args, count));
}
static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPackage(
@@ -82,7 +82,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPackage(
const jsi::Value* args,
size_t count)
{
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadPatchFromPackage", args, count));
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadPatchFromPackage", args, count));
}
static jsi::Value _hostFunction_PushyTurboModule_downloadFullUpdate(
@@ -91,7 +91,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadFullUpdate(
const jsi::Value* args,
size_t count)
{
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadFullUpdate", args, count));
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadFullUpdate", args, count));
}
static jsi::Value _hostFunction_PushyTurboModule_downloadAndInstallApk(
@@ -100,7 +100,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadAndInstallApk(
const jsi::Value* args,
size_t count)
{
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadAndInstallApk", args, count));
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadAndInstallApk", args, count));
}

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-update",
"version": "10.29.1",
"version": "10.29.3",
"description": "react-native hot update",
"main": "src/index",
"scripts": {