From 1fc4f21b68b5545f5be3fbca2fe6467b50f7eae3 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Mon, 10 Nov 2025 10:34:48 +0530 Subject: [PATCH 1/3] Update AdMob plugin and build preferences Upgraded admob-plus-cordova to version 2.0.0-alpha.19 and updated PLAY_SERVICES_VERSION to 23.2.0 in utils/config.js. Changed the clean command from 'yarn clean' to 'npm run clean'. Added GradlePluginKotlinEnabled preference to config.xml for improved Android build compatibility. --- config.xml | 3 ++- utils/config.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.xml b/config.xml index e16759716..ad54b62b4 100644 --- a/config.xml +++ b/config.xml @@ -32,9 +32,10 @@ + - + diff --git a/utils/config.js b/utils/config.js index 93448eb87..ae015122c 100755 --- a/utils/config.js +++ b/utils/config.js @@ -85,7 +85,7 @@ const exec = promisify(require("node:child_process").exec); `cordova plugin add cordova-plugin-consent@2.4.0 --save`, ); await exec( - `cordova plugin add admob-plus-cordova@1.28.0 --save --variable APP_ID_ANDROID="${AD_APP_ID}" --variable PLAY_SERVICES_VERSION="21.5.0"`, + `cordova plugin add admob-plus-cordova@2.0.0-alpha.19 --save --variable APP_ID_ANDROID="${AD_APP_ID}" --variable PLAY_SERVICES_VERSION="23.2.0"`, ); console.log("DONE! Installing admob-plus-cordova"); } else { @@ -96,7 +96,7 @@ const exec = promisify(require("node:child_process").exec); } console.log(`|--- Reinstalling platform ---|`); - const { stderr } = await exec(`yarn clean`); + const { stderr } = await exec(`npm run clean`); if (stderr) console.error(stderr); else console.log("DONE! Reinstalling platform"); })(), From 03d2bd62f4bee8f5c2bb6ee453f327bc3a08b236 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Mon, 10 Nov 2025 11:09:18 +0530 Subject: [PATCH 2/3] fix: system theme on free version --- src/lib/settings.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/settings.js b/src/lib/settings.js index 08c9b61c1..38113cfe1 100644 --- a/src/lib/settings.js +++ b/src/lib/settings.js @@ -185,12 +185,10 @@ class Settings { if (this.#initialized) return; this.settingsFile = Url.join(DATA_STORAGE, "settings.json"); - if (!IS_FREE_VERSION) { - this.#defaultSettings.appTheme = "system"; - this.#defaultSettings.editorTheme = getSystemEditorTheme( - isDeviceDarkTheme(), - ); - } + this.#defaultSettings.appTheme = "system"; + this.#defaultSettings.editorTheme = getSystemEditorTheme( + isDeviceDarkTheme(), + ); this.#initialized = true; From 705b1115b14d909394696b721488ba808f6819a4 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Mon, 10 Nov 2025 11:10:31 +0530 Subject: [PATCH 3/3] Add dynamic resource resolution for styles and icons --- .../src/android/AlpineDocumentProvider.java | 23 ++++++++++++++++--- .../terminal/src/android/TerminalService.java | 19 +++++++++++---- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/plugins/terminal/src/android/AlpineDocumentProvider.java b/src/plugins/terminal/src/android/AlpineDocumentProvider.java index f69e58315..6d511a6f4 100644 --- a/src/plugins/terminal/src/android/AlpineDocumentProvider.java +++ b/src/plugins/terminal/src/android/AlpineDocumentProvider.java @@ -19,7 +19,6 @@ import java.util.Collections; import java.util.LinkedList; import java.util.Locale; -import com.foxdebug.acode.R; public class AlpineDocumentProvider extends DocumentsProvider { @@ -60,7 +59,7 @@ public Cursor queryRoots(String[] projection) { MatrixCursor result = new MatrixCursor( projection != null ? projection : DEFAULT_ROOT_PROJECTION ); - String applicationName = "Acode"; + String applicationName = getApplicationLabel(); MatrixCursor.RowBuilder row = result.newRow(); row.add(DocumentsContract.Root.COLUMN_ROOT_ID, getDocIdForFile(BASE_DIR)); @@ -75,7 +74,7 @@ public Cursor queryRoots(String[] projection) { row.add(DocumentsContract.Root.COLUMN_TITLE, applicationName); row.add(DocumentsContract.Root.COLUMN_MIME_TYPES, ALL_MIME_TYPES); row.add(DocumentsContract.Root.COLUMN_AVAILABLE_BYTES, BASE_DIR.getFreeSpace()); - row.add(DocumentsContract.Root.COLUMN_ICON, R.mipmap.ic_launcher); + row.add(DocumentsContract.Root.COLUMN_ICON, resolveLauncherIcon()); return result; } @@ -364,4 +363,22 @@ private static String getMimeType(File file) { return "application/octet-stream"; } } + private int resolveLauncherIcon() { + Context context = getContext(); + if (context == null) return android.R.mipmap.sym_def_app_icon; + int icon = context.getResources().getIdentifier("ic_launcher", "mipmap", context.getPackageName()); + return icon != 0 ? icon : android.R.mipmap.sym_def_app_icon; + } + + private String getApplicationLabel() { + Context context = getContext(); + if (context == null) return "Acode"; + PackageManager pm = context.getPackageManager(); + try { + CharSequence label = pm.getApplicationLabel(context.getApplicationInfo()); + return label != null ? label.toString() : "Acode"; + } catch (Exception ignored) { + return "Acode"; + } + } } diff --git a/src/plugins/terminal/src/android/TerminalService.java b/src/plugins/terminal/src/android/TerminalService.java index 813143f62..d5f85ad93 100644 --- a/src/plugins/terminal/src/android/TerminalService.java +++ b/src/plugins/terminal/src/android/TerminalService.java @@ -16,7 +16,6 @@ import android.os.PowerManager; import android.os.RemoteException; import androidx.core.app.NotificationCompat; -import com.foxdebug.acode.R; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -360,13 +359,15 @@ private void updateNotification() { String contentText = "Executor service" + (isWakeLockHeld ? " (wakelock held)" : ""); String wakeLockButtonText = isWakeLockHeld ? "Release Wake Lock" : "Acquire Wake Lock"; + int notificationIcon = resolveDrawableId("ic_notification", "ic_launcher_foreground", "ic_launcher"); + Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID) .setContentTitle("Acode Service") .setContentText(contentText) - .setSmallIcon(R.drawable.ic_launcher_foreground) + .setSmallIcon(notificationIcon) .setOngoing(true) - .addAction(R.drawable.ic_launcher_foreground, wakeLockButtonText, wakeLockPendingIntent) - .addAction(R.drawable.ic_launcher_foreground, "Exit", exitPendingIntent) + .addAction(notificationIcon, wakeLockButtonText, wakeLockPendingIntent) + .addAction(notificationIcon, "Exit", exitPendingIntent) .build(); startForeground(1, notification); @@ -390,4 +391,12 @@ public void onDestroy() { clientMessengers.clear(); threadPool.shutdown(); } -} \ No newline at end of file + + private int resolveDrawableId(String... names) { + for (String name : names) { + int id = getResources().getIdentifier(name, "drawable", getPackageName()); + if (id != 0) return id; + } + return android.R.drawable.sym_def_app_icon; + } +}