Execute commands on waydroid shell with pipes
parent
0feb86ceef
commit
d72bf018d1
@ -1,23 +1,21 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
from tools import container
|
from tools import container
|
||||||
from tools.helper import run
|
from tools.helper import shell
|
||||||
from tools.logger import Logger
|
from tools.logger import Logger
|
||||||
|
|
||||||
|
|
||||||
class Android_id:
|
class AndroidId:
|
||||||
def get_id(self):
|
def get_id(self):
|
||||||
|
|
||||||
if container.is_running():
|
if container.is_running():
|
||||||
queryout = run([
|
try:
|
||||||
'waydroid','shell',
|
queryout = shell(
|
||||||
'sqlite3',
|
arg="sqlite3 /data/data/com.google.android.gsf/databases/gservices.db \"select * from main where name = 'android_id';\"",
|
||||||
'/data/data/com.google.android.gsf/databases/gservices.db',
|
env="ANDROID_RUNTIME_ROOT=/apex/com.android.runtime ANDROID_DATA=/data ANDROID_TZDATA_ROOT=/apex/com.android.tzdata ANDROID_I18N_ROOT=/apex/com.android.i18n"
|
||||||
"select * from main where name = \"android_id\";"
|
)
|
||||||
])
|
except:
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
Logger.error("Cannot access gservices.db, make sure gapps is installed and waydroid was started at least once after installation and make sure waydroid is running !")
|
Logger.error("WayDroid isn't running !")
|
||||||
return
|
return
|
||||||
print(queryout.stdout.decode().replace("android_id|", "").strip())
|
print(queryout.replace("android_id|", "").strip())
|
||||||
print(" ^----- Open https://google.com/android/uncertified/?pli=1")
|
print(" ^----- Open https://google.com/android/uncertified/?pli=1")
|
||||||
print(" Login with your google id then submit the form with id shown above")
|
print(" Login with your google id then submit the form with id shown above")
|
||||||
|
Loading…
Reference in New Issue