This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathInstallAurora.py
53 lines (46 loc) · 1.65 KB
/
InstallAurora.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import configparser
from clint.textui import progress
import os
import conadb
from pyaxmlparser import APK
import os
import urllib.request
import adbutils
from ppadb.client import Client as AdbClient
import time
config = configparser.ConfigParser()
config.read('WSAU.ini')
version = config['AuroraStore']['Version']
path = 'temp/aurora.apk'
app = APK(path)
if os.path.exists(path):
print("It looks like you've downloaded it before. Going to install process...")
else:
print('Starting download...')
urllib.request.urlretrieve("https://f-droid.org/repo/com.aurora.store_" + version + ".apk", path)
print('Download complete! Connecting to Windows Subsystem for Android machine...')
os.system('cmd /k "WsaClient.exe /start"')
print('Connecting WSA machine through ADB...')
conadb.main()
client = AdbClient(host="127.0.0.1", port=5037)
devices = client.devices()
for device in devices:
AuroraStoreCheck = str(device.is_installed("com.aurora.store"))
if AuroraStoreCheck == "False":
print("Installing " + app.application + " (" + app.version_name + ")...")
elif AuroraStoreCheck == "True":
print("Updating " + app.application + " to version " + app.version_name + "...")
for device in devices:
device.install(path)
for device in devices:
FinalCheck = str(device.is_installed("com.aurora.store"))
if FinalCheck == "True":
print("Installation successful! Going back to menu in 5 seconds...")
time.sleep(5)
os.system('cls')
exec(open("CliLauncher.py").read())
if FinalCheck == "False":
print("Installation failed. Going back to menu in 5 seconds...")
time.sleep(5)
os.system('cls')
exec(open("CliLauncher.py").read())