@@ -107,18 +107,25 @@ const Terminal = {
107107 let axsUrl ;
108108 let prootUrl ;
109109 let libTalloc ;
110+ let libproot = null ;
111+ let libproot32 = null ;
110112
111113 if ( arch === "arm64-v8a" ) {
114+ libproot = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm64/libproot.so" ;
115+ libproot32 = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm64/libproot32.so" ;
112116 libTalloc = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm64/libtalloc.so" ;
113117 prootUrl = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm64/libproot-xed.so" ;
114118 axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/latest/download/axs-musl-android-arm64` ;
115119 alpineUrl = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/aarch64/alpine-minirootfs-3.21.0-aarch64.tar.gz" ;
116120 } else if ( arch === "armeabi-v7a" ) {
121+ libproot = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm32/libproot.so" ;
117122 libTalloc = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm32/libtalloc.so" ;
118123 prootUrl = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm32/libproot-xed.so" ;
119124 axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/latest/download/axs-musl-android-armv7` ;
120125 alpineUrl = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/armhf/alpine-minirootfs-3.21.0-armhf.tar.gz" ;
121126 } else if ( arch === "x86_64" ) {
127+ libproot = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libproot.so" ;
128+ libproot32 = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libproot32.so" ;
122129 libTalloc = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libtalloc.so" ;
123130 prootUrl = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libproot-xed.so" ;
124131 axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/latest/download/axs-musl-android-x86_64` ;
@@ -166,6 +173,27 @@ const Terminal = {
166173 resolve , reject
167174 ) ;
168175 } ) ;
176+
177+ if ( libproot != null ) {
178+ await new Promise ( ( resolve , reject ) => {
179+ cordova . plugin . http . downloadFile (
180+ libproot , { } , { } ,
181+ cordova . file . dataDirectory + "libproot.so" ,
182+ resolve , reject
183+ ) ;
184+ } ) ;
185+ }
186+
187+ if ( libproot32 != null ) {
188+ await new Promise ( ( resolve , reject ) => {
189+ cordova . plugin . http . downloadFile (
190+ libproot32 , { } , { } ,
191+ cordova . file . dataDirectory + "libproot32.so" ,
192+ resolve , reject
193+ ) ;
194+ } ) ;
195+ }
196+
169197 }
170198
171199 logger ( "✅ All downloads completed" ) ;
@@ -198,9 +226,9 @@ const Terminal = {
198226 return installResult ;
199227
200228 } catch ( e ) {
201- err_logger ( "Installation failed:" , e ) ;
202- console . error ( "Installation failed:" , e ) ;
203- return false ;
229+ err_logger ( "Installation failed:" , e ) ;
230+ console . error ( "Installation failed:" , e ) ;
231+ return false ;
204232 }
205233 } ,
206234
@@ -232,7 +260,13 @@ const Terminal = {
232260 } , reject ) ;
233261 } ) ;
234262
235- resolve ( alpineExists && downloaded && extracted ) ;
263+ const configured = alpineExists && await new Promise ( ( resolve , reject ) => {
264+ system . fileExists ( `${ filesDir } /.configured` , false , ( result ) => {
265+ resolve ( result == 1 ) ;
266+ } , reject ) ;
267+ } ) ;
268+
269+ resolve ( alpineExists && downloaded && extracted && configured ) ;
236270 } ) ;
237271 } ,
238272
@@ -358,10 +392,10 @@ const Terminal = {
358392 * console.error(`Uninstall failed: ${error}`);
359393 * }
360394 */
361- uninstall ( ) {
395+ uninstall ( ) {
362396 return new Promise ( async ( resolve , reject ) => {
363- if ( await this . isAxsRunning ( ) ) {
364- await this . stopAxs ( )
397+ if ( await this . isAxsRunning ( ) ) {
398+ await this . stopAxs ( ) ;
365399 }
366400
367401 const cmd = `
@@ -378,13 +412,13 @@ const Terminal = {
378412 done
379413
380414 echo "ok"
381- `
382- const result = await Executor . execute ( cmd )
383- if ( result === "ok" ) {
384- resolve ( result )
385- } else {
386- reject ( result )
387- }
415+ ` ;
416+ const result = await Executor . execute ( cmd ) ;
417+ if ( result === "ok" ) {
418+ resolve ( result ) ;
419+ } else {
420+ reject ( result ) ;
421+ }
388422 } ) ;
389423 }
390424} ;
0 commit comments