Installing all types of packages
This commit is contained in:
parent
18541a6647
commit
24890e9a4c
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
# -r to replace an existing application if any
|
# -r to replace an existing application if any
|
||||||
/opt/android-sdk-linux/platform-tools/adb install -r /shared_buffer/app.apk
|
/opt/android-sdk-linux/platform-tools/adb install-multiple -r /shared_buffer/*.apk
|
||||||
|
@ -148,7 +148,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<form id="upload_form" hx-post="/upload_apk" enctype="multipart/form-data" hx-target="#resp">
|
<form id="upload_form" hx-post="/upload_apk" enctype="multipart/form-data" hx-target="#resp">
|
||||||
<label id="upload_input" for="app">Select file
|
<label id="upload_input" for="app">Select file
|
||||||
<input type="file" id="app" name="app" accept=".apk" required/>
|
<input type="file" id="app" name="app" accept=".apk" required multiple/>
|
||||||
</label>
|
</label>
|
||||||
<button type="submit">Install the app</button>
|
<button type="submit">Install the app</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -6,6 +6,8 @@ import {
|
|||||||
waitFullBoot,
|
waitFullBoot,
|
||||||
} from "./screenshot.mjs";
|
} from "./screenshot.mjs";
|
||||||
|
|
||||||
|
import { execSync } from 'node:child_process';
|
||||||
|
|
||||||
import fileUpload from 'express-fileupload';
|
import fileUpload from 'express-fileupload';
|
||||||
|
|
||||||
const device_size_x = 320;
|
const device_size_x = 320;
|
||||||
@ -62,19 +64,18 @@ app.post("/back", function (req, res) {
|
|||||||
|
|
||||||
// default options
|
// default options
|
||||||
app.use(fileUpload());
|
app.use(fileUpload());
|
||||||
app.post('/upload_apk',function (req, res) {
|
app.post('/upload_apk', async function (req, res) {
|
||||||
if (!req.files || Object.keys(req.files).length === 0) {
|
if (!req.files || Object.keys(req.files).length === 0) {
|
||||||
return res.status(400).send('No files were uploaded.');
|
return res.status(400).send('No files were uploaded.');
|
||||||
}
|
}
|
||||||
let file = req.files.app;
|
execSync("rm -rf /shared_buffer/*");
|
||||||
let uploadPath = '/shared_buffer/app.apk';
|
console.log(req.files);
|
||||||
|
for (const [idx, file] of req.files.app.entries()) {
|
||||||
file.mv(uploadPath, function(err) {
|
let uploadPath = '/shared_buffer/app' + idx + '.apk';
|
||||||
if (err)
|
await file.mv(uploadPath);
|
||||||
return res.status(500).send(err);
|
}
|
||||||
android_websocket.send(`install`);
|
android_websocket.send(`install`);
|
||||||
res.send('File uploaded!');
|
res.send('Files uploaded!');
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
|
||||||
app.post("/home", function (req, res) {
|
app.post("/home", function (req, res) {
|
||||||
|
@ -2,9 +2,8 @@ FROM runmymind/docker-android-sdk:ubuntu-standalone-20230511
|
|||||||
|
|
||||||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk-linux/cmdline-tools/latest/bin:/opt/android-sdk-linux/cmdline-tools/tools/bin:/opt/android-sdk-linux/tools/bin:/opt/android-sdk-linux/build-tools/32.0.0:/opt/android-sdk-linux/platform-tools:/opt/android-sdk-linux/emulator:/opt/android-sdk-linux/bin
|
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk-linux/cmdline-tools/latest/bin:/opt/android-sdk-linux/cmdline-tools/tools/bin:/opt/android-sdk-linux/tools/bin:/opt/android-sdk-linux/build-tools/32.0.0:/opt/android-sdk-linux/platform-tools:/opt/android-sdk-linux/emulator:/opt/android-sdk-linux/bin
|
||||||
|
|
||||||
RUN sdkmanager "system-images;android-33;google_apis;x86_64"
|
RUN sdkmanager --channel=2 "system-images;android-30;google_apis;x86_64" \
|
||||||
RUN echo no | avdmanager create avd -n virtual_dev -b google_apis/x86_64 -k "system-images;android-33;google_apis;x86_64"
|
&& echo no | avdmanager create avd -n virtual_dev -b google_apis/x86_64 -k "system-images;android-30;google_apis;x86_64" \
|
||||||
|
&& apt-get update && apt-get install -y iproute2 iputils-ping npm git
|
||||||
RUN apt-get update && apt-get install -y iproute2 iputils-ping iptables redsocks npm git
|
|
||||||
|
|
||||||
CMD bash /preconf/docker-entrypoint.sh
|
CMD bash /preconf/docker-entrypoint.sh
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
hashed_name=`openssl x509 -inform PEM -subject_hash_old -in /ca-cert.pem | head -1`
|
|
||||||
|
|
||||||
adb start-server
|
adb start-server
|
||||||
emulator -avd virtual_dev -writable-system -no-window -no-audio &
|
emulator -avd virtual_dev -writable-system -no-window -no-audio &
|
||||||
cp /ca-cert.pem /$hashed_name.0
|
|
||||||
bash /preconf/install_cert.sh $hashed_name.0
|
|
||||||
bash /preconf/install_culebra.sh
|
bash /preconf/install_culebra.sh
|
||||||
|
|
||||||
adb emu avd snapshot save configured
|
adb emu avd snapshot save configured
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
wait-for-offline() {
|
|
||||||
while [ $(adb devices | grep offline | wc -l) -eq 0 ]; do
|
|
||||||
sleep 0.1
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
adb wait-for-device
|
|
||||||
adb root
|
|
||||||
|
|
||||||
wait-for-offline
|
|
||||||
adb wait-for-device
|
|
||||||
adb shell avbctl disable-verification
|
|
||||||
|
|
||||||
#here may be the issue with the bypass (start)
|
|
||||||
adb wait-for-device
|
|
||||||
adb reboot
|
|
||||||
|
|
||||||
adb wait-for-device
|
|
||||||
adb root
|
|
||||||
#(end)
|
|
||||||
|
|
||||||
wait-for-offline
|
|
||||||
adb wait-for-device
|
|
||||||
adb remount
|
|
||||||
|
|
||||||
adb wait-for-device
|
|
||||||
adb reboot
|
|
||||||
|
|
||||||
adb wait-for-device
|
|
||||||
adb root
|
|
||||||
|
|
||||||
wait-for-offline
|
|
||||||
adb wait-for-device
|
|
||||||
adb remount
|
|
||||||
|
|
||||||
adb wait-for-device
|
|
||||||
adb push /$1 /system/etc/security/cacerts
|
|
||||||
adb shell chmod 664 /system/etc/security/cacerts/$1
|
|
||||||
adb reboot
|
|
||||||
|
|
||||||
#wait for complete boot
|
|
||||||
adb wait-for-device
|
|
||||||
while [ "$(adb shell getprop sys.boot_completed | tr -d '\r')" != "1" ]; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
Loading…
x
Reference in New Issue
Block a user