You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

222 lines
6.4 KiB
Markdown

5 years ago
# Waydroid Extras Script
3 years ago
Script to add GApps and other stuff to Waydroid!
5 years ago
# Installation/Usage
## Interactive terminal interface
```
3 years ago
git clone https://github.com/casualsnek/waydroid_script
cd waydroid_script
python3 -m venv venv
venv/bin/pip install -r requirements.txt
sudo venv/bin/python3 main.py
```
![image-20230430013103883](assets/img/README/image-20230430013103883.png)
![image-20230430013119763](assets/img/README/image-20230430013119763.png)
![image-20230430013148814](assets/img/README/image-20230430013148814.png)
## Command line
```bash
git clone https://github.com/casualsnek/waydroid_script
cd waydroid_script
python3 -m venv venv
venv/bin/pip install -r requirements.txt
# install something
Feature: install self-signed cacert to trust store For analysis and reverse engineering, it can be helpful to insert a custom CA certificate into Waydroid’s system-wide trust store. Users used to be able to do that via Android’s settings but not anymore. The `install mitm` command accepts a path to a file that contains a – typically self-signed – CA certificate in PEM format. It then renames [1] and copies the file into the overlay file system, placing it into Waydroid’s trust store. As a usage example, the following command lines enable your host to use mitmproxy [2] to act as a proxy and to intercept [3] HTTP(S) connections that come from the Waydroid container: ```sh $ timeout --preserve-status 2 mitmdump -n # creates a CA cert in ~/.mitmproxy $ sudo venv/bin/python3 main.py install mitm --ca-cert ~/.mitmproxy/mitmproxy-ca-cert.pem INFO: Creating directory: /system/etc/security/cacerts INFO: Copying /home/yourname/.mitmproxy/mitmproxy-ca-cert.pem to system trust store INFO: Target file: /system/etc/security/cacerts/6320a7db.0 INFO: mitm installation finished $ sudo waydroid shell -- ls -l /system/etc/security/cacerts # double-check that it worked […] -rw-r--r-- 1 root root 1191 2024-01-01 00:00 6320a7db.0 […] $ adb shell settings put global http_proxy ${YOUR_IP_HERE?}:3128 # tell Waydroid to use the proxy # for all connections $ mitmproxy -p 3128 # start proxy and display a TUI # with HTTP(S) connections # coming from Waydroid ``` [1]: https://docs.mitmproxy.org/stable/howto-install-system-trusted-ca-android/#2-rename-certificate [2]: https://mitmproxy.org/ [3]: https://docs.mitmproxy.org/stable/mitmproxytutorial-interceptrequests/
3 years ago
sudo venv/bin/python3 main.py install {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg, mitm}
# uninstall something
sudo venv/bin/python3 main.py uninstall {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg}
# get Android device ID
sudo venv/bin/python3 main.py certified
# some hacks
sudo venv/bin/python3 main.py hack {nodataperm, hidestatusbar}
```
5 years ago
## Dependencies
"lzip" is required for this script to work, install it using your distribution's package manager:
### Arch, Manjaro, and EndeavourOS-based distributions:
sudo pacman -S lzip
### Debian and Ubuntu-based distributions:
sudo apt install lzip
### RHEL, Fedora, and Rocky-based distributions:
sudo dnf install lzip
### openSUSE-based distributions:
sudo zypper install lzip
## Install Open GApps
5 years ago
4 years ago
![](assets/1.png)
Open the terminal and switch to the directory where "main.py" is located, then run:
5 years ago
sudo venv/bin/python3 main.py install gapps
5 years ago
Then launch Waydroid with:
5 years ago
waydroid show-full-ui
4 years ago
After Waydroid has finished booting, open the terminal and switch to the directory where "main.py" is located, then run:
5 years ago
4 years ago
sudo python3 main.py google
5 years ago
Copy the returned numeric ID, then
open ["https://google.com/android/uncertified/?pli=1"](https://google.com/android/uncertified/?pli=1). Enter the ID and
register it. Wait 10–20 minutes for the device to get registered. Then clear Google Play Service's cache and try logging
in!
## Install Magisk
4 years ago
![](assets/2.png)
Open the terminal and switch to the directory where "main.py" is located, then run:
sudo venv/bin/python3 main.py install magisk
Magisk will be installed on next boot!
Zygisk and modules like LSPosed should work now.
If you want to update Magisk, Please use `Direct Install into system partition` or run this script again.
This script only focuses on Magisk installation, if you need more management, please
check https://github.com/nitanmarcel/waydroid-magisk
4 years ago
## Install libndk ARM translation
5 years ago
libndk_translation from guybrush firmware.
4 years ago
libndk seems to have better performance than libhoudini on AMD.
Open the terminal and switch to the directory where "main.py" is located, then run:
5 years ago
sudo venv/bin/python3 main.py install libndk
## Install libhoudini ARM translation
4 years ago
Intel's libhoudini for intel/AMD x86 CPU, pulled from Microsoft's WSA 11 image
houdini version: 11.0.1b_y.38765.m
houdini64 version: 11.0.1b_z.38765.m
Open the terminal and switch to the directory where "main.py" is located, then run:
sudo venv/bin/python3 main.py install libhoudini
## Integrate Widevine DRM (L3)
4 years ago
![](assets/3.png)
Open the terminal and switch to the directory where "main.py" is located, then run:
4 years ago
sudo venv/bin/python3 main.py install widevine
4 years ago
## Install Smart Dock
![](assets/4.png)
![](assets/5.png)
Open the terminal and switch to the directory where "main.py" is located, then run:
4 years ago
sudo venv/bin/python3 main.py install smartdock
Feature: install self-signed cacert to trust store For analysis and reverse engineering, it can be helpful to insert a custom CA certificate into Waydroid’s system-wide trust store. Users used to be able to do that via Android’s settings but not anymore. The `install mitm` command accepts a path to a file that contains a – typically self-signed – CA certificate in PEM format. It then renames [1] and copies the file into the overlay file system, placing it into Waydroid’s trust store. As a usage example, the following command lines enable your host to use mitmproxy [2] to act as a proxy and to intercept [3] HTTP(S) connections that come from the Waydroid container: ```sh $ timeout --preserve-status 2 mitmdump -n # creates a CA cert in ~/.mitmproxy $ sudo venv/bin/python3 main.py install mitm --ca-cert ~/.mitmproxy/mitmproxy-ca-cert.pem INFO: Creating directory: /system/etc/security/cacerts INFO: Copying /home/yourname/.mitmproxy/mitmproxy-ca-cert.pem to system trust store INFO: Target file: /system/etc/security/cacerts/6320a7db.0 INFO: mitm installation finished $ sudo waydroid shell -- ls -l /system/etc/security/cacerts # double-check that it worked […] -rw-r--r-- 1 root root 1191 2024-01-01 00:00 6320a7db.0 […] $ adb shell settings put global http_proxy ${YOUR_IP_HERE?}:3128 # tell Waydroid to use the proxy # for all connections $ mitmproxy -p 3128 # start proxy and display a TUI # with HTTP(S) connections # coming from Waydroid ``` [1]: https://docs.mitmproxy.org/stable/howto-install-system-trusted-ca-android/#2-rename-certificate [2]: https://mitmproxy.org/ [3]: https://docs.mitmproxy.org/stable/mitmproxytutorial-interceptrequests/
3 years ago
## Install a self-signed CA certificate
Open the terminal and switch to the directory where "main.py" is located, then run:
Feature: install self-signed cacert to trust store For analysis and reverse engineering, it can be helpful to insert a custom CA certificate into Waydroid’s system-wide trust store. Users used to be able to do that via Android’s settings but not anymore. The `install mitm` command accepts a path to a file that contains a – typically self-signed – CA certificate in PEM format. It then renames [1] and copies the file into the overlay file system, placing it into Waydroid’s trust store. As a usage example, the following command lines enable your host to use mitmproxy [2] to act as a proxy and to intercept [3] HTTP(S) connections that come from the Waydroid container: ```sh $ timeout --preserve-status 2 mitmdump -n # creates a CA cert in ~/.mitmproxy $ sudo venv/bin/python3 main.py install mitm --ca-cert ~/.mitmproxy/mitmproxy-ca-cert.pem INFO: Creating directory: /system/etc/security/cacerts INFO: Copying /home/yourname/.mitmproxy/mitmproxy-ca-cert.pem to system trust store INFO: Target file: /system/etc/security/cacerts/6320a7db.0 INFO: mitm installation finished $ sudo waydroid shell -- ls -l /system/etc/security/cacerts # double-check that it worked […] -rw-r--r-- 1 root root 1191 2024-01-01 00:00 6320a7db.0 […] $ adb shell settings put global http_proxy ${YOUR_IP_HERE?}:3128 # tell Waydroid to use the proxy # for all connections $ mitmproxy -p 3128 # start proxy and display a TUI # with HTTP(S) connections # coming from Waydroid ``` [1]: https://docs.mitmproxy.org/stable/howto-install-system-trusted-ca-android/#2-rename-certificate [2]: https://mitmproxy.org/ [3]: https://docs.mitmproxy.org/stable/mitmproxytutorial-interceptrequests/
3 years ago
sudo venv/bin/python3 main.py install mitm --ca-cert mycert.pem
## Granting full permission for apps data (HACK)
This is a temporary hack to combat against the apps permission issue on Android 11. Whenever an app is open, it will
always enable a property (persist.sys.nodataperm) to make it execute a script to grant the data full permissions (777).
The **correct** way is to use `sdcardfs` or `esdfs`, both need to recompile the kernel or WayDroid image.
Arknights, PUNISHING: GRAY RAVEN and other games won't freeze on the black screen.
![](assets/6.png)
Open the terminal and switch to the directory where "main.py" is located, then run:
```
sudo venv/bin/python3 main.py hack nodataperm
```
**WARNING**: Tested on `lineage-18.1-20230128-VANILLA-waydroid_x86_64.img`. This script will
replace `/system/framework/service.jar`, which may prevent Waydroid from booting. If so,
run `sudo venv/bin/python3 main.py uninstall nodataperm` to remove it.
Or you can run the following commands directly in `sudo waydroid shell`. In this way, every time a new game is
installed, you need to run it again, but it is much less risky.
```
chmod 777 -R /sdcard/Android
chmod 777 -R /data/media/0/Android
chmod 777 -R /sdcard/Android/data
chmod 777 -R /data/media/0/Android/obb
chmod 777 -R /mnt/*/*/*/*/Android/data
chmod 777 -R /mnt/*/*/*/*/Android/obb
```
- https://github.com/supremegamers/device_generic_common/commit/2d47891376c96011b2ee3c1ccef61cb48e15aed6
- https://github.com/supremegamers/android_frameworks_base/commit/24a08bf800b2e461356a9d67d04572bb10b0e819
## Install microG, Aurora Store, and Aurora Droid
4 years ago
![](assets/7.png)
```
sudo python main.py install microg
```
## Hide status bar
Before
![Before](assets/8.png)
After
![After](assets/9.png)
```
sudo venv/bin/python3 main.py hack hidestatusbar
```
5 years ago
## Get Android ID for device registration
You need to register your device with its ID before being able to use GApps, this will print out your Android ID, which
you can use for device registration required for Google apps:
Open the terminal and switch to the directory where "main.py" is located, then run:
5 years ago
sudo venv/bin/python3 main.py certified
5 years ago
Star this repository if you find this useful, if you encounter a problem, create an issue on GitHub!
## Error handling
- Magisk installed: N/A
Check [waydroid-magisk](https://github.com/nitanmarcel/waydroid-magisk)
4 years ago
## Credits
- [Waydroid](https://github.com/waydroid/waydroid)
- [Magisk Delta](https://huskydg.github.io/magisk-files)
4 years ago
- [microG Project](https://microg.org)
- [Open GApps](https://opengapps.org)
- [Smart Dock](https://github.com/axel358/smartdock)
- [wd-scripts](https://github.com/electrikjesus/wd-scripts)