Skip to content

Commit d8ebd19

Browse files
feat. added proot url
1 parent 2591518 commit d8ebd19

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

hooks/post-process.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,12 @@ function patchTargetSdkVersion() {
4848
const sdkRegex = /targetSdkVersion\s+(cordovaConfig\.SDK_VERSION|\d+)/;
4949

5050
if (sdkRegex.test(content)) {
51-
const fdroid = fs.readFileSync(path.join(prefix,'fdroid.bool'), 'utf-8');
51+
const fdroid = fs.readFileSync(path.join(prefix,'fdroid.bool'), 'utf-8').trim();
5252
var api = "34"
53-
if(fdroid === "true"){
53+
if(fdroid == "true"){
5454
api = "28"
55-
}else{
56-
5755
}
58-
56+
5957
content = content.replace(sdkRegex, 'targetSdkVersion '+api);
6058
fs.writeFileSync(gradleFile, content, 'utf-8');
6159
console.log('[Cordova Hook] ✅ Patched targetSdkVersion to '+api);

package-lock.json

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

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
"cordova-plugin-websocket": {},
3838
"cordova-plugin-buildinfo": {},
3939
"cordova-plugin-system": {},
40-
"com.foxdebug.acode.rk.exec.terminal": {},
41-
"com.foxdebug.acode.rk.exec.proot": {}
40+
"com.foxdebug.acode.rk.exec.terminal": {}
4241
},
4342
"platforms": [
4443
"android"
@@ -64,7 +63,6 @@
6463
"@types/url-parse": "^1.4.11",
6564
"autoprefixer": "^10.4.19",
6665
"babel-loader": "^9.1.3",
67-
"com.foxdebug.acode.rk.exec.proot": "file:src/plugins/proot",
6866
"com.foxdebug.acode.rk.exec.terminal": "file:src/plugins/terminal",
6967
"cordova-android": "13.0.0",
7068
"cordova-clipboard": "^1.3.0",

src/plugins/terminal/www/Terminal.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,22 @@ const Terminal = {
8585
try {
8686
let alpineUrl;
8787
let axsUrl;
88-
let prootUrl = "";
89-
let libTalloc = "";
88+
let prootUrl;
89+
let libTalloc;
9090

9191
if (arch === "arm64-v8a") {
92+
libTalloc = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm64/libtalloc.so";
93+
prootUrl = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm64/libproot-xed.so";
9294
axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/download/${AXS_VERSION_TAG}/axs-musl-android-arm64`;
9395
alpineUrl = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/aarch64/alpine-minirootfs-3.21.0-aarch64.tar.gz";
9496
} else if (arch === "armeabi-v7a") {
97+
libTalloc = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm32/libtalloc.so";
98+
prootUrl = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm32/libproot-xed.so";
9599
axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/download/${AXS_VERSION_TAG}/axs-musl-android-armv7`;
96100
alpineUrl = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/armhf/alpine-minirootfs-3.21.0-armhf.tar.gz";
97101
} else if (arch === "x86_64") {
102+
libTalloc = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libtalloc.so";
103+
prootUrl = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libproot-xed.so";
98104
axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/download/${AXS_VERSION_TAG}/axs-musl-android-x86_64`;
99105
alpineUrl = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/x86_64/alpine-minirootfs-3.21.0-x86_64.tar.gz";
100106
} else {

0 commit comments

Comments
 (0)