Skip to content

Commit 0e23e3a

Browse files
Merge branch 'main' into update-iap
2 parents 43d7c6a + da47d95 commit 0e23e3a

File tree

160 files changed

+10522
-2098
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+10522
-2098
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ pnpm-lock.yaml
1313
.zed
1414
.idea
1515
ace-builds
16+
fdroid.bool

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Change Log
22

3+
## v1.11.5 (963)
4+
5+
* Alpine Linux Backend by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1401
6+
* fix: html escaping for console page by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1411
7+
* Create plugin for native libs by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1413
8+
* feat: terminal frontend by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1415
9+
* Update hu-hu.json translation by @summoner001 in https://github.com/Acode-Foundation/Acode/pull/1423, https://github.com/Acode-Foundation/Acode/pull/1425, https://github.com/Acode-Foundation/Acode/pull/1440
10+
* chore: update id-id.json translation by @hyperz111 in https://github.com/Acode-Foundation/Acode/pull/1424, https://github.com/Acode-Foundation/Acode/pull/1447
11+
* All file access permission for terminal by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1426
12+
* refactor: plugins page by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1428
13+
* Fixed infinite scrolling in case of filtering on both plugin page and sidebar
14+
* Ui improvements on plugin page
15+
* Revamped few themes(fixes visibility issue) and Added few new ones by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1430
16+
* New theme: Neon, Sunset, Glass, Glass Dark
17+
* Revamped themes: System (Dark & Light), Oled, Light
18+
* System theme option is available on free too.
19+
* fix: scaling issue by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1431
20+
* fix: quicktools toggler responsiveness(scaling) and migrate biome by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1442
21+
* chore: update ace to v1.43.2 by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1443
22+
* feat: add uninstall option in terminal setting and tab subtitle fixes by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1445
23+
* feat: alpine document provider(exposes terminal public dir to saf picker) by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1444
24+
* feat: improved logging + fix terminal installation failure by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1446
25+
* some terminal related quality improvements by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1449
26+
* fix: dont start selection in case of back gesture
27+
* remove useless border-radius from terminal container
28+
* fix: improve terminal cursor positioning for mobile keyboard events
29+
* fix: update terminal container background when theme changes
30+
* exclude alpine/public while backup by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1450
31+
* Custom port support in Terminal manager by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1459
32+
* 🌐 i18n(locale): update vietnamese translations by @Nekitori17 in https://github.com/Acode-Foundation/Acode/pull/1461
33+
* fix: infinite loading when previewing by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1460
34+
* Feat/some improvements to terminal and its api by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1463
35+
* Fixes/sidebar extension state by clearing and active autocompletion box background by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1466
36+
* feat: add terminal like search and replace history by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1467
37+
* fix: theme issue in terminal context menu
38+
* fix: prevent folder paste loops and improve SAF handling(termux) in cut operation by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1474
39+
- Add validation to prevent pasting folders into themselves or subdirectories
40+
- Implement special Termux SAF handling for cut operations with recursive file/folder moving
41+
- Fix createFileStructure to handle nested paths (foo/bar) for file:// URIs
42+
343
## v1.11.4 (962)
444

545
* Fix renaming current Termux URI file whilst viewing/editing it by @peasneovoyager2banana2

biome.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
33
"formatter": {
44
"enabled": true,
55
"indentStyle": "tab"
66
},
7-
"organizeImports": {
8-
"enabled": true
9-
},
7+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
108
"linter": {
119
"enabled": true,
1210
"rules": {
@@ -34,17 +32,21 @@
3432
"globals": ["Global1"]
3533
},
3634
"files": {
37-
"include": ["src/**/*", "utils/**/*.js", "www/**/*.js", "www/res/**/*.css"],
38-
"ignore": [
39-
"ace-builds",
40-
"www/js/**/*.js",
41-
"www/css/**/*.css",
42-
"src/plugins/**/*",
43-
"plugins/**/*",
44-
"hooks/**/*",
45-
"fastlane/**/*",
46-
"res/**/*",
47-
"platforms/**/*"
35+
"includes": [
36+
"**/src/**/*",
37+
"**/utils/**/*.js",
38+
"**/www/**/*.js",
39+
"**/www/res/**/*.css",
40+
"**/src/plugins/terminal/**",
41+
"!**/ace-builds",
42+
"!**/www/js/**/*.js",
43+
"!**/www/css/**/*.css",
44+
"!**/src/plugins/**/*",
45+
"!**/plugins/**/*",
46+
"!**/hooks/**/*",
47+
"!**/fastlane/**/*",
48+
"!**/res/**/*",
49+
"!**/platforms/**/*"
4850
]
4951
}
5052
}

config.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8' ?>
2-
<widget id="com.foxdebug.acode" android-versionCode="962" version="1.11.4"
2+
<widget id="com.foxdebug.acode" android-versionCode="963" version="1.11.5"
33
xmlns="http://www.w3.org/ns/widgets"
44
xmlns:android="http://schemas.android.com/apk/res/android"
55
xmlns:cdv="http://cordova.apache.org/ns/1.0">
@@ -37,8 +37,8 @@
3737
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
3838
<application android:networkSecurityConfig="@xml/network_security_config" />
3939
<application android:hardwareAccelerated="true" />
40-
<application android:requestLegacyExternalStorage="true" />
4140
<application android:largeHeap="true" />
41+
<application android:requestLegacyExternalStorage="true"/>
4242
</edit-config>
4343

4444
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
@@ -67,7 +67,6 @@
6767
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
6868
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
6969
<uses-permission android:name="android.permission.VIBRATE" />
70-
<!-- <uses-permission android:name="com.termux.permission.RUN_COMMAND" /> -->
7170
</config-file>
7271

7372
<hook type="before_prepare" src="hooks/modify-java-files.js" />

hooks/post-process.js

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable no-console */
22
const path = require('path');
33
const fs = require('fs');
4+
const { execSync } = require('child_process');
45

56
const buildFilePath = path.resolve(__dirname, '../build.json');
67
const copyToPath = path.resolve(__dirname, '../platforms/android/build.json');
@@ -28,6 +29,123 @@ deleteDirRecursively(resPath, [
2829
'xml',
2930
]);
3031
copyDirRecursively(localResPath, resPath);
32+
enableLegacyJni()
33+
enableStaticContext()
34+
patchTargetSdkVersion()
35+
36+
37+
function patchTargetSdkVersion() {
38+
const prefix = execSync('npm prefix').toString().trim();
39+
const gradleFile = path.join(prefix, 'platforms/android/app/build.gradle');
40+
41+
if (!fs.existsSync(gradleFile)) {
42+
console.warn('[Cordova Hook] ⚠️ build.gradle not found');
43+
return;
44+
}
45+
46+
let content = fs.readFileSync(gradleFile, 'utf-8');
47+
48+
const sdkRegex = /targetSdkVersion\s+(cordovaConfig\.SDK_VERSION|\d+)/;
49+
50+
if (sdkRegex.test(content)) {
51+
const fdroid = fs.readFileSync(path.join(prefix,'fdroid.bool'), 'utf-8').trim();
52+
var api = "34"
53+
if(fdroid == "true"){
54+
api = "28"
55+
}
56+
57+
content = content.replace(sdkRegex, 'targetSdkVersion '+api);
58+
fs.writeFileSync(gradleFile, content, 'utf-8');
59+
console.log('[Cordova Hook] ✅ Patched targetSdkVersion to '+api);
60+
} else {
61+
console.warn('[Cordova Hook] ⚠️ targetSdkVersion not found');
62+
}
63+
}
64+
65+
66+
function enableLegacyJni() {
67+
const prefix = execSync('npm prefix').toString().trim();
68+
const gradleFile = path.join(prefix, 'platforms/android/app/build.gradle');
69+
70+
if (!fs.existsSync(gradleFile)) return;
71+
72+
let content = fs.readFileSync(gradleFile, 'utf-8');
73+
// Check for correct block to avoid duplicate insertion
74+
if (content.includes('useLegacyPackaging = true')) return;
75+
76+
// Inject under android block with correct Groovy syntax
77+
content = content.replace(/android\s*{/, match => {
78+
return (
79+
match +
80+
`
81+
packagingOptions {
82+
jniLibs {
83+
useLegacyPackaging = true
84+
}
85+
}`
86+
);
87+
});
88+
89+
fs.writeFileSync(gradleFile, content, 'utf-8');
90+
console.log('[Cordova Hook] ✅ Enabled legacy JNI packaging');
91+
}
92+
93+
function enableStaticContext() {
94+
try {
95+
const prefix = execSync('npm prefix').toString().trim();
96+
const mainActivityPath = path.join(
97+
prefix,
98+
'platforms/android/app/src/main/java/com/foxdebug/acode/MainActivity.java'
99+
);
100+
101+
if (!fs.existsSync(mainActivityPath)) {
102+
return;
103+
}
104+
105+
let content = fs.readFileSync(mainActivityPath, 'utf-8');
106+
107+
// Skip if fully patched
108+
if (
109+
content.includes('WeakReference<Context>') &&
110+
content.includes('public static Context getContext()') &&
111+
content.includes('weakContext = new WeakReference<>(this);')
112+
) {
113+
return;
114+
}
115+
116+
// Add missing imports
117+
if (!content.includes('import java.lang.ref.WeakReference;')) {
118+
content = content.replace(
119+
/import org\.apache\.cordova\.\*;/,
120+
match =>
121+
match +
122+
'\nimport android.content.Context;\nimport java.lang.ref.WeakReference;'
123+
);
124+
}
125+
126+
// Inject static field and method into class body
127+
content = content.replace(
128+
/public class MainActivity extends CordovaActivity\s*\{/,
129+
match =>
130+
match +
131+
`\n\n private static WeakReference<Context> weakContext;\n\n` +
132+
` public static Context getContext() {\n` +
133+
` return weakContext != null ? weakContext.get() : null;\n` +
134+
` }\n`
135+
);
136+
137+
// Insert weakContext assignment inside onCreate
138+
content = content.replace(
139+
/super\.onCreate\(savedInstanceState\);/,
140+
`super.onCreate(savedInstanceState);\n weakContext = new WeakReference<>(this);`
141+
);
142+
143+
fs.writeFileSync(mainActivityPath, content, 'utf-8');
144+
} catch (err) {
145+
console.error('[Cordova Hook] ❌ Failed to patch MainActivity:', err.message);
146+
}
147+
}
148+
31149

32150
/**
33151
* Copy directory recursively

0 commit comments

Comments
 (0)