Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos, reformat Markdown, and use sentence case consistently #175

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 57 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ sudo venv/bin/python3 main.py

![image-20230430013148814](assets/img/README/image-20230430013148814.png)



## Command Line
## Command line

```bash
git clone https://github.com/casualsnek/waydroid_script
Expand All @@ -42,76 +40,88 @@ 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:

### Arch, Manjaro, and EndeavourOS-based distributions:

sudo pacman -S lzip
### Debian and Ubuntu based distributions:

### Debian and Ubuntu-based distributions:

sudo apt install lzip
### RHEL, Fedora and Rocky based distributions:

### RHEL, Fedora, and Rocky-based distributions:

sudo dnf install lzip
### openSUSE based distributions:

### openSUSE-based distributions:

sudo zypper install lzip

## Install OpenGapps
## Install Open GApps

![](assets/1.png)

Open terminal and switch to the directory where "main.py" is located then run:
Open the terminal and switch to the directory where "main.py" is located, then run:

sudo venv/bin/python3 main.py install gapps

Then launch waydroid with:
Then launch Waydroid with:

waydroid show-full-ui

After waydroid has finished booting, open terminal and switch to directory where "main.py" is located then run:
After Waydroid has finished booting, open the terminal and switch to the directory where "main.py" is located, then run:

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 the device to get registered. Then clear Google Play Service's cache and try logging
in!

## Install Magisk

![](assets/2.png)

Open terminal and switch to directory where "main.py" is located then run:
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!
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 sript again.
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
This script only focuses on Magisk installation, if you need more management, please
check https://github.com/nitanmarcel/waydroid-magisk

## Install libndk arm translation
## Install libndk ARM translation

libndk_translation from guybrush firmware.
libndk_translation from guybrush firmware.

libndk seems to have better performance than libhoudini on AMD.

Open terminal and switch to directory where "main.py" is located then run:
Open the terminal and switch to the directory where "main.py" is located, then run:

sudo venv/bin/python3 main.py install libndk

## Install libhoudini arm translation
## Install libhoudini ARM translation

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 terminal and switch to directory where "main.py" is located then run:
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)

![](assets/3.png)

Open terminal and switch to directory where "main.py" is located then run:
Open the terminal and switch to the directory where "main.py" is located, then run:

sudo venv/bin/python3 main.py install widevine

Expand All @@ -120,34 +130,38 @@ Open terminal and switch to directory where "main.py" is located then run:
![](assets/4.png)
![](assets/5.png)

Open terminal and switch to directory where "main.py" is located then run:
Open the terminal and switch to the directory where "main.py" is located, then run:

sudo venv/bin/python3 main.py install smartdock

## Install a self-signed CA certificate

Open terminal and switch to directory where "main.py" is located then run:
Open the terminal and switch to the directory where "main.py" is located, then run:

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.

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.
Arknights, PUNISHING: GRAY RAVEN, and other games won't freeze on the black screen.

![](assets/6.png)

Open terminal and switch to directory where "main.py" is located then run:
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.

**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 is much less risky.

```
chmod 777 -R /sdcard/Android
Expand All @@ -158,18 +172,19 @@ 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/device_generic_common/commit/2d47891376c96011b2ee3c1ccef61cb48e15aed6
- https://github.com/supremegamers/android_frameworks_base/commit/24a08bf800b2e461356a9d67d04572bb10b0e819

## Install microG, Aurora Store and Aurora Droid
## Install microG, Aurora Store, and Aurora Droid

![](assets/7.png)

```
sudo python main.py install microg
```

## Hide Status Bar
## Hide status bar

Before
![Before](assets/8.png)

Expand All @@ -180,26 +195,27 @@ After
sudo venv/bin/python3 main.py hack hidestatusbar
```


## Get Android ID for device registration

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:
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:

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 a problem, create an issue on GitHub!

## Error handling
## Error handling

- Magisk installed: N/A

Check [waydroid-magisk](https://github.com/nitanmarcel/waydroid-magisk)

## Credits
- [WayDroid](https://github.com/waydroid/waydroid)
- [Magisk Delta](https://huskydg.github.io/magisk-files/)

- [Waydroid](https://github.com/waydroid/waydroid)
- [Magisk Delta](https://huskydg.github.io/magisk-files)
- [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/)
- [wd-scripts](https://github.com/electrikjesus/wd-scripts)
43 changes: 20 additions & 23 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/usr/bin/env python3
from InquirerPy import inquirer
from InquirerPy.base.control import Choice
from InquirerPy.separator import Separator
import argparse
import os
from typing import List

from InquirerPy import inquirer
from InquirerPy.base.control import Choice

import tools.helper as helper
from stuff.android_id import AndroidId
from stuff.fdroidpriv import FDroidPriv
from stuff.gapps import Gapps
from stuff.general import General
from stuff.hidestatusbar import HideStatusBar
Expand All @@ -17,13 +20,8 @@
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


Expand All @@ -32,7 +30,7 @@ def get_certified(args):


def mount(partition, copy_dir):
img = os.path.join(images.get_image_dir(), partition+".img")
img = os.path.join(images.get_image_dir(), partition + ".img")
mount_point = ""
if partition == "system":
mount_point = os.path.join(copy_dir)
Expand All @@ -43,9 +41,9 @@ def mount(partition, copy_dir):


def resize(partition):
img = os.path.join(images.get_image_dir(), partition+".img")
img_size = int(os.path.getsize(img)/(1024*1024))
new_size = "{}M".format(img_size+500)
img = os.path.join(images.get_image_dir(), partition + ".img")
img_size = int(os.path.getsize(img) / (1024 * 1024))
new_size = "{}M".format(img_size + 500)
Logger.info("Resizing {} to {}".format(img, new_size))
images.resize(img, new_size)

Expand Down Expand Up @@ -229,9 +227,9 @@ def interact():
if not action:
exit()

install_choices = ["gapps", "microg", "libndk", "magisk", "smartdock", "fdroidpriv",]
install_choices = ["gapps", "microg", "libndk", "magisk", "smartdock", "fdroidpriv", ]
hack_choices = []
if android_version=="11":
if android_version == "11":
install_choices.extend(["libhoudini", "widevine"])
hack_choices.extend(["nodataperm", "hidestatusbar"])

Expand Down Expand Up @@ -263,7 +261,7 @@ def interact():
choices=[*install_choices, *hack_choices]
).execute()
args.app = apps
args.microg_variant="Standard"
args.microg_variant = "Standard"
remove_app(args)
elif action == "Hack":
apps = inquirer.checkbox(
Expand All @@ -280,9 +278,8 @@ def interact():


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!''')
parser = argparse.ArgumentParser(description='''Does stuff like installing Aapps, installing Magisk, installing
NDK Translation, and getting Android ID for device registration. Use -h flag for help!''')

subparsers = parser.add_subparsers(title="coomand", dest='command')
parser.add_argument('-a', '--android-version',
Expand Down Expand Up @@ -311,10 +308,10 @@ def main():

install_help = """
gapps: Install Open GApps (Android 11) or MindTheGapps (Android 13)
microg: Add microG, Aurora Store and Aurora Droid to WayDriod
libndk: Add libndk arm translation, better for AMD CPUs
libhoudini: Add libhoudini arm translation, better for Intel CPUs
magisk: Install Magisk Delta to WayDroid
microg: Add microG, Aurora Store, and Aurora Droid to WayDroid
libndk: Add libndk ARM translation, better for AMD CPUs
libhoudini: Add libhoudini ARM translation, better for Intel CPUs
magisk: Install Magisk Delta to Waydroid
mitm -c CA_CERT_FILE: Install root CA cert into system trust store
smartdock: A desktop mode launcher for Android
widevine: Add support for widevine DRM L3
Expand All @@ -334,7 +331,7 @@ def main():
remove_parser = subparsers.add_parser(
'remove', aliases=["uninstall"], help='Remove an app')
remove_parser.add_argument(
**arg_template, choices=[*remove_choices, * hack_choices], help='Name of app to remove')
**arg_template, choices=[*remove_choices, *hack_choices], help='Name of app to remove')
remove_parser.set_defaults(func=remove_app)

# hack and its aliases
Expand Down
2 changes: 1 addition & 1 deletion stuff/android_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class AndroidId:
def get_id(self):
def get_id(self):
if container.is_running():
try:
queryout = shell(
Expand Down
9 changes: 5 additions & 4 deletions stuff/fdroidpriv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import shutil

from stuff.general import General


Expand All @@ -20,10 +21,11 @@ class FDroidPriv(General):
"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",
"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]
Expand All @@ -37,4 +39,3 @@ def copy(self):
if not os.path.exists(rro_dir):
os.makedirs(rro_dir)
shutil.copyfile(os.path.join(self.extract_to, f), rro_file)

Loading