Skip to content

Commit 51f5040

Browse files
authored
Merge branch 'Acode-Foundation:main' into ai-test
2 parents 1b5c838 + 4a6135f commit 51f5040

13 files changed

Lines changed: 748 additions & 219 deletions

File tree

hooks/post-process.js

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ function getTmpDir() {
5050
fs.accessSync("/tmp", fs.constants.R_OK | fs.constants.W_OK);
5151
return "/tmp";
5252
} catch {
53-
console.error("Error: No usable temporary directory found (TMPDIR or /tmp not accessible).");
54-
process.exit(1);
53+
console.log("Error: No usable temporary directory found (TMPDIR or /tmp not accessible).");
54+
return null;
55+
// process.exit(1);
5556
}
5657
}
5758

@@ -70,18 +71,32 @@ function patchTargetSdkVersion() {
7071

7172
if (sdkRegex.test(content)) {
7273
let api = "35";
73-
const froidFlag = path.join(getTmpDir(), 'fdroid.bool');
74+
const tmp = getTmpDir();
75+
if (tmp == null) {
76+
console.warn("---------------------------------------------------------------------------------\n\n\n\n");
77+
console.warn(`⚠️ fdroid.bool not found`);
78+
console.warn("⚠️ Fdroid flavour will be built");
79+
api = "28";
80+
console.warn("\n\n\n\n---------------------------------------------------------------------------------");
81+
} else {
82+
const froidFlag = path.join(getTmpDir(), 'fdroid.bool');
7483

75-
if (fs.existsSync(froidFlag)) {
76-
const fdroid = fs.readFileSync(froidFlag, 'utf-8').trim();
77-
if (fdroid == "true") {
84+
if (fs.existsSync(froidFlag)) {
85+
const fdroid = fs.readFileSync(froidFlag, 'utf-8').trim();
86+
if (fdroid == "true") {
87+
api = "28";
88+
}
89+
} else {
90+
console.warn("---------------------------------------------------------------------------------\n\n\n\n");
91+
console.warn(`⚠️ fdroid.bool not found`);
92+
console.warn("⚠️ Fdroid flavour will be built");
7893
api = "28";
94+
console.warn("\n\n\n\n---------------------------------------------------------------------------------");
95+
//process.exit(1);
7996
}
80-
} else {
81-
console.error(`${getTmpDir()}/fdroid.bool not found`);
82-
process.exit(1);
8397
}
8498

99+
85100
content = content.replace(sdkRegex, 'targetSdkVersion ' + api);
86101
fs.writeFileSync(gradleFile, content, 'utf-8');
87102
console.log('[Cordova Hook] ✅ Patched targetSdkVersion to ' + api);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
"cordova-sqlite-storage": {},
3737
"cordova-plugin-websocket": {},
3838
"cordova-plugin-buildinfo": {},
39-
"com.foxdebug.acode.rk.exec.terminal": {},
4039
"cordova-plugin-browser": {},
41-
"cordova-plugin-system": {}
40+
"cordova-plugin-system": {},
41+
"com.foxdebug.acode.rk.exec.terminal": {}
4242
},
4343
"platforms": [
4444
"android"

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ yarn setup
6060
2. Build the project:
6161

6262
```shell
63-
yarn build <free|paid> <p|prod|d|dev> [fdroid]
63+
yarn build <free|paid> <p|prod|d|dev> [fdroid] <apk/bundle>
6464
```
6565

6666
**Note**: Add the fdroid flag only if you want to build the F-Droid-compatible version of Acode.

src/components/sidebar/style.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ body.no-animation {
139139
max-height: 100%;
140140

141141
&.hidden {
142-
max-height: 30px;
143-
min-height: 30px;
142+
max-height: 30px !important;
143+
min-height: 30px !important;
144144
overflow: hidden !important;
145145
}
146146

@@ -321,4 +321,4 @@ body.no-animation {
321321
background-color: var(--border-color);
322322
margin: 4px 0;
323323
}
324-
}
324+
}

src/lang/id-id.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"soft tab": "Tab lunak",
8686
"sort by name": "Urutkan berdasarkan nama",
8787
"success": "Sukses",
88-
"tab size": "Ukuram Tab",
88+
"tab size": "Ukuran Tab",
8989
"text wrap": "Bungkus Teks",
9090
"theme": "Tema",
9191
"unable to delete file": "Tidak dapat menghapus berkas",

src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ async function onDeviceReady() {
176176

177177
system.requestPermission("android.permission.READ_EXTERNAL_STORAGE");
178178
system.requestPermission("android.permission.WRITE_EXTERNAL_STORAGE");
179+
system.requestPermission("android.permission.POST_NOTIFICATIONS");
179180

180181
const { versionCode } = BuildInfo;
181182

src/plugins/terminal/plugin.xml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<config-file parent="/*" target="AndroidManifest.xml" />
2121

2222
<source-file src="src/android/Executor.java" target-dir="src/com/foxdebug/acode/rk/exec/terminal" />
23+
<source-file src="src/android/TerminalService.java" target-dir="src/com/foxdebug/acode/rk/exec/terminal" />
24+
2325
<source-file src="src/android/AlpineDocumentProvider.java" target-dir="src/com/foxdebug/acode/rk/exec/terminal" />
2426

2527
<source-file src="scripts/init-sandbox.sh" target-dir="assets"/>
@@ -29,16 +31,30 @@
2931

3032
<config-file target="AndroidManifest.xml" parent="./application">
3133
<provider
32-
android:name="com.foxdebug.acode.rk.exec.terminal.AlpineDocumentProvider"
33-
android:authorities="${applicationId}.documents"
34-
android:exported="true"
35-
android:grantUriPermissions="true"
36-
android:icon="@mipmap/ic_launcher"
37-
android:permission="android.permission.MANAGE_DOCUMENTS">
34+
android:name="com.foxdebug.acode.rk.exec.terminal.AlpineDocumentProvider"
35+
android:authorities="${applicationId}.documents"
36+
android:exported="true"
37+
android:grantUriPermissions="true"
38+
android:icon="@mipmap/ic_launcher"
39+
android:permission="android.permission.MANAGE_DOCUMENTS">
3840
<intent-filter>
3941
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
4042
</intent-filter>
4143
</provider>
44+
45+
<service
46+
android:name="com.foxdebug.acode.rk.exec.terminal.TerminalService"
47+
android:enabled="true"
48+
android:foregroundServiceType="specialUse"
49+
android:exported="true" />
50+
51+
</config-file>
52+
53+
<config-file target="AndroidManifest.xml" parent="/manifest">
54+
<uses-permission android:name="android.permission.WAKE_LOCK"/>
55+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
56+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"/>
57+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
4258
</config-file>
4359

4460

0 commit comments

Comments
 (0)