mirror of
https://github.com/ayasa520/redroid-script.git
synced 2026-02-24 16:35:08 +08:00
Fix variable naming and hardcoded path
Remove Dockerfile init
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -109,3 +109,4 @@ magisk
|
||||
ndk
|
||||
widevine
|
||||
houdini
|
||||
Dockerfile
|
||||
@@ -1,4 +0,0 @@
|
||||
FROM redroid/redroid:11.0.0-latest
|
||||
COPY gapps /
|
||||
COPY ndk /
|
||||
COPY magisk /
|
||||
26
README.md
26
README.md
@@ -49,6 +49,24 @@ This command will add Gapps, Magisk and Libndk to the ReDroid image at the same
|
||||
python redroid.py -a 11.0.0 -gmn
|
||||
```
|
||||
|
||||
Then start the docker container.
|
||||
|
||||
```bash
|
||||
docker run -itd --rm --privileged \
|
||||
-v ~/data:/data \
|
||||
-p 5555:5555 \
|
||||
redroid/redroid:11.0.0-gapps-ndk-magisk \
|
||||
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 \
|
||||
ro.dalvik.vm.isa.arm=x86 \
|
||||
ro.dalvik.vm.isa.arm64=x86_64 \
|
||||
ro.enable.native.bridge.exec=1 \
|
||||
ro.dalvik.vm.native.bridge=libndk_translation.so \
|
||||
ro.ndk_translation.version=0.2.2 \
|
||||
```
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Magisk installed: N/A
|
||||
@@ -75,6 +93,8 @@ python redroid.py -a 11.0.0 -gmn
|
||||
|
||||
|
||||
## Credits
|
||||
1. [waydroid_script](https://github.com/casualsnek/waydroid_script)
|
||||
2. [Magisk Delta](https://huskydg.github.io/magisk-files/)
|
||||
3. [vendor_intel_proprietary_houdini](https://github.com/supremegamers/vendor_intel_proprietary_houdini)
|
||||
1. [remote-android](https://github.com/remote-android)
|
||||
2. [waydroid_script](https://github.com/casualsnek/waydroid_script)
|
||||
3. [Magisk Delta](https://huskydg.github.io/magisk-files/)
|
||||
4. [vendor_intel_proprietary_houdini](https://github.com/supremegamers/vendor_intel_proprietary_houdini)
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ def main():
|
||||
f.write(dockerfile)
|
||||
client = docker.DockerClient(base_url='unix://var/run/docker.sock')
|
||||
new_image_name = "redroid/redroid:"+"-".join(tags)
|
||||
client.images.build(path="/home/rikka/redroid-script",
|
||||
client.images.build(path=".",
|
||||
dockerfile="Dockerfile",
|
||||
tag=new_image_name)
|
||||
helper.print_color("Successfully built {}".format(new_image_name), helper.bcolors.GREEN)
|
||||
|
||||
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
docker==6.0.1
|
||||
requests==2.28.1
|
||||
tqdm==4.64.1
|
||||
@@ -15,7 +15,7 @@ class Gapps(General):
|
||||
dl_link = dl_links[arch[0]][0]
|
||||
dl_file_name = os.path.join(download_loc, "open_gapps.zip")
|
||||
act_md5 = dl_links[arch[0]][1]
|
||||
sys_image_mount = "./gapps"
|
||||
copy_dir = "./gapps"
|
||||
extract_to = "/tmp/ogapps/extract"
|
||||
non_apks = [
|
||||
"defaultetc-common.tar.lz",
|
||||
@@ -49,11 +49,11 @@ class Gapps(General):
|
||||
app_priv = os.listdir(os.path.join(self.extract_to, "appunpack", app_name, "nodpi"))[0]
|
||||
app_src_dir = os.path.join(self.extract_to, "appunpack", app_name, xx_dpi, app_priv)
|
||||
for app in os.listdir(app_src_dir):
|
||||
shutil.copytree(os.path.join(app_src_dir, app), os.path.join(self.sys_image_mount, "system", "priv-app", app), dirs_exist_ok=True)
|
||||
shutil.copytree(os.path.join(app_src_dir, app), os.path.join(self.copy_dir, "system", "priv-app", app), dirs_exist_ok=True)
|
||||
else:
|
||||
print(" Processing extra package : "+os.path.join(self.extract_to, "Core", lz_file))
|
||||
run(["tar", "--lzip", "-xvf", os.path.join(self.extract_to, "Core", lz_file), "-C", os.path.join(self.extract_to, "appunpack")])
|
||||
app_name = os.listdir(os.path.join(self.extract_to, "appunpack"))[0]
|
||||
common_content_dirs = os.listdir(os.path.join(self.extract_to, "appunpack", app_name, "common"))
|
||||
for ccdir in common_content_dirs:
|
||||
shutil.copytree(os.path.join(self.extract_to, "appunpack", app_name, "common", ccdir), os.path.join(self.sys_image_mount, "system", ccdir), dirs_exist_ok=True)
|
||||
shutil.copytree(os.path.join(self.extract_to, "appunpack", app_name, "common", ccdir), os.path.join(self.copy_dir, "system", ccdir), dirs_exist_ok=True)
|
||||
@@ -7,7 +7,7 @@ from tools.helper import bcolors, get_download_dir, print_color, run
|
||||
|
||||
class Houdini(General):
|
||||
download_loc = get_download_dir()
|
||||
sys_image_mount = "./houdini"
|
||||
copy_dir = "./houdini"
|
||||
dl_links = {
|
||||
"11.0.0": [
|
||||
"https://github.com/supremegamers/vendor_intel_proprietary_houdini/archive/81f2a51ef539a35aead396ab7fce2adf89f46e88.zip",
|
||||
@@ -44,9 +44,9 @@ class Houdini(General):
|
||||
print_color("Copying libhoudini library files ...", bcolors.GREEN)
|
||||
name = re.findall("([a-zA-Z0-9]+)\.zip", self.dl_link)[0]
|
||||
shutil.copytree(os.path.join(self.extract_to, "vendor_intel_proprietary_houdini-" + name,
|
||||
"prebuilts"), os.path.join(self.sys_image_mount, "vendor"), dirs_exist_ok=True)
|
||||
"prebuilts"), os.path.join(self.copy_dir, "vendor"), dirs_exist_ok=True)
|
||||
|
||||
init_path = os.path.join(self.sys_image_mount, "system", "etc", "init", "houdini.rc")
|
||||
init_path = os.path.join(self.copy_dir, "system", "etc", "init", "houdini.rc")
|
||||
if not os.path.isfile(init_path):
|
||||
os.makedirs(os.path.dirname(init_path), exist_ok=True)
|
||||
with open(init_path, "w") as initfile:
|
||||
|
||||
@@ -10,8 +10,8 @@ class Magisk(General):
|
||||
dl_link = "https://huskydg.github.io/magisk-files/app-release.apk"
|
||||
dl_file_name = os.path.join(download_loc, "magisk.apk")
|
||||
extract_to = "/tmp/magisk_unpack"
|
||||
sys_overlay_dir = "./magisk"
|
||||
magisk_dir = os.path.join(sys_overlay_dir, "system", "etc", "init", "magisk")
|
||||
copy_dir = "./magisk"
|
||||
magisk_dir = os.path.join(copy_dir, "system", "etc", "init", "magisk")
|
||||
machine = host()
|
||||
oringinal_bootanim = """
|
||||
service bootanim /system/bin/bootanimation
|
||||
@@ -71,8 +71,8 @@ on property:init.svc.zygote=stopped
|
||||
if not os.path.exists(self.magisk_dir):
|
||||
os.makedirs(self.magisk_dir, exist_ok=True)
|
||||
|
||||
if not os.path.exists(os.path.join(self.sys_overlay_dir, "sbin")):
|
||||
os.makedirs(os.path.join(self.sys_overlay_dir, "sbin"), exist_ok=True)
|
||||
if not os.path.exists(os.path.join(self.copy_dir, "sbin")):
|
||||
os.makedirs(os.path.join(self.copy_dir, "sbin"), exist_ok=True)
|
||||
|
||||
print_color("Copying magisk libs now ...", bcolors.GREEN)
|
||||
|
||||
@@ -88,7 +88,7 @@ on property:init.svc.zygote=stopped
|
||||
|
||||
# Updating Magisk from Magisk manager will modify bootanim.rc,
|
||||
# So it is necessary to backup the original bootanim.rc.
|
||||
bootanim_path = os.path.join(self.sys_overlay_dir, "system", "etc", "init", "bootanim.rc")
|
||||
bootanim_path = os.path.join(self.copy_dir, "system", "etc", "init", "bootanim.rc")
|
||||
gz_filename = os.path.join(bootanim_path)+".gz"
|
||||
with gzip.open(gz_filename,'wb') as f_gz:
|
||||
f_gz.write(self.oringinal_bootanim.encode('utf-8'))
|
||||
|
||||
@@ -5,7 +5,7 @@ from tools.helper import bcolors, get_download_dir, print_color, run
|
||||
|
||||
class Ndk(General):
|
||||
download_loc = get_download_dir()
|
||||
sys_image_mount = "./ndk"
|
||||
copy_dir = "./ndk"
|
||||
dl_link = "https://www.dropbox.com/s/eaf4dj3novwiccp/libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3.zip?dl=1"
|
||||
dl_file_name = os.path.join(download_loc, "libndktranslation.zip")
|
||||
extract_to = "/tmp/libndkunpack"
|
||||
@@ -30,9 +30,9 @@ on property:ro.enable.native.bridge.exec=1
|
||||
run(["chmod", "+x", self.extract_to, "-R"])
|
||||
|
||||
print_color("Copying libndk library files ...", bcolors.GREEN)
|
||||
shutil.copytree(os.path.join(self.extract_to, "libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3", "system"), os.path.join(self.sys_image_mount, "system"), dirs_exist_ok=True)
|
||||
shutil.copytree(os.path.join(self.extract_to, "libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3", "system"), os.path.join(self.copy_dir, "system"), dirs_exist_ok=True)
|
||||
|
||||
init_path = os.path.join(self.sys_image_mount, "system", "etc", "init", "libndk.rc")
|
||||
init_path = os.path.join(self.copy_dir, "system", "etc", "init", "libndk.rc")
|
||||
if not os.path.isfile(init_path):
|
||||
os.makedirs(os.path.dirname(init_path), exist_ok=True)
|
||||
with open(init_path, "w") as initfile:
|
||||
|
||||
@@ -6,7 +6,7 @@ from tools.helper import bcolors, get_download_dir, print_color, run
|
||||
|
||||
class Widevine(General):
|
||||
download_loc = get_download_dir()
|
||||
vendor_image_mount = "./widevine"
|
||||
copy_dir = "./widevine"
|
||||
dl_link = "https://codeload.github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/zip/94c9ee172e3d78fecc81863f50a59e3646f7a2bd"
|
||||
dl_file_name = os.path.join(download_loc, "widevine.zip")
|
||||
extract_to = "/tmp/widevineunpack"
|
||||
@@ -20,4 +20,4 @@ class Widevine(General):
|
||||
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",
|
||||
"prebuilts"), os.path.join(self.vendor_image_mount, "vendor"), dirs_exist_ok=True)
|
||||
"prebuilts"), os.path.join(self.copy_dir, "vendor"), dirs_exist_ok=True)
|
||||
|
||||
@@ -28,7 +28,7 @@ def run(args):
|
||||
|
||||
def download_file(url, f_name):
|
||||
md5 = ""
|
||||
response = requests.get(url, stream=True, proxies={"https":"127.0.0.1:7890"})
|
||||
response = requests.get(url, stream=True)
|
||||
total_size_in_bytes = int(response.headers.get('content-length', 0))
|
||||
block_size = 1024 # 1 Kibibyte
|
||||
progress_bar = tqdm(total=total_size_in_bytes, unit='iB', unit_scale=True)
|
||||
|
||||
Reference in New Issue
Block a user