From 3155163ab1f8e1891781dc33d6a152de1af9824f Mon Sep 17 00:00:00 2001 From: Rohit Kushwaha Date: Wed, 6 May 2026 18:08:56 +0530 Subject: [PATCH 1/2] feat: IAP_AVAILABLE --- package.json | 6 +++--- src/lib/acode.js | 1 + src/lib/config.js | 1 + src/main.js | 6 +++++- utils/scripts/build.sh | 8 ++++++++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index aed6191ec..5811d1a59 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "cordova-plugin-server": {}, "cordova-plugin-ftp": {}, "cordova-plugin-sdcard": {}, - "cordova-plugin-iap": {}, "cordova-plugin-advanced-http": { "ANDROIDBLACKLISTSECURESOCKETPROTOCOLS": "SSLv3,TLSv1" }, @@ -37,12 +36,13 @@ "cordova-plugin-buildinfo": {}, "cordova-plugin-browser": {}, "cordova-plugin-sftp": {}, - "com.foxdebug.acode.rk.exec.proot": {}, "com.foxdebug.acode.rk.exec.terminal": {}, "com.foxdebug.acode.rk.customtabs": {}, "com.foxdebug.acode.rk.plugin.plugincontext": {}, "cordova-plugin-system": {}, - "com.foxdebug.acode.rk.auth": {} + "com.foxdebug.acode.rk.auth": {}, + "com.foxdebug.acode.rk.exec.proot": {}, + "cordova-plugin-iap": {} }, "platforms": [ "android" diff --git a/src/lib/acode.js b/src/lib/acode.js index 9da051240..0c43df705 100644 --- a/src/lib/acode.js +++ b/src/lib/acode.js @@ -321,6 +321,7 @@ export default class Acode { view: cmView, }); + this.define("config",config); this.define("Url", Url); this.define("page", Page); this.define("Color", Color); diff --git a/src/lib/config.js b/src/lib/config.js index 55e444506..a34d196a9 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -36,6 +36,7 @@ export default { TWITTER_URL: "https://x.com/foxbiz_io", INSTAGRAM_URL: "https://www.instagram.com/foxbiz.io/", FOXBIZ_URL: "https://foxbiz.io", + IAP_AVAILABLE: typeof iap !== "undefined", get HAS_PRO() { return hasPro; diff --git a/src/main.js b/src/main.js index ee73ac998..47d5bcb07 100644 --- a/src/main.js +++ b/src/main.js @@ -206,7 +206,11 @@ async function onDeviceReady() { } if (navigator.onLine) { - const purchases = await helpers.promisify(iap.getPurchases); + const purchases = await helpers.promisify(iap.getPurchases).catch((e) => { + console.log("error", "purchase retrieval error"); + console.log("error", e); + return []; + }); const isPro = purchases.find((p) => p.productIds.includes("acode_pro_new"), ); diff --git a/utils/scripts/build.sh b/utils/scripts/build.sh index ea5834040..92bb18792 100644 --- a/utils/scripts/build.sh +++ b/utils/scripts/build.sh @@ -48,6 +48,10 @@ if [ "$fdroidFlag" = "fdroid" ]; then if [ -d "plugins/com.foxdebug.acode.rk.exec.proot" ]; then cordova plugin remove com.foxdebug.acode.rk.exec.proot fi + + if [ -d "plugins/cordova-plugin-iap" ]; then + cordova plugin remove cordova-plugin-iap + fi else if [ -n "$tmpdir" ]; then echo "false" > "$tmpdir/fdroid.bool" @@ -57,6 +61,10 @@ else if [ -d "src/plugins/proot" ] && [ ! -d "plugins/com.foxdebug.acode.rk.exec.proot" ]; then cordova plugin add src/plugins/proot/ fi + + if [ -d "src/plugins/iap" ] && [ ! -d "plugins/cordova-plugin-iap" ]; then + cordova plugin add src/plugins/iap/ + fi fi From bdd7cece215ddda268b0d724f8cd0d3e92eaecf2 Mon Sep 17 00:00:00 2001 From: Rohit Kushwaha Date: Wed, 6 May 2026 18:11:19 +0530 Subject: [PATCH 2/2] fix: removed useless logs --- src/lib/acode.js | 2 +- src/main.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib/acode.js b/src/lib/acode.js index 0c43df705..350ea2fd0 100644 --- a/src/lib/acode.js +++ b/src/lib/acode.js @@ -321,7 +321,7 @@ export default class Acode { view: cmView, }); - this.define("config",config); + this.define("config", config); this.define("Url", Url); this.define("page", Page); this.define("Color", Color); diff --git a/src/main.js b/src/main.js index 47d5bcb07..ee73ac998 100644 --- a/src/main.js +++ b/src/main.js @@ -206,11 +206,7 @@ async function onDeviceReady() { } if (navigator.onLine) { - const purchases = await helpers.promisify(iap.getPurchases).catch((e) => { - console.log("error", "purchase retrieval error"); - console.log("error", e); - return []; - }); + const purchases = await helpers.promisify(iap.getPurchases); const isPro = purchases.find((p) => p.productIds.includes("acode_pro_new"), );