feat: 光环助手va组件兼容旧版畅玩助手游戏业务

This commit is contained in:
yangfei
2023-12-12 19:32:13 +08:00
parent 1bc2ef205b
commit 8f84cf8d51
10 changed files with 253 additions and 201 deletions

View File

@ -142,6 +142,8 @@ import io.reactivex.SingleSource;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
@ -730,14 +732,11 @@ public class MainActivity extends BaseActivity {
ToastUtils.showToast("游戏启动中,请稍后~");
handler.postDelayed(() -> {
VHelper.postOnInitialized(() -> {
if (VHelper.isInstalled(gamePackageName)) {
VHelper.launch(this, gamePackageName, false, true);
} else {
ToastUtils.showToast("应用已被卸载!");
}
return null;
});
if (VHelper.isLegacyGame(gamePackageName)) {
VHelper.postOnInitialized(launchGame(gamePackageName));
} else {
launchGame(gamePackageName).invoke();
}
}, 500);
break;
case KEY_MARKET_DETAILS:
@ -755,6 +754,18 @@ public class MainActivity extends BaseActivity {
}, 500);
}
@NonNull
private Function0<Unit> launchGame(String gamePackageName) {
return () -> {
if (!VHelper.isInnerInstalled(gamePackageName) && !VHelper.isInstalled(gamePackageName)) {
ToastUtils.showToast("应用已被卸载!");
} else {
VHelper.launch(this, gamePackageName, false, true);
}
return null;
};
}
/**
* 应用跳转
*/