Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26777abcaf |
@@ -105,7 +105,4 @@ venv.bak/
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
|
||||
# nix
|
||||
result*
|
||||
|
||||
test.py
|
||||
@@ -4,6 +4,20 @@ Script to add GApps and other stuff to Waydroid!
|
||||
|
||||
# Installation/Usage
|
||||
|
||||
## 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
|
||||
|
||||
|
||||
|
||||
## Interactive terminal interface
|
||||
|
||||
```
|
||||
@@ -39,18 +53,6 @@ sudo venv/bin/python3 main.py certified
|
||||
sudo venv/bin/python3 main.py hack {nodataperm, hidestatusbar}
|
||||
```
|
||||
|
||||
## 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 OpenGapps
|
||||
|
||||

|
||||
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
with (import <nixpkgs> {});
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "waydroid_script";
|
||||
|
||||
buildInputs = [
|
||||
(python3.withPackages(ps: with ps; [ tqdm requests inquirerpy ]))
|
||||
];
|
||||
|
||||
src = ./.;
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs main.py
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/libexec
|
||||
cp -r . $out/libexec/waydroid_script
|
||||
mkdir -p $out/bin
|
||||
ln -s $out/libexec/waydroid_script/main.py $out/bin/waydroid_script
|
||||
'';
|
||||
}
|
||||
@@ -17,33 +17,48 @@ from stuff.ndk import Ndk
|
||||
from stuff.nodataperm import Nodataperm
|
||||
from stuff.smartdock import Smartdock
|
||||
from stuff.widevine import Widevine
|
||||
from stuff.fdroidpriv import FDroidPriv
|
||||
import tools.helper as helper
|
||||
from tools import container
|
||||
from tools import images
|
||||
|
||||
import argparse
|
||||
|
||||
from tools.logger import Logger
|
||||
|
||||
def get_certified():
|
||||
|
||||
def get_certified(args):
|
||||
AndroidId().get_id()
|
||||
|
||||
|
||||
def mount(partition, copy_dir):
|
||||
img = os.path.join(images.get_image_dir(), f"{partition}.img")
|
||||
mount_point = os.path.join(copy_dir) if partition == "system" else os.path.join(copy_dir, partition)
|
||||
Logger.info(f"Mounting {img} to {mount_point}")
|
||||
img = os.path.join(images.get_image_dir(), partition+".img")
|
||||
mount_point = ""
|
||||
if partition == "system":
|
||||
mount_point = os.path.join(copy_dir)
|
||||
else:
|
||||
mount_point = os.path.join(copy_dir, partition)
|
||||
Logger.info("Mounting {} to {}".format(img, mount_point))
|
||||
images.mount(img, mount_point)
|
||||
|
||||
|
||||
def resize(partition):
|
||||
img = os.path.join(images.get_image_dir(), f"{partition}.img")
|
||||
img = os.path.join(images.get_image_dir(), partition+".img")
|
||||
img_size = int(os.path.getsize(img)/(1024*1024))
|
||||
new_size = f"{img_size + 500}M"
|
||||
Logger.info(f"Resizing {img} to {new_size}")
|
||||
new_size = "{}M".format(img_size+500)
|
||||
Logger.info("Resizing {} to {}".format(img, new_size))
|
||||
images.resize(img, new_size)
|
||||
|
||||
|
||||
def umount(partition, copy_dir):
|
||||
mount_point = os.path.join(copy_dir) if partition == "system" else os.path.join(copy_dir, partition)
|
||||
Logger.info(f"Unmounting {mount_point}")
|
||||
mount_point = ""
|
||||
if partition == "system":
|
||||
mount_point = os.path.join(copy_dir)
|
||||
else:
|
||||
mount_point = os.path.join(copy_dir, partition)
|
||||
Logger.info("Umounting {}".format(mount_point))
|
||||
images.umount(mount_point)
|
||||
|
||||
|
||||
def install_app(args):
|
||||
install_list: List[General] = []
|
||||
app = args.app
|
||||
@@ -71,8 +86,6 @@ def install_app(args):
|
||||
install_list.append(MicroG(args.android_version, args.microg_variant))
|
||||
if "mitm" in app:
|
||||
install_list.append(Mitm(args.ca_cert_file))
|
||||
if "fdroidpriv" in app:
|
||||
install_list.append(FDroidPriv(args.android_version))
|
||||
|
||||
if not container.use_overlayfs():
|
||||
copy_dir = "/tmp/waydroid"
|
||||
@@ -102,6 +115,7 @@ def install_app(args):
|
||||
|
||||
container.upgrade()
|
||||
|
||||
|
||||
def remove_app(args):
|
||||
remove_list: List[General] = []
|
||||
app = args.app
|
||||
@@ -121,8 +135,6 @@ def remove_app(args):
|
||||
remove_list.append(MicroG(args.android_version, args.microg_variant))
|
||||
if "mitm" in app:
|
||||
remove_list.append(Mitm())
|
||||
if "fdroidpriv" in app:
|
||||
remove_list.append(FDroidPriv(args.android_version))
|
||||
if "nodataperm" in app:
|
||||
remove_list.append(Nodataperm(args.android_version))
|
||||
if "hidestatusbar" in app:
|
||||
@@ -141,8 +153,10 @@ def remove_app(args):
|
||||
|
||||
container.upgrade()
|
||||
|
||||
|
||||
def hack_option(args):
|
||||
Logger.warning("If these hacks cause any problems, run `sudo python main.py remove <hack_option>` to remove")
|
||||
Logger.warning(
|
||||
"If these hacks cause any problems, run `sudo python main.py remove <hack_option>` to remove")
|
||||
|
||||
hack_list: List[General] = []
|
||||
options = args.option_name
|
||||
@@ -179,8 +193,10 @@ def hack_option(args):
|
||||
|
||||
container.upgrade()
|
||||
|
||||
|
||||
def interact():
|
||||
os.system("clear")
|
||||
args = argparse.Namespace()
|
||||
android_version = inquirer.select(
|
||||
message="Select Android version",
|
||||
instruction="(\u2191\u2193 Select Item)",
|
||||
@@ -193,19 +209,22 @@ def interact():
|
||||
).execute()
|
||||
if not android_version:
|
||||
exit()
|
||||
|
||||
args = argparse.Namespace(android_version=android_version, microg_variant="Standard")
|
||||
|
||||
args.android_version = android_version
|
||||
action = inquirer.select(
|
||||
message="Please select an action",
|
||||
choices=["Install", "Remove", "Hack", "Get Google Device ID to Get Certified"],
|
||||
choices=[
|
||||
"Install",
|
||||
"Remove",
|
||||
"Hack",
|
||||
"Get Google Device ID to Get Certified"
|
||||
],
|
||||
instruction="([↑↓]: Select Item)",
|
||||
default=None,
|
||||
).execute()
|
||||
if not action:
|
||||
exit()
|
||||
|
||||
install_choices = ["gapps", "microg", "libndk", "magisk", "smartdock", "fdroidpriv",]
|
||||
install_choices = ["gapps", "microg", "libndk", "magisk", "smartdock",]
|
||||
hack_choices = []
|
||||
if android_version=="11":
|
||||
install_choices.extend(["libhoudini", "widevine"])
|
||||
@@ -219,7 +238,8 @@ def interact():
|
||||
invalid_message="should be at least 1 selection",
|
||||
choices=install_choices
|
||||
).execute()
|
||||
microg_variants = ["Standard", "NoGoolag", "UNLP", "Minimal", "MinimalIAP"]
|
||||
microg_variants = ["Standard", "NoGoolag",
|
||||
"UNLP", "Minimal", "MinimalIAP"]
|
||||
if "microg" in apps:
|
||||
microg_variant = inquirer.select(
|
||||
message="Select MicroG variant",
|
||||
@@ -251,14 +271,15 @@ def interact():
|
||||
args.option_name = apps
|
||||
hack_option(args)
|
||||
elif action == "Get Google Device ID to Get Certified":
|
||||
get_certified()
|
||||
AndroidId().get_id()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='''
|
||||
Does stuff like installing Gapps, installing Magisk, installing NDK Translation and getting Android ID for device registration.
|
||||
Use -h flag for help!''')
|
||||
|
||||
subparsers = parser.add_subparsers(title="command", dest='command')
|
||||
subparsers = parser.add_subparsers(title="coomand", dest='command')
|
||||
parser.add_argument('-a', '--android-version',
|
||||
dest='android_version',
|
||||
help='Specify the Android version',
|
||||
@@ -270,7 +291,8 @@ def main():
|
||||
'certified', help='Get device ID to obtain Play Store certification')
|
||||
certified.set_defaults(func=get_certified)
|
||||
|
||||
install_choices = ["gapps", "microg", "libndk", "libhoudini", "magisk", "mitm", "smartdock", "widevine"]
|
||||
install_choices = ["gapps", "microg", "libndk", "libhoudini",
|
||||
"magisk", "mitm", "smartdock", "widevine"]
|
||||
hack_choices = ["nodataperm", "hidestatusbar"]
|
||||
micrg_variants = ["Standard", "NoGoolag", "UNLP", "Minimal", "MinimalIAP"]
|
||||
remove_choices = install_choices
|
||||
@@ -279,6 +301,7 @@ def main():
|
||||
"dest": "app",
|
||||
"type": str,
|
||||
"nargs": '+',
|
||||
# "metavar":"",
|
||||
}
|
||||
|
||||
install_help = """
|
||||
@@ -316,12 +339,15 @@ widevine: Add support for widevine DRM L3
|
||||
hack_parser.set_defaults(func=hack_option)
|
||||
|
||||
args = parser.parse_args()
|
||||
args.microg_variant = "Standard"
|
||||
if hasattr(args, 'func'):
|
||||
args_dict = vars(args)
|
||||
helper.check_root()
|
||||
args.func(args)
|
||||
else:
|
||||
helper.check_root()
|
||||
interact()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import os
|
||||
import shutil
|
||||
from stuff.general import General
|
||||
|
||||
|
||||
class FDroidPriv(General):
|
||||
id = "fdroid priv"
|
||||
dl_links = {"11": ["https://f-droid.org/repo/org.fdroid.fdroid.privileged.ota_2130.zip",
|
||||
"6242cab56d197d80c598593a46da62e4"]}
|
||||
partition = "system"
|
||||
dl_file_name = "org.fdroid.fdroid.privileged.ota_2130.zip"
|
||||
dl_link = ...
|
||||
act_md5 = ...
|
||||
extract_to = "/tmp/fdroid_ota_2130"
|
||||
files = [
|
||||
"app/F-Droid.apk"
|
||||
"app/F-Droid/F-Droid.apk"
|
||||
"etc/permissions/permissions_org.fdroid.fdroid.privileged.xml"
|
||||
"priv-app/F-DroidPrivilegedExtension.apk"
|
||||
"priv-app/F-DroidPrivilegedExtension/F-DroidPrivilegedExtension.apk"
|
||||
]
|
||||
file_map = {
|
||||
"permissions_org.fdroid.fdroid.privileged.xml": "etc/permissions/permissions_org.fdroid.fdroid.privileged.xml",
|
||||
"F-Droid.apk": "app/F-Droid/F-Droid.apk",
|
||||
"F-DroidPrivilegedExtension.apk": "priv-app/F-DroidPrivilegedExtension/F-DroidPrivilegedExtension.apk",
|
||||
}
|
||||
def __init__(self, android_version="11") -> None:
|
||||
super().__init__()
|
||||
self.dl_link = self.dl_links[android_version][0]
|
||||
self.act_md5 = self.dl_links[android_version][1]
|
||||
|
||||
def copy(self):
|
||||
for f, d in self.file_map.items():
|
||||
rro_file = os.path.join(
|
||||
self.copy_dir, self.partition, d)
|
||||
rro_dir = os.path.dirname(rro_file)
|
||||
if not os.path.exists(rro_dir):
|
||||
os.makedirs(rro_dir)
|
||||
shutil.copyfile(os.path.join(self.extract_to, f), rro_file)
|
||||
|
||||
+4
-4
@@ -15,10 +15,10 @@ class Gapps(General):
|
||||
"armeabi-v7a": ["https://sourceforge.net/projects/opengapps/files/arm/20220215/open_gapps-arm-11.0-pico-20220215.zip", "8719519fa32ae83a62621c6056d32814"]
|
||||
},
|
||||
"13": {
|
||||
"x86_64": ["https://github.com/s1204IT/MindTheGappsBuilder/releases/download/20231028/MindTheGapps-13.0.0-x86_64-20231028.zip", "63ccebbf93d45c384f58d7c40049d398"],
|
||||
"x86": ["https://github.com/s1204IT/MindTheGappsBuilder/releases/download/20231028/MindTheGapps-13.0.0-x86-20231028.zip", "f12b6a8ed14eedbb4b5b3c932a865956"],
|
||||
"arm64-v8a": ["https://github.com/s1204IT/MindTheGappsBuilder/releases/download/20231028/MindTheGapps-13.0.0-arm64-20231028.zip", "11180da0a5d9f2ed2863882c30a8d556"],
|
||||
"armeabi-v7a": ["https://github.com/s1204IT/MindTheGappsBuilder/releases/download/20231028/MindTheGapps-13.0.0-arm-20231028.zip", "d525c980bac427844aa4cb01628f8a8f"]
|
||||
"x86_64": ["https://github.com/Howard20181/MindTheGappsBuilder/releases/download/20230323/MindTheGapps-13.0.0-x86_64-20230323.zip", "aba427be1ddd0963121c87a4eda80299"],
|
||||
"x86": ["https://github.com/Howard20181/MindTheGappsBuilder/releases/download/20230323/MindTheGapps-13.0.0-x86-20230323.zip", "f02d2f1a3f0a084f13ab4c1b58ad7554"],
|
||||
"arm64-v8a": ["https://github.com/Howard20181/MindTheGappsBuilder/releases/download/20230323/MindTheGapps-13.0.0-arm64-20230323.zip", "18484a5622eeccffcea2b43205655d8a"],
|
||||
"armeabi-v7a": ["https://github.com/Howard20181/MindTheGappsBuilder/releases/download/20230323/MindTheGapps-13.0.0-arm-20230323.zip", "e4c00a7eb1e4dfca0fc6a3e447710264"]
|
||||
}
|
||||
}
|
||||
android_version = ...
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ class Houdini(General):
|
||||
extract_to = "/tmp/houdiniunpack"
|
||||
init_rc_component = """
|
||||
on early-init
|
||||
mount binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
|
||||
mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
|
||||
|
||||
on property:ro.enable.native.bridge.exec=1
|
||||
exec -- /system/bin/sh -c "echo ':arm_exe:M::\\\\x7f\\\\x45\\\\x4c\\\\x46\\\\x01\\\\x01\\\\x01\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x02\\\\x00\\\\x28::/system/bin/houdini:P' > /proc/sys/fs/binfmt_misc/register"
|
||||
|
||||
+17
-15
@@ -10,7 +10,7 @@ from tools import container
|
||||
class Magisk(General):
|
||||
id = "magisk delta"
|
||||
partition = "system"
|
||||
dl_link = "https://github.com/mistrmochov/magiskdeltaorig/raw/main/app-release.apk"
|
||||
dl_link = "https://huskydg.github.io/magisk-files/app-debug.apk"
|
||||
dl_file_name = "magisk.apk"
|
||||
extract_to = "/tmp/magisk_unpack"
|
||||
magisk_dir = os.path.join(partition, "etc", "init", "magisk")
|
||||
@@ -29,28 +29,30 @@ service bootanim /system/bin/bootanimation
|
||||
bootanim_component = f"""
|
||||
on post-fs-data
|
||||
start logd
|
||||
exec u:r:su:s0 root root -- /system/etc/init/magisk/magiskpolicy --live --magisk
|
||||
exec u:r:magisk:s0 root root -- /system/etc/init/magisk/magiskpolicy --live --magisk
|
||||
exec u:r:update_engine:s0 root root -- /system/etc/init/magisk/magiskpolicy --live --magisk
|
||||
mkdir /dev/magisk_iqeoVo2mDrO 700
|
||||
exec u:r:su:s0 root root -- /system/etc/init/magisk/magisk64 --auto-selinux --setup-sbin /system/etc/init/magisk /dev/magisk_iqeoVo2mDrO
|
||||
exec u:r:su:s0 root root -- /dev/magisk_iqeoVo2mDrO/magisk --auto-selinux --post-fs-data
|
||||
exec u:r:su:s0 root root -- /system/etc/init/magisk/magisk{host()[1]} --auto-selinux --setup-sbin /system/etc/init/magisk
|
||||
exec u:r:su:s0 root root -- /system/etc/init/magisk/magiskpolicy --live --magisk "allow * magisk_file lnk_file *"
|
||||
mkdir /sbin/.magisk 700
|
||||
mkdir /sbin/.magisk/mirror 700
|
||||
mkdir /sbin/.magisk/block 700
|
||||
copy /system/etc/init/magisk/config /sbin/.magisk/config
|
||||
rm /dev/.magisk_unblock
|
||||
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --post-fs-data
|
||||
wait /dev/.magisk_unblock 40
|
||||
rm /dev/.magisk_unblock
|
||||
|
||||
on nonencrypted
|
||||
exec u:r:su:s0 root root -- /dev/magisk_iqeoVo2mDrO/magisk --auto-selinux --service
|
||||
|
||||
on property:vold.decrypt=trigger_restart_framework
|
||||
exec u:r:su:s0 root root -- /dev/magisk_iqeoVo2mDrO/magisk --auto-selinux --service
|
||||
on zygote-start
|
||||
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --service
|
||||
|
||||
on property:sys.boot_completed=1
|
||||
mkdir /data/adb/magisk 755
|
||||
exec u:r:su:s0 root root -- /dev/magisk_iqeoVo2mDrO/magisk --auto-selinux --boot-complete
|
||||
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --boot-complete
|
||||
exec -- /system/bin/sh -c "if [ ! -e /data/data/io.github.huskydg.magisk ] ; then pm install /system/etc/init/magisk/magisk.apk ; fi"
|
||||
|
||||
on property:init.svc.zygote=restarting
|
||||
exec u:r:su:s0 root root -- /dev/magisk_iqeoVo2mDrO/magisk --auto-selinux --zygote-restart
|
||||
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --zygote-restart
|
||||
|
||||
on property:init.svc.zygote=stopped
|
||||
exec u:r:su:s0 root root -- /dev/magisk_iqeoVo2mDrO/magisk --auto-selinux --zygote-restart
|
||||
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --zygote-restart
|
||||
"""
|
||||
|
||||
def download(self):
|
||||
|
||||
Reference in New Issue
Block a user