Merge branch 'main' into patch-1
This commit is contained in:
commit
6706f4b9d7
8 changed files with 86 additions and 49 deletions
40
README.md
40
README.md
|
|
@ -1,4 +1,5 @@
|
||||||
# Waydroid Extras Script
|
# Waydroid Extras Script
|
||||||
|
|
||||||
Script to add GApps and other stuff to Waydroid!
|
Script to add GApps and other stuff to Waydroid!
|
||||||
|
|
||||||
# Installation/Usage
|
# Installation/Usage
|
||||||
|
|
@ -8,8 +9,9 @@ Script to add GApps and other stuff to Waydroid!
|
||||||
```
|
```
|
||||||
git clone https://github.com/casualsnek/waydroid_script
|
git clone https://github.com/casualsnek/waydroid_script
|
||||||
cd waydroid_script
|
cd waydroid_script
|
||||||
sudo python3 -m pip install -r
|
python3 -m venv venv
|
||||||
sudo python main.py
|
venv/bin/pip install -r requirements.txt
|
||||||
|
sudo venv/bin/python3 main.py
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
@ -22,17 +24,20 @@ sudo python main.py
|
||||||
|
|
||||||
## Command Line
|
## Command Line
|
||||||
|
|
||||||
|
```bash
|
||||||
git clone https://github.com/casualsnek/waydroid_script
|
git clone https://github.com/casualsnek/waydroid_script
|
||||||
cd waydroid_script
|
cd waydroid_script
|
||||||
sudo python3 -m pip install -r requirements.txt
|
python3 -m venv venv
|
||||||
|
venv/bin/pip install -r requirements.txt
|
||||||
# install something
|
# install something
|
||||||
sudo python3 main.py install {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg}
|
sudo venv/bin/python3 main.py install {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg}
|
||||||
# uninstall something
|
# uninstall something
|
||||||
sudo python3 main.py uninstall {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg}
|
sudo venv/bin/python3 main.py uninstall {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg}
|
||||||
# get Android device ID
|
# get Android device ID
|
||||||
sudo python main.py certified
|
sudo venv/bin/python3 main.py certified
|
||||||
# some hacks
|
# some hacks
|
||||||
sudo python3 hack {nodataperm, hidestatusbar}
|
sudo venv/bin/python3 main.py hack {nodataperm, hidestatusbar}
|
||||||
|
```
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
|
@ -52,7 +57,7 @@ sudo python main.py
|
||||||
|
|
||||||
Open terminal and switch to the directory where "main.py" is located then run:
|
Open terminal and switch to the directory where "main.py" is located then run:
|
||||||
|
|
||||||
sudo python3 main.py install gapps
|
sudo venv/bin/python3 main.py install gapps
|
||||||
|
|
||||||
Then launch waydroid with:
|
Then launch waydroid with:
|
||||||
|
|
||||||
|
|
@ -63,13 +68,14 @@ After waydroid has finished booting, open terminal and switch to directory where
|
||||||
sudo python3 main.py google
|
sudo python3 main.py google
|
||||||
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 device to get registered. Then clear Google Play Service's cache and try logging in!
|
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 device to get registered. Then clear Google Play Service's cache and try logging in!
|
||||||
|
|
||||||
|
|
||||||
## Install Magisk
|
## Install Magisk
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Open terminal and switch to directory where "main.py" is located then run:
|
Open terminal and switch to directory where "main.py" is located then run:
|
||||||
|
|
||||||
sudo python3 main.py install magisk
|
sudo venv/bin/python3 main.py install magisk
|
||||||
|
|
||||||
Magisk will be installed on next boot!
|
Magisk will be installed on next boot!
|
||||||
|
|
||||||
|
|
@ -87,7 +93,7 @@ libndk seems to have better performance than libhoudini on AMD.
|
||||||
|
|
||||||
Open terminal and switch to directory where "main.py" is located then run:
|
Open terminal and switch to directory where "main.py" is located then run:
|
||||||
|
|
||||||
sudo python3 main.py install libndk
|
sudo venv/bin/python3 main.py install libndk
|
||||||
|
|
||||||
## Install libhoudini arm translation
|
## Install libhoudini arm translation
|
||||||
|
|
||||||
|
|
@ -99,7 +105,7 @@ houdini64 version: 11.0.1b_z.38765.m
|
||||||
|
|
||||||
Open terminal and switch to directory where "main.py" is located then run:
|
Open terminal and switch to directory where "main.py" is located then run:
|
||||||
|
|
||||||
sudo python3 main.py install libhoudini
|
sudo venv/bin/python3 main.py install libhoudini
|
||||||
|
|
||||||
## Integrate Widevine DRM (L3)
|
## Integrate Widevine DRM (L3)
|
||||||
|
|
||||||
|
|
@ -107,7 +113,7 @@ Open terminal and switch to directory where "main.py" is located then run:
|
||||||
|
|
||||||
Open terminal and switch to directory where "main.py" is located then run:
|
Open terminal and switch to directory where "main.py" is located then run:
|
||||||
|
|
||||||
sudo python3 main.py install widevine
|
sudo venv/bin/python3 main.py install widevine
|
||||||
|
|
||||||
## Install Smart Dock
|
## Install Smart Dock
|
||||||
|
|
||||||
|
|
@ -116,7 +122,7 @@ Open terminal and switch to directory where "main.py" is located then run:
|
||||||
|
|
||||||
Open terminal and switch to directory where "main.py" is located then run:
|
Open terminal and switch to directory where "main.py" is located then run:
|
||||||
|
|
||||||
sudo python3 main.py install smartdock
|
sudo venv/bin/python3 main.py install smartdock
|
||||||
|
|
||||||
## Granting full permission for apps data (HACK)
|
## Granting full permission for apps data (HACK)
|
||||||
|
|
||||||
|
|
@ -130,9 +136,9 @@ Arknights, PUNISHING: GRAY RAVEN and other games won't freeze on the black scree
|
||||||
Open terminal and switch to directory where "main.py" is located then run:
|
Open terminal and switch to directory where "main.py" is located then run:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo python3 main.py hack nodataperm
|
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 python3 main.py uninstall nodataperm` to remove it.
|
**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's much less risky.
|
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's much less risky.
|
||||||
|
|
@ -165,7 +171,7 @@ After
|
||||||

|

|
||||||
|
|
||||||
```
|
```
|
||||||
sudo python3 main.py hack hidestatusbar
|
sudo venv/bin/python3 main.py hack hidestatusbar
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -174,7 +180,7 @@ sudo python3 main.py hack hidestatusbar
|
||||||
You need to register you device with its it before being able to use gapps, this will print out your Android ID which you can use for device registration required for Google apps:
|
You need to register you device with its it 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 terminal and switch to directory where "main.py" is located then run:
|
Open terminal and switch to directory where "main.py" is located then run:
|
||||||
|
|
||||||
sudo python3 main.py google
|
sudo venv/bin/python3 main.py certified
|
||||||
|
|
||||||
Star this repository if you find this useful, if you encounter problem create an issue on GitHub!
|
Star this repository if you find this useful, if you encounter problem create an issue on GitHub!
|
||||||
|
|
||||||
|
|
|
||||||
4
main.py
4
main.py
|
|
@ -82,7 +82,7 @@ def install_app(args):
|
||||||
if "smartdock" in app:
|
if "smartdock" in app:
|
||||||
install_list.append(Smartdock())
|
install_list.append(Smartdock())
|
||||||
if "microg" in app:
|
if "microg" in app:
|
||||||
install_list.append(MicroG(args.android_version))
|
install_list.append(MicroG(args.android_version, args.microg_variant))
|
||||||
|
|
||||||
if not container.use_overlayfs():
|
if not container.use_overlayfs():
|
||||||
copy_dir = "/tmp/waydroid"
|
copy_dir = "/tmp/waydroid"
|
||||||
|
|
@ -235,7 +235,7 @@ def interact():
|
||||||
).execute()
|
).execute()
|
||||||
microg_variants = ["Standard", "NoGoolag",
|
microg_variants = ["Standard", "NoGoolag",
|
||||||
"UNLP", "Minimal", "MinimalIAP"]
|
"UNLP", "Minimal", "MinimalIAP"]
|
||||||
if "MicroG" in apps:
|
if "microg" in apps:
|
||||||
microg_variant = inquirer.select(
|
microg_variant = inquirer.select(
|
||||||
message="Select MicroG variant",
|
message="Select MicroG variant",
|
||||||
choices=microg_variants,
|
choices=microg_variants,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class AndroidId:
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
Logger.error("WayDroid isn't running !")
|
Logger.error("Please make sure Waydroid is running and Gapps has been installed!")
|
||||||
return
|
return
|
||||||
print(queryout.replace("android_id|", "").strip())
|
print(queryout.replace("android_id|", "").strip())
|
||||||
print(" ^----- Open https://google.com/android/uncertified/?pli=1")
|
print(" ^----- Open https://google.com/android/uncertified/?pli=1")
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,8 @@ class General:
|
||||||
if not os.path.isfile(os.path.join(bin_dir, "resetprop")):
|
if not os.path.isfile(os.path.join(bin_dir, "resetprop")):
|
||||||
if not os.path.exists(bin_dir):
|
if not os.path.exists(bin_dir):
|
||||||
os.makedirs(bin_dir)
|
os.makedirs(bin_dir)
|
||||||
shutil.copy(os.path.join(
|
shutil.copy(os.path.join(os.path.join(os.path.dirname(__file__), "..", "bin",
|
||||||
"./bin", self.arch[0], "resetprop"), bin_dir)
|
self.arch[0], "resetprop")), bin_dir)
|
||||||
os.chmod(os.path.join(bin_dir, "resetprop"), 0o755)
|
os.chmod(os.path.join(bin_dir, "resetprop"), 0o755)
|
||||||
if not os.path.isfile(os.path.join(bin_dir, "resetprop.sh")):
|
if not os.path.isfile(os.path.join(bin_dir, "resetprop.sh")):
|
||||||
with open(os.path.join(bin_dir, "resetprop.sh"), "w") as f:
|
with open(os.path.join(bin_dir, "resetprop.sh"), "w") as f:
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ from stuff.general import General
|
||||||
|
|
||||||
class HideStatusBar(General):
|
class HideStatusBar(General):
|
||||||
id = "hide status bar"
|
id = "hide status bar"
|
||||||
dl_links = {"11": ["https://github.com/ayasa520/hide-status-bar/releases/download/v0.0.1/app-release.apk",
|
dl_links = {"11": ["https://github.com/ayasa520/hide-status-bar/releases/download/v0.0.2/app-release.apk",
|
||||||
"ae6c4cc567d6f3de77068e54e43818e2"]}
|
"ff2fe63ddfb4b035e6720a1b195b2355"]}
|
||||||
partition = "system"
|
partition = "system"
|
||||||
dl_file_name = "hidestatusbar.apk"
|
dl_file_name = "hidestatusbar.apk"
|
||||||
dl_link = ...
|
dl_link = ...
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import gzip
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
from stuff.general import General
|
from stuff.general import General
|
||||||
|
from tools.helper import backup, restore
|
||||||
from tools.logger import Logger
|
from tools.logger import Logger
|
||||||
from tools import container
|
from tools import container
|
||||||
|
|
||||||
|
|
@ -9,9 +10,14 @@ from tools import container
|
||||||
class Nodataperm(General):
|
class Nodataperm(General):
|
||||||
id = "nodataperm"
|
id = "nodataperm"
|
||||||
dl_links = {
|
dl_links = {
|
||||||
"11": ["https://github.com/ayasa520/hack_full_data_permission/archive/refs/heads/main.zip",
|
"11":
|
||||||
"eafd7b0986f3edaebaf1dd89f19d49bf"],
|
{
|
||||||
"13": ["", ""]
|
"x86_64": [
|
||||||
|
"https://github.com/ayasa520/hack_full_data_permission/archive/d4beab7780eb792059d33e77d865579c9ee41546.zip",
|
||||||
|
"b0e3908ffcf5df8ea62f4929aa680f1a"
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"13": {}
|
||||||
}
|
}
|
||||||
dl_file_name = "nodataperm.zip"
|
dl_file_name = "nodataperm.zip"
|
||||||
extract_to = "/tmp/nodataperm"
|
extract_to = "/tmp/nodataperm"
|
||||||
|
|
@ -21,25 +27,34 @@ class Nodataperm(General):
|
||||||
files = [
|
files = [
|
||||||
"etc/nodataperm.sh",
|
"etc/nodataperm.sh",
|
||||||
"etc/init/nodataperm.rc",
|
"etc/init/nodataperm.rc",
|
||||||
"framework/services.jar"
|
"framework/services.jar",
|
||||||
|
"framework/services.jar.prof",
|
||||||
|
"framework/services.jar.bprof",
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, android_version="11") -> None:
|
def __init__(self, android_version="11") -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.dl_link = self.dl_links[android_version][0]
|
print("ok")
|
||||||
self.act_md5 = self.dl_links[android_version][1]
|
arch = self.arch[0]
|
||||||
|
self.dl_link = self.dl_links[android_version][arch][0]
|
||||||
|
self.act_md5 = self.dl_links[android_version][arch][1]
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
|
name = re.findall("([a-zA-Z0-9]+)\.zip", self.dl_link)[0]
|
||||||
extract_path = os.path.join(
|
extract_path = os.path.join(
|
||||||
self.extract_to, "hack_full_data_permission-main")
|
self.extract_to, f"hack_full_data_permission-{name}")
|
||||||
if not container.use_overlayfs():
|
if not container.use_overlayfs():
|
||||||
services_jar = os.path.join(
|
services_jar = os.path.join(
|
||||||
self.copy_dir, self.partition, "framework", "services.jar")
|
self.copy_dir, self.partition, "framework", "services.jar")
|
||||||
gz_filename = services_jar+".gz"
|
services_jar_prof = os.path.join(
|
||||||
with gzip.open(gz_filename, 'wb') as f_gz:
|
self.copy_dir, self.partition, "framework", "services.jar.prof")
|
||||||
with open(services_jar, "rb") as f:
|
services_jar_bprof = os.path.join(
|
||||||
f_gz.write(f.read())
|
self.copy_dir, self.partition, "framework", "services.jar.bprof")
|
||||||
Logger.info("Copying widevine library files ...")
|
backup(services_jar)
|
||||||
|
backup(services_jar_prof)
|
||||||
|
backup(services_jar_bprof)
|
||||||
|
|
||||||
|
Logger.info(f"Copying {self.id} library files ...")
|
||||||
shutil.copytree(extract_path, os.path.join(
|
shutil.copytree(extract_path, os.path.join(
|
||||||
self.copy_dir, self.partition), dirs_exist_ok=True)
|
self.copy_dir, self.partition), dirs_exist_ok=True)
|
||||||
|
|
||||||
|
|
@ -47,7 +62,10 @@ class Nodataperm(General):
|
||||||
if not container.use_overlayfs():
|
if not container.use_overlayfs():
|
||||||
services_jar = os.path.join(
|
services_jar = os.path.join(
|
||||||
self.copy_dir, self.partition, "framework", "services.jar")
|
self.copy_dir, self.partition, "framework", "services.jar")
|
||||||
gz_filename = services_jar+".gz"
|
services_jar_prof = os.path.join(
|
||||||
with gzip.GzipFile(gz_filename) as f_gz:
|
self.copy_dir, self.partition, "framework", "services.jar.prof")
|
||||||
with open(services_jar, "wb") as f:
|
services_jar_bprof = os.path.join(
|
||||||
f.writelines(f_gz)
|
self.copy_dir, self.partition, "framework", "services.jar.bprof")
|
||||||
|
restore(services_jar)
|
||||||
|
restore(services_jar_prof)
|
||||||
|
restore(services_jar_bprof)
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ from stuff.general import General
|
||||||
|
|
||||||
class Smartdock(General):
|
class Smartdock(General):
|
||||||
id = "smartdock"
|
id = "smartdock"
|
||||||
dl_link = "https://f-droid.org/repo/cu.axel.smartdock_198.apk"
|
dl_link = "https://f-droid.org/repo/cu.axel.smartdock_1100.apk"
|
||||||
partition = "system"
|
partition = "system"
|
||||||
dl_file_name = "smartdock.apk"
|
dl_file_name = "smartdock.apk"
|
||||||
act_md5 = "a8ce0bca5e1772796404602e0fa250a4"
|
act_md5 = "f4087d34218eac902a5cca98ee03d215"
|
||||||
apply_props = { "qemu.hw.mainkeys" : "1" }
|
apply_props = { "qemu.hw.mainkeys" : "1" }
|
||||||
skip_extract = True
|
skip_extract = True
|
||||||
permissions = """<?xml version="1.0" encoding="utf-8"?>
|
permissions = """<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import gzip
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import platform
|
import platform
|
||||||
|
|
@ -131,3 +132,15 @@ def check_root():
|
||||||
if os.geteuid() != 0:
|
if os.geteuid() != 0:
|
||||||
Logger.error("This script must be run as root. Aborting.")
|
Logger.error("This script must be run as root. Aborting.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def backup(path):
|
||||||
|
gz_filename = path+".gz"
|
||||||
|
with gzip.open(gz_filename, 'wb') as f_gz:
|
||||||
|
with open(path, "rb") as f:
|
||||||
|
f_gz.write(f.read())
|
||||||
|
|
||||||
|
def restore(path):
|
||||||
|
gz_filename = path+".gz"
|
||||||
|
with gzip.GzipFile(gz_filename) as f_gz:
|
||||||
|
with open(path, "wb") as f:
|
||||||
|
f.writelines(f_gz)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue