From c59cd2da5257736f66b360cf57c3f7df6853e865 Mon Sep 17 00:00:00 2001 From: eric Date: Sat, 4 Apr 2026 15:47:25 -0500 Subject: [PATCH] 's' --- run_redroid.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/run_redroid.py b/run_redroid.py index 0579c1d..9948146 100644 --- a/run_redroid.py +++ b/run_redroid.py @@ -261,7 +261,10 @@ def main(): parser.add_argument( "--adb-insecure", action="store_true", - help="Set ro.adb.secure=0 so adb over TCP does not stay 'unauthorized' (no UI to approve keys)", + help=( + "Disable ADB RSA authorization (ro.adb.secure=0 + androidboot.adb.secure=0). " + "Passed early so init applies it before other ro.* props (see redroid-doc #579)." + ), ) args = parser.parse_args() @@ -291,18 +294,21 @@ def main(): cmd.extend(["--memory", memory]) if not args.keep_container: cmd.append("--rm") - cmd.extend( - [ - image, - "androidboot.redroid_gpu_mode={}".format(args.gpu_mode), - ] - ) + cmd.append(image) + # Init applies read-only props in order; later ro.adb.secure=0 is ignored if adb.secure + # was already set (redroid-doc #579). Put these immediately after the image name. + if args.adb_insecure: + cmd.extend( + [ + "androidboot.adb.secure=0", + "ro.adb.secure=0", + ] + ) + cmd.append("androidboot.redroid_gpu_mode={}".format(args.gpu_mode)) cmd.extend(bridge_props(bridge)) cmd.extend(preset_props(preset)) cmd.extend(device_profile_props(device_profile)) cmd.extend(args.extra_prop) - if args.adb_insecure: - cmd.append("ro.adb.secure=0") if args.replace and not args.dry_run: subprocess.run( @@ -330,6 +336,12 @@ def main(): "If the device shows as unauthorized, stop the container and re-run with --adb-insecure " "(headless instances cannot tap the USB debugging authorization dialog)." ) + else: + print( + "If adb still shows unauthorized: stop the container, delete host folder " + "{}/misc/adb (persisted keys from an older boot), then start again. " + "Also try: adb kill-server && adb start-server".format(data_dir) + ) if __name__ == "__main__":