's'
This commit is contained in:
20
android13/patch_bootstrap_setupwizard.py
Normal file
20
android13/patch_bootstrap_setupwizard.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from pathlib import Path
|
||||
path = Path('/home/eric/redroid-android13/bootstrap_redroid.py')
|
||||
text = path.read_text()
|
||||
old = ''' try_shell(backend, "pm disable-user --user 0 com.android.setupwizard")
|
||||
try_shell(backend, "pm disable-user --user 0 com.google.android.setupwizard")
|
||||
try_shell(backend, "appops set com.android.shell android:mock_location allow")
|
||||
'''
|
||||
new = ''' for package in ("com.android.setupwizard", "com.google.android.setupwizard"):
|
||||
packages = backend.exec_shell(
|
||||
"pm list packages --user 0",
|
||||
check=False,
|
||||
capture_output=True,
|
||||
).stdout
|
||||
if package in packages:
|
||||
try_shell(backend, "pm disable-user --user 0 {}".format(shell_quote(package)))
|
||||
try_shell(backend, "appops set com.android.shell android:mock_location allow")
|
||||
'''
|
||||
if old not in text:
|
||||
raise SystemExit('expected setupwizard block not found')
|
||||
path.write_text(text.replace(old, new))
|
||||
Reference in New Issue
Block a user