Trying to connect ADB to new phone, getting "no permissions"

… but it worked before

So I got a new phone in and thought that maybe I could use an adb backup from my old phone to get all the settings and stuff over. I have 2 different backups, one was done with -all, one was done with -apk -shared -all -system (I read that apparently “all” is not actually everything and those 4 should catch the rest).
Anyway, when the new phone came in it worked fine after the initial setup (and swapping out a dodgy USB cable :roll_eyes:), i.e. it was seen by ADB as a device to use. So I went ahead and adb restore 20191116-apk-shared-all-system.ab, entered the password on the phone and let it run, didn’t look at it until hours later because I thought it would just do its thing.

Well, turns out it wasn’t doing its thing. I.e. no settings carried over. I restarted the phone because I thought it would need that to overwrite all the stuff, but nothing happened. And now I’m getting this:

[tarulia@localhost ~]$ adb devices
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
????????????    no permissions; see [http://developer.android.com/tools/device.html]

So I restarted the phone, the PC, reconnected multiple times, even went ahead and did a factory reset on the phone and I’m still getting the same thing. Unfortunately the linked help page doesn’t help me much, or I don’t know what I’m looking for.

But, obviously, it worked before.
From what I can find on the internet the universal solution seems to be "just sudo adb", but I can’t believe that should be the only solution since - again - it worked before.

Have I bricked something? Any ideas?

did you set the phone to developer mode?

1 Like

Yes, with Debugging enabled.

I do also get the “Debugging enabled” Notification when connecting the phone. Strangely it doesn’t ask me whether I want to allow the connection anymore either (where it shows the PCs RSA key).

Also disabled and re-enabled debugging multiple times with no effect.

Also one thing, each time I reconnect the phone it adds the same device more times to the adb devices output:

[tarulia@localhost Android_Backup]$ adb devices
List of devices attached
????????????    no permissions; see [http://developer.android.com/tools/device.html]
????????????    no permissions; see [http://developer.android.com/tools/device.html]
????????????    no permissions; see [http://developer.android.com/tools/device.html]
????????????    no permissions; see [http://developer.android.com/tools/device.html]
????????????    no permissions; see [http://developer.android.com/tools/device.html]
????????????    no permissions; see [http://developer.android.com/tools/device.html]

(yes it’s all the same device ID)

what do you run? Windows or Linux?

Fedora 30, ADB is on 1.0.40 (installed via dnf)

:C just tried it on Arch with 1.0.41 and I see no such problem. :frowning:

I mean it worked flawless before, until I tried the restore…

But if it was the restore, the factory reset should have fixed that, no?

/edit
also just moved the ~/.android dir somewhere else (with adbkey and adbkey.pub inside), and it created a new one upon restarting the adb server, but phone still didn’t ask me if the connection is OK…

Also tried revoking USB debugging authorisations because I thought I might have accidentally “always allowed” the PC… no luck either.

did you attempt to chown the .android dir? perhaps something is whonky with the perms when it auto connects?

Haven’t tried, but it looks good:

drwxr-x---.   2 tarulia tarulia   4096 Oct  2 18:52  .android

Also, if it were broken permissions, re-creating it should have fixed it, no?

Either way, tried chown now and it didn’t change anything (restarted adb server too).

/edit
Also, just for shits’n’giggles I actually tried the sudo adb start-server thing and now the device actually shows up as unauthorized… (like it did initially before the restore and before confirming on the phone).

But there has to be a different solution then running stuff as sudo, no? From what I understand ADB is designed to run as a normal user…
Just trying to wrap my head around why it would have worked before if it is actually a permission issue that can “only” be solved with root…

I’m not 100% sure you can access all devices without root using adb. I know I have done it in the past, but I’ve also had times where I had to sudo.

I never really looked into the cause as I was just screwing around with android dev and it wasn’t a big deal on the device.

Sorry I couldn’t be more help, will be interesting to see if someone has a solution.

1 Like

Have you tried a different usb wire?

In the developer mode over on android there is an option to run adb over wifi if you do not have another usb connector on hand.

I did, since the first one didn’t work at all.
This one though worked initially until the initial restore.

OK so I didn’t have a whole lot of time fiddling with the device and I just now tried getting a backup restored, which doesn’t seem to work.

From what I read online supposedly it’s possible to take a backup of phone A and put it on phone B, which is what I’m trying to do (since I got a new phone).

So when restoring I get the usual restore screen where I enter the password. It gets going, but stops halfway through. It looks as if the UI were crashing because it completely turns off the screen and then takes a few seconds to come back into the locked screen, and upon unlocking it restores the launcher.
Unfortunately I can’t really make out where it’s crashing because it’s too fast…

/edit
I did an adb logcat to try to figure out where it’s crashing (did an adb logcat -b all -c before to flush the logs before this try):
logcat.txt (2.1 MB)

It’s a lot but the first thing I wonder about is this:

12-06 17:47:58.591 31319 32308 E BackupPasswordManager: Unable to read backup pw
 version
12-06 17:47:58.592 31319 32308 E BackupPasswordManager: Unable to read saved bac
kup pw hash

I don’t know how that’s possible when it still starts the restore… But either way, the crash is here:

12-06 17:49:18.607 31319  2786 D BackupManagerService: Need to launch agent for com.android.providers.telephony
12-06 17:49:18.608 31319  2786 D BackupManagerService: backup agent (com.android.providers.telephony.TelephonyBackupAgent) =
> no clear
--------- beginning of crash
12-06 17:49:18.608 31319  3047 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: restore-sys-runner
12-06 17:49:18.608 31319  3047 E AndroidRuntime: java.lang.RuntimeException: java.io.EOFException
12-06 17:49:18.608 31319  3047 E AndroidRuntime:        at android.app.backup.BackupAgent$BackupServiceBinder.doRestoreFile(
BackupAgent.java:1137)
12-06 17:49:18.608 31319  3047 E AndroidRuntime:        at com.android.server.backup.restore.RestoreFileRunnable.run(Restore
FileRunnable.java:58)
12-06 17:49:18.608 31319  3047 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:764)
12-06 17:49:18.608 31319  3047 E AndroidRuntime: Caused by: java.io.EOFException
12-06 17:49:18.608 31319  3047 E AndroidRuntime:        at java.io.DataInputStream.readFully(DataInputStream.java:200)
12-06 17:49:18.608 31319  3047 E AndroidRuntime:        at com.android.providers.settings.SettingsBackupAgent.onRestoreFile(
SettingsBackupAgent.java:403)
12-06 17:49:18.608 31319  3047 E AndroidRuntime:        at android.app.backup.BackupAgent$BackupServiceBinder.doRestoreFile(
BackupAgent.java:1134)
12-06 17:49:18.608 31319  3047 E AndroidRuntime:        ... 2 more

But I’m not sure what to do with this (or why it’s even crashing in the first place)…