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/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;
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;
+ }
+}
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");
})(),