add microG
This commit is contained in:
parent
d205812acb
commit
0bc2cedc2d
7 changed files with 144 additions and 8 deletions
16
README.md
16
README.md
|
|
@ -16,7 +16,7 @@ Then run:
|
|||
git clone https://github.com/casualsnek/waydroid_script
|
||||
cd waydroid_script
|
||||
sudo python3 -m pip install -r requirements.txt
|
||||
sudo python3 main.py install {gapps, magisk, libndk, libhoudini, smartdock}
|
||||
sudo python3 main.py install {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg}
|
||||
|
||||
## Install OpenGapps
|
||||
|
||||
|
|
@ -121,6 +121,14 @@ chmod 777 -R /mnt/*/*/*/*/Android/obb
|
|||
- 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
|
||||
|
||||

|
||||
|
||||
```
|
||||
sudo python main.py install microg
|
||||
```
|
||||
|
||||
## 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:
|
||||
|
|
@ -148,5 +156,7 @@ And re-run the script.
|
|||
- [WayDroid](https://github.com/waydroid/waydroid)
|
||||
- [waydroid_script](https://github.com/casualsnek/waydroid_script)
|
||||
- [Magisk Delta](https://huskydg.github.io/magisk-files/)
|
||||
- [OpenGapps](https://github.com/opengapps/opengapps)
|
||||
- [Smart Dock](https://github.com/axel358/smartdock)
|
||||
- [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/)
|
||||
BIN
assets/7.png
Normal file
BIN
assets/7.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 112 KiB |
41
main.py
41
main.py
|
|
@ -6,6 +6,7 @@ from stuffs.android_id import Android_id
|
|||
from stuffs.gapps import Gapps
|
||||
from stuffs.houdini import Houdini
|
||||
from stuffs.magisk import Magisk
|
||||
from stuffs.microg import MicroG
|
||||
from stuffs.ndk import Ndk
|
||||
from stuffs.nodataperm import Nodataperm
|
||||
from stuffs.smartdock import Smartdock
|
||||
|
|
@ -34,9 +35,32 @@ def install(*args):
|
|||
Smartdock().install()
|
||||
if "nodataperm" in args:
|
||||
Nodataperm().install()
|
||||
if "microg" in args:
|
||||
MicroG().install()
|
||||
|
||||
def uninstall(*args):
|
||||
pass
|
||||
if "gapps" in args:
|
||||
Gapps().uninstall()
|
||||
if "libndk" in args and "houdini" not in args:
|
||||
arch = helper.host()[0]
|
||||
if arch == "x86_64":
|
||||
Ndk().uninstall()
|
||||
else:
|
||||
Logger.warn("libndk is not supported on your CPU")
|
||||
if "libhoudini" in args and "ndk" not in args:
|
||||
arch = helper.host()[0]
|
||||
if arch == "x86_64":
|
||||
Houdini().uninstall()
|
||||
else:
|
||||
Logger.warn("libhoudini is not supported on your CPU")
|
||||
if "magisk" in args:
|
||||
Magisk().uninstall()
|
||||
if "widevine" in args:
|
||||
Widevine().uninstall()
|
||||
if "smartdock" in args:
|
||||
Smartdock().uninstall()
|
||||
if "nodataperm" in args:
|
||||
Nodataperm().uninstall()
|
||||
|
||||
def main():
|
||||
about = """
|
||||
|
|
@ -60,12 +84,21 @@ def main():
|
|||
"dest": "app",
|
||||
"type": str,
|
||||
"nargs": '+',
|
||||
"choices": ["gapps", "libndk","libhoudini","magisk", "smartdock","widevine", "nodataperm"],
|
||||
"metavar":"",
|
||||
"choices": ["gapps", "microg", "libndk","libhoudini","magisk", "smartdock","widevine", "nodataperm"],
|
||||
}
|
||||
|
||||
install_parser = subparsers.add_parser("install", help='install something')
|
||||
install_help = """
|
||||
gapps: Install Open GApps Pico(minimum GApps installation)
|
||||
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
|
||||
smartdock: A desktop mode launcher for Android
|
||||
"""
|
||||
install_parser = subparsers.add_parser("install",formatter_class=argparse.RawTextHelpFormatter, help='install something')
|
||||
install_parser.set_defaults(func=install)
|
||||
install_parser.add_argument(**arg_template)
|
||||
install_parser.add_argument(**arg_template,help=install_help)
|
||||
|
||||
uninstall_parser = subparsers.add_parser("uninstall", help='uninstall something')
|
||||
uninstall_parser.set_defaults(func=uninstall)
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
tqdm
|
||||
requests
|
||||
aapt2
|
||||
|
|
@ -129,3 +129,6 @@ class General:
|
|||
self.start()
|
||||
self.extra2()
|
||||
Logger.info("Installation finished")
|
||||
|
||||
def uninstall(self):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ on property:init.svc.zygote=stopped
|
|||
if os.path.isfile(self.download_loc):
|
||||
os.remove(self.download_loc)
|
||||
Logger.info("Downloading latest Magisk-Delta to {} now ...".format(self.download_loc))
|
||||
download_file(self.dl_link, self.download_loc)
|
||||
download_file(self.dl_link, self.download_loc)
|
||||
|
||||
def copy(self):
|
||||
magisk_absolute_dir = os.path.join(self.copy_dir, self.magisk_dir)
|
||||
|
|
|
|||
89
stuffs/microg.py
Normal file
89
stuffs/microg.py
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
import os
|
||||
import shutil
|
||||
from time import sleep
|
||||
from stuffs.general import General
|
||||
from tools.helper import get_download_dir, host, run
|
||||
from aapt2 import aapt
|
||||
from tools import container
|
||||
from tools.logger import Logger
|
||||
|
||||
|
||||
class MicroG(General):
|
||||
partition = "system"
|
||||
main_arch = host()[0]
|
||||
sub_arch = "x86" if main_arch == "x86_64" else "armeabi-v7a" if main_arch == "arm64-v8a" else ""
|
||||
fdroid = "https://f-droid.org/repo/"
|
||||
microg="https://microg.org/fdroid/repo/"
|
||||
fdroid_repo_apks = {
|
||||
"com.aurora.store_41.apk": "9e6c79aefde3f0bbfedf671a2d73d1be",
|
||||
"com.etesync.syncadapter_20300.apk": "997d6de7d41c454d39fc22cd7d8fc3c2",
|
||||
"com.aurora.adroid_8.apk": "0010bf93f02c2d18daf9e767035fefc5",
|
||||
"org.fdroid.fdroid.privileged_2130.apk": "b04353155aceb36207a206d6dd14ba6a",
|
||||
"org.microg.nlp.backend.ichnaea_20036.apk": "0b3cb65f8458d1a5802737c7392df903",
|
||||
"org.microg.nlp.backend.nominatim_20042.apk": "88e7397cbb9e5c71c8687d3681a23383",
|
||||
}
|
||||
microg_apks= {
|
||||
"com.google.android.gms-223616054.apk": "a945481ca5d33a03bc0f9418263c3228",
|
||||
"com.google.android.gsf-8.apk": "b2b4ea3642df6158e14689a4b2a246d4",
|
||||
"com.android.vending-22.apk": "6815d191433ffcd8fa65923d5b0b0573",
|
||||
"org.microg.gms.droidguard-14.apk": "4734b41c1a6bc34a541053ddde7a0f8e"
|
||||
}
|
||||
|
||||
def skip_extract(self):
|
||||
return True
|
||||
|
||||
def download(self):
|
||||
for apk, md5 in self.fdroid_repo_apks.items():
|
||||
self.dl_link = self.fdroid+apk
|
||||
self.act_md5 = md5
|
||||
self.dl_file_name = apk
|
||||
super().download()
|
||||
for apk, md5 in self.microg_apks.items():
|
||||
self.dl_link = self.microg+apk
|
||||
self.act_md5 = md5
|
||||
self.dl_file_name = apk
|
||||
super().download()
|
||||
|
||||
def generate_permissions(self):
|
||||
permissions = "<permissions>"
|
||||
download_dir = get_download_dir()
|
||||
for apk in {**self.fdroid_repo_apks, **self.microg_apks}.keys():
|
||||
splitor = "_" if apk in self.fdroid_repo_apks.keys() else "-"
|
||||
package = apk.split(splitor)[0]
|
||||
permissions += '\n\t<privapp-permissions package="{}">\n'.format(package)
|
||||
permission_list = aapt.get_apk_info(os.path.join(download_dir,apk))["permissions"]
|
||||
permissions += "\n".join(['\t\t<permission name="{}"/>'.format(permission) for permission in permission_list])
|
||||
permissions += "\n\t</privapp-permissions>"
|
||||
return permissions
|
||||
|
||||
def copy(self):
|
||||
Logger.info("Copying MicroG and other files")
|
||||
priv_apps = ["com.google.android.gms", "com.android.vending"]
|
||||
for apk in {**self.fdroid_repo_apks, **self.microg_apks}.keys():
|
||||
splitor = "_" if apk in self.fdroid_repo_apks.keys() else "-"
|
||||
package = apk.split(splitor)[0]
|
||||
download_dir = get_download_dir()
|
||||
apk_dir = "app" if package not in priv_apps else "priv-app"
|
||||
if not os.path.exists(os.path.join(self.copy_dir, self.partition, apk_dir, package)):
|
||||
os.makedirs(os.path.join(self.copy_dir, self.partition, apk_dir, package))
|
||||
shutil.copyfile(os.path.join(download_dir, apk),
|
||||
os.path.join(self.copy_dir, self.partition, apk_dir, package, apk))
|
||||
permissions = self.generate_permissions()
|
||||
permission_dir = os.path.join(self.copy_dir, self.partition, "etc", "permissions")
|
||||
if not os.path.exists(permission_dir):
|
||||
os.makedirs(permission_dir)
|
||||
with open(os.path.join(permission_dir, "foss-permissions.xml"), "w") as f:
|
||||
f.write(permissions)
|
||||
|
||||
def extra2(self):
|
||||
index = 0
|
||||
while not container.is_running():
|
||||
list = ["\\", "|", "/", "—"]
|
||||
sleep(0.5)
|
||||
print("\r\tPlease start WayDroid for further setup {}".format(list[index%4]), end="")
|
||||
index += 1
|
||||
sleep(5)
|
||||
print()
|
||||
Logger.info("Signature spoofing")
|
||||
run("waydroid shell pm grant com.google.android.gms android.permission.FAKE_PACKAGE_SIGNATURE".split())
|
||||
run("waydroid shell pm grant com.android.vending android.permission.FAKE_PACKAGE_SIGNATURE".split())
|
||||
Loading…
Reference in a new issue