casualsnek / waydroid_script

Python Script to add OpenGapps, Magisk, libhoudini translation library and libndk translation library to waydroid !
GNU General Public License v3.0
1.65k stars 157 forks source link

Gapps: Not extracting apps into app & priv-app that are needed. #23

Open electrikjesus opened 2 years ago

electrikjesus commented 2 years ago

Hello, I am not the best at python, so I am having trouble getting what you started working for Android-x86 builds. So far, here are my changes: https://github.com/electrikjesus/waydroid_script/tree/s-x86

The issue I am having is that some of the apps do not extract to "system/app" and are all added to "system/priv-app" So any assistance you can provide here will help us get things moving forward on Android-x86 & Waydroid

casualsnek commented 2 years ago

https://github.com/electrikjesus/waydroid_script/blob/s-x86/waydroid_extras.py#L166 changing: shutil.copytree(os.path.join(app_src_dir, app), os.path.join(sys_image_mount, "system", "priv-app", app), dirs_exist_ok=True)

to

shutil.copytree(os.path.join(app_src_dir, app), os.path.join(sys_image_mount, "system", "spp", app), dirs_exist_ok=True)

should move apk to the spp directory instead of priv-app directory, ( if i got your question correctly,(English is not my primary language) )

electrikjesus commented 2 years ago

Kinda, I am trying to figure out a way to get it to detect if the archive has the apk in nodpi/app or nodpi/priv-app, and have it place it in the correct destination from there.

electrikjesus commented 2 years ago

This could also help the same issue with Magisk wanting to run from app instead of priv-app too

casualsnek commented 2 years ago

Kinda, I am trying to figure out a way to get it to detect if the archive has the apk in nodpi/app or nodpi/priv-app, and have it place it in the correct destination from there.

https://github.com/electrikjesus/waydroid_script/blob/s-x86/waydroid_extras.py#L163

app_priv = os.listdir(os.path.join(extract_to, "appunpack", app_name, "nodpi"))[0]

After this variable gets assigned you can check if it's equals 'priv-app' or just 'app'.

https://github.com/electrikjesus/waydroid_script/blob/s-x86/waydroid_extras.py#L166

shutil.copytree(os.path.join(app_src_dir, app), os.path.join(sys_image_mount, "system", "priv-app", app), dirs_exist_ok=True)

Just replacing "priv-app" in above line directly to app_priv variable so that it looks like this should work :

shutil.copytree(os.path.join(app_src_dir, app), os.path.join(sys_image_mount, "system", app_priv, app), dirs_exist_ok=True)

( Now i will also modify my script to put the apps in their correct place thanks ! )

electrikjesus commented 2 years ago

That works. Although depending on the gapps package, it does get caught up when it comes across a "common" folder it wasn't expecting.