parent
0d7681bccb
commit
ca932b90e1
2 changed files with 13 additions and 8 deletions
|
|
@ -1,18 +1,23 @@
|
|||
import os
|
||||
import sys
|
||||
from tools import container
|
||||
from tools.helper import run
|
||||
from tools.logger import Logger
|
||||
|
||||
|
||||
class Android_id:
|
||||
def get_id(self):
|
||||
if not os.path.isfile("/var/lib/waydroid/data/data/com.google.android.gsf/databases/gservices.db"):
|
||||
|
||||
if container.is_running():
|
||||
queryout = run([
|
||||
'waydroid','shell',
|
||||
'sqlite3',
|
||||
'/data/data/com.google.android.gsf/databases/gservices.db',
|
||||
"select * from main where name = \"android_id\";"
|
||||
])
|
||||
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 !")
|
||||
sys.exit(1)
|
||||
sqs = """
|
||||
SELECT * FROM main WHERE name='android_id'
|
||||
"""
|
||||
queryout = run(["sqlite3", "/var/lib/waydroid/data/data/com.google.android.gsf/databases/gservices.db", sqs.strip()])
|
||||
return
|
||||
print(queryout.stdout.decode().replace("android_id|", "").strip())
|
||||
print(" ^----- Open https://google.com/android/uncertified/?pli=1")
|
||||
print(" Login with your google id then submit the form with id shown above")
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ def get_download_dir():
|
|||
def get_data_dir():
|
||||
return os.path.join('/', "home", os.environ.get("SUDO_USER", os.environ["USER"]), ".local", "share", "waydroid", "data")
|
||||
|
||||
def run(args, ignore=""):
|
||||
result = subprocess.run(args=args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
def run(args, env=None, ignore=""):
|
||||
result = subprocess.run(args=args, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
# print(result.stdout.decode())
|
||||
if result.stderr:
|
||||
error = result.stderr.decode("utf-8")
|
||||
|
|
|
|||
Loading…
Reference in a new issue