Skip to content

Commit c40bf89

Browse files
committed
Revert "fix"
This reverts commit 8001f9f, reversing changes made to bd46592.
1 parent 8001f9f commit c40bf89

File tree

240 files changed

+14687
-9617
lines changed

Some content is hidden

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

240 files changed

+14687
-9617
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- name: Checkout Actions Repository
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v5
1616

1717
- name: Check spelling
1818
uses: crate-ci/typos@master
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Setup Biome
3232
uses: biomejs/setup-biome@v2

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/node_modules
22
/build.json
3-
/www/js/build
4-
/www/css/build
3+
/www/build
54
/plugins
65
/platforms
76
/keystore.jks
@@ -13,3 +12,4 @@ pnpm-lock.yaml
1312
.zed
1413
.idea
1514
ace-builds
15+
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: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
33
"formatter": {
44
"enabled": true,
55
"indentStyle": "tab"
66
},
7-
"organizeImports": {
8-
"enabled": true
7+
"assist": {
8+
"actions": {
9+
"source": {
10+
"organizeImports": "on"
11+
}
12+
}
913
},
1014
"linter": {
1115
"enabled": true,
@@ -34,17 +38,19 @@
3438
"globals": ["Global1"]
3539
},
3640
"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/**/*"
41+
"includes": [
42+
"**/src/**/*",
43+
"**/utils/**/*.js",
44+
"!**/www/build/**/*",
45+
"**/www/res/**/*.css",
46+
"**/src/plugins/terminal/**",
47+
"!**/ace-builds",
48+
"!**/src/plugins/**/*",
49+
"!**/plugins/**/*",
50+
"!**/hooks/**/*",
51+
"!**/fastlane/**/*",
52+
"!**/res/**/*",
53+
"!**/platforms/**/*"
4854
]
4955
}
5056
}

config.xml

Lines changed: 3 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">
@@ -32,13 +32,14 @@
3232
<preference name="AndroidLaunchMode" value="singleTask" />
3333
<preference name="prerendered-icon" value="false" />
3434
<preference name="androidxEnabled" value="true" />
35+
<preference name="android-targetSdkVersion" value="35" />
3536

3637

3738
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
3839
<application android:networkSecurityConfig="@xml/network_security_config" />
3940
<application android:hardwareAccelerated="true" />
40-
<application android:requestLegacyExternalStorage="true" />
4141
<application android:largeHeap="true" />
42+
<application android:requestLegacyExternalStorage="true"/>
4243
</edit-config>
4344

4445
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
@@ -67,7 +68,6 @@
6768
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
6869
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
6970
<uses-permission android:name="android.permission.VIBRATE" />
70-
<!-- <uses-permission android:name="com.termux.permission.RUN_COMMAND" /> -->
7171
</config-file>
7272

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

hooks/post-process.js

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

32154
/**
33155
* Copy directory recursively

0 commit comments

Comments
 (0)