change sth

This commit is contained in:
CounterFire2023 2023-08-04 10:00:24 +08:00
parent beedd5b8d7
commit 8b7fa5fe0b
7 changed files with 1584 additions and 1592 deletions

View File

@ -66,11 +66,11 @@ bool AppDelegate::applicationDidFinishLaunching()
se->start();
se::AutoHandleScope hs;
jsb_run_script("js/jsb-adapter/jsb-builtin.js");
jsb_run_script("js/jcwallet.js");
jsb_run_script("js/platform.js");
jsb_run_script("js/main.js");
jsb_run_script("js/wallet.js");
jsb_run_script("luaframework/Data/js/jsb-adapter/jsb-builtin.js");
jsb_run_script("luaframework/Data/js/jcwallet.js");
jsb_run_script("luaframework/Data/js/platform.js");
jsb_run_script("luaframework/Data/js/main.js");
jsb_run_script("luaframework/Data/js/wallet.js");
se->addAfterCleanupHook([]() {
JSBClassType::destroy();
});

File diff suppressed because it is too large Load Diff

View File

@ -112,7 +112,7 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1177"
endingLineNumber = "1177"
landmarkName = "JSB_loadLocalStorage(s)"
landmarkName = "JSB_walletSecKey(s)"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
@ -128,7 +128,7 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1178"
endingLineNumber = "1178"
landmarkName = "JSB_loadLocalStorage(s)"
landmarkName = "JSB_walletSecKey(s)"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>

View File

@ -522,19 +522,31 @@ function buyTokenWithErc20(funId, currency, amount, gas, estimate) {
}
// begin of token mall
// begin of google pay
// begin of in-app pay
function queryGoogleProducts(funId, productIds) {
let ids = JSON.parse(productIds);
console.log('queryAppleProducts:: ' + productIds);
promiseCb(funId, jc.wallet.paySvr.queryIOSProducts(ids));
console.log('queryGoogleProducts:: ' + productIds);
if (window.JavascriptJavaBridge) {
promiseCb(funId, jc.wallet.paySvr.queryGoogleProducts(ids));
} else {
promiseCb(funId, jc.wallet.paySvr.queryIOSProducts(ids));
}
}
function queryGooglePurchases(funId) {
promiseCb(funId, jc.wallet.paySvr.queryIOSPurchases());
if (window.JavascriptJavaBridge) {
promiseCb(funId, jc.wallet.paySvr.queryGooglePurchases());
} else {
promiseCb(funId, jc.wallet.paySvr.queryIOSPurchases());
}
}
function beginGoogleBuy(funId, productId, orderId) {
promiseCb(funId, jc.wallet.paySvr.beginIOSPurchase(productId, orderId));
if (window.JavascriptJavaBridge) {
promiseCb(funId, jc.wallet.paySvr.buyGoogleProduct(productId, orderId));
} else {
promiseCb(funId, jc.wallet.paySvr.beginIOSPurchase(productId, orderId));
}
}
// end of google pay
// end of in-app pay

View File

@ -5,13 +5,17 @@ if (window.JavascriptJavaBridge) {
jsb.reflection = new JavaScriptObjCBridge();
}
window.jumpToWallet = function(url) {
url = url || 'wc://';
url = url || 'wc://';
if (window.JavascriptJavaBridge) {
url = 'metamask://wc?uri=' + url;
} else {
url = `https://metamask.app.link/wc?uri=${encodeURIComponent(url)}`;
console.log('open native: ' + url);
jsb.toWallet(url);
// jsb.reflection.callStaticMethod(
// 'UnityAppController',
// 'toWallet:',
// url
// )
}
console.log('open native: ' + url);
jsb.toWallet(url);
}
function nativeCallBack(...args) {
console.log(`jniCallback: ${args[0]}`);
jc.wallet.nativeSvr.handleNativeCallback(...args);
}

View File

@ -1,4 +1,5 @@
function nativeCallBack(...args) {
console.log(`jniCallback: ${args[0]}`)
jc.wallet.nativeSvr.handleNativeCallback(...args);
function jniCallback(...args) {
console.log(`jniCallback: ${args[0]} | ${args[1]}`);
jc.wallet.nativeSvr.handleNativeCallback(...args);
}