This commit is contained in:
Rikka
2023-02-04 22:38:42 +08:00
parent dc3f7a4b0d
commit 3b5d6cb081
4 changed files with 64 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
# Remote-Android Script
This script adds Gapps, Magisk and libndk to redroid **without recompiling the entire image**
If you have problems with this script, you should **create an issue**.
## Specify an Android version
@@ -41,12 +42,22 @@ Zygisk and modules like LSPosed should work.
python redroid.py -m
```
## Add widevine DRM(L3) to ReDroid image
![](assets/4.png)
```
python redroid.py -w
```
## Example
This command will add Gapps, Magisk and Libndk to the ReDroid image at the same time.
This command will add Gapps, Magisk, Libndk, Widevine to the ReDroid image at the same time.
```bash
python redroid.py -a 11.0.0 -gmn
python redroid.py -a 11.0.0 -gmnw
```
Then start the docker container.
@@ -55,7 +66,7 @@ Then start the docker container.
docker run -itd --rm --privileged \
-v ~/data:/data \
-p 5555:5555 \
redroid/redroid:11.0.0-gapps-ndk-magisk \
redroid/redroid:11.0.0-gapps-ndk-magisk-widevine \
ro.product.cpu.abilist=x86_64,arm64-v8a,x86,armeabi-v7a,armeabi \
ro.product.cpu.abilist64=x86_64,arm64-v8a \
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi \
@@ -84,11 +95,11 @@ ro.product.cpu.abilist=x86_64,arm64-v8a,x86,armeabi-v7a,armeabi \
2. Grab device id and register on this website: https://www.google.com/android/uncertified/
- libndk doesn't work
I only made it work on `redroid/redroid:11.0.0`. Also, turning on Zygisk seems to break libndk for 32 bit apps, but arm64 apps still work.
- libhoudini doesn't work
I have no idea. I can't get any version of libhoudini to work on redroid.

BIN
assets/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

View File

@@ -34,10 +34,9 @@ def main():
# parser.add_argument('-l', '--install-libhoudini', dest='houdini',
# help='Install libhoudini for arm translation',
# action='store_true')
# Not working
# parser.add_argument('-w', '--install-widevine', dest='widevine',
# help='Integrate Widevine DRM (L3)',
# action='store_true')
parser.add_argument('-w', '--install-widevine', dest='widevine',
help='Integrate Widevine DRM (L3)',
action='store_true')
args = parser.parse_args()
dockerfile = dockerfile + \
@@ -69,9 +68,10 @@ def main():
Magisk().install()
dockerfile = dockerfile+"COPY magisk /\n"
tags.append("magisk")
# if args.widevine:
# Widevine().install()
# dockerfile = dockerfile+"COPY widevine /\n"
if args.widevine:
Widevine(args.android).install()
dockerfile = dockerfile+"COPY widevine /\n"
tags.append("widevine")
print("\nDockerfile\n"+dockerfile)
with open("./Dockerfile", "w") as f:
f.write(dockerfile)

View File

@@ -1,23 +1,60 @@
import os
import re
import shutil
from stuffs.general import General
from tools.helper import bcolors, get_download_dir, print_color, run
from tools.helper import bcolors, get_download_dir, host, print_color, run
class Widevine(General):
def __init__(self, android_version) -> None:
super().__init__()
self.android_version = android_version
self.dl_link = self.dl_links[self.machine[0]][android_version][0]
self.act_md5 = self.dl_links[self.machine[0]][android_version][1]
download_loc = get_download_dir()
machine = host()
copy_dir = "./widevine"
dl_link = "https://codeload.github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/zip/94c9ee172e3d78fecc81863f50a59e3646f7a2bd"
dl_links = {
# "x86": {
# "11.0.0": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/48d1076a570837be6cdce8252d5d143363e37cc1.zip",
# "f587b8859f9071da4bca6cea1b9bed6a"]
# },
"x86_64": {
"11.0.0": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/48d1076a570837be6cdce8252d5d143363e37cc1.zip",
"f587b8859f9071da4bca6cea1b9bed6a"],
"12.0.0": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/3bba8b6e9dd5ffad5b861310433f7e397e9366e8.zip",
"3e147bdeeb7691db4513d93cfa6beb23"],
"13.0.0": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/a8524d608431573ef1c9313822d271f78728f9a6.zip",
"5c55df61da5c012b4e43746547ab730f"]
},
# "armeabi-v7a":
# {
# "11.0.0": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/7b6e37ef0b63408f7d0232e67192020ba0aa402b.zip",
# "3c3a136dc926ae5fc07826359720dbab"]
# },
"arm64-v8a": {
"11.0.0": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/a1a19361d36311bee042da8cf4ced798d2c76d98.zip",
"fed6898b5cfd2a908cb134df97802554"]
}
}
dl_file_name = os.path.join(download_loc, "widevine.zip")
extract_to = "/tmp/widevineunpack"
act_md5 = "a31f325453c5d239c21ecab8cfdbd878"
def download(self):
print_color("Downloading widevine now .....", bcolors.GREEN)
super().download()
def copy(self):
shutil.rmtree("./widevine")
run(["chmod", "+x", self.extract_to, "-R"])
print_color("Copying widevine library files ...", bcolors.GREEN)
shutil.copytree(os.path.join(self.extract_to, "vendor_google_proprietary_widevine-prebuilt-94c9ee172e3d78fecc81863f50a59e3646f7a2bd",
name = re.findall("([a-zA-Z0-9]+)\.zip", self.dl_link)[0]
shutil.copytree(os.path.join(self.extract_to, "vendor_google_proprietary_widevine-prebuilt-"+name,
"prebuilts"), os.path.join(self.copy_dir, "vendor"), dirs_exist_ok=True)
if "x86" in self.machine[0] and self.android_version == "11.0.0":
os.symlink("./libprotobuf-cpp-lite-3.9.1.so",
os.path.join(self.copy_dir, "vendor", "lib", "libprotobuf-cpp-lite.so"))
os.symlink("./libprotobuf-cpp-lite-3.9.1.so", os.path.join(self.copy_dir,
"vendor", "lib64", "libprotobuf-cpp-lite.so"))