Nicht übereinstimmende Signatur des Sicherungsagenten während der Wiederherstellung
-
28-10-2019 - |
Frage
[Bearbeiten] Nach all den Informationen, die ich hinzugefügt habe, ist es wahrscheinlich, dass dies darauf zurückzuführen ist, dass sich meine App als neue App unter derselben UID registriert, obwohl sie in derselben apk dieselbe Version erstellt hat. Alle Ideen, wo mit der Reparatur begonnen werden kann, sind sehr willkommen.
Ich habe mithilfe der Helper-Klasse einen BackupAgent
in meiner App implementiert, da ich nur eine Datei mit freigegebenen Einstellungen sichern möchte.
Es scheint, dass die Sicherungsaufrufe in Ordnung sind. Wenn ich einen 'bmgr run' durchführe, nachdem die App einen dataChanged()
erstellt hat, wird in logcat Folgendes angezeigt:
06-17 09:58:41.618: DEBUG/PerformBackupThread(303): starting agent for backup of BackupRequest{app=ApplicationInfo{40d66190 uk.co.randomicon.rstb} full=false}
06-17 09:58:41.618: DEBUG/BackupManagerService(303): awaiting agent for ApplicationInfo{40d66190 uk.co.randomicon.rstb}
06-17 09:58:41.628: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' android.app.backup.SharedPreferencesBackupHelper@408864e8
06-17 09:58:41.628: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb agent=android.os.BinderProxy@40b2f328
06-17 09:58:41.638: DEBUG/PerformBackupThread(303): starting agent for backup of BackupRequest{app=ApplicationInfo{40d75cc0 uk.co.randomicon.rstb} full=false}
06-17 09:58:41.648: DEBUG/BackupManagerService(303): awaiting agent for ApplicationInfo{40d75cc0 uk.co.randomicon.rstb}
06-17 09:58:41.648: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' android.app.backup.SharedPreferencesBackupHelper@40708660
06-17 09:58:41.648: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb agent=android.os.BinderProxy@40b08e50
06-17 09:58:41.668: DEBUG/PerformBackupThread(303): starting agent for backup of BackupRequest{app=ApplicationInfo{40d6b420 uk.co.randomicon.rstb} full=false}
06-17 09:58:41.668: DEBUG/BackupManagerService(303): awaiting agent for ApplicationInfo{40d6b420 uk.co.randomicon.rstb}
06-17 09:58:41.668: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' android.app.backup.SharedPreferencesBackupHelper@40789930
06-17 09:58:41.668: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb agent=android.os.BinderProxy@40ae3b70
06-17 09:58:41.688: DEBUG/PerformBackupThread(303): starting agent for backup of BackupRequest{app=ApplicationInfo{40d92b38 uk.co.randomicon.rstb} full=false}
06-17 09:58:41.688: DEBUG/BackupManagerService(303): awaiting agent for ApplicationInfo{40d92b38 uk.co.randomicon.rstb}
06-17 09:58:41.688: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' android.app.backup.SharedPreferencesBackupHelper@408521c0
06-17 09:58:41.688: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb agent=android.os.BinderProxy@40acfd20
06-17 09:58:41.708: DEBUG/PerformBackupThread(303): starting agent for backup of BackupRequest{app=ApplicationInfo{40dd4c50 uk.co.randomicon.rstb} full=false}
06-17 09:58:41.708: DEBUG/BackupManagerService(303): awaiting agent for ApplicationInfo{40dd4c50 uk.co.randomicon.rstb}
06-17 09:58:41.708: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb agent=android.os.BinderProxy@40ababb0
06-17 09:58:41.718: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' android.app.backup.SharedPreferencesBackupHelper@40887ee0
06-17 09:58:41.728: DEBUG/PerformBackupThread(303): starting agent for backup of BackupRequest{app=ApplicationInfo{40d725b0 uk.co.randomicon.rstb} full=false}
06-17 09:58:41.728: DEBUG/BackupManagerService(303): awaiting agent for ApplicationInfo{40d725b0 uk.co.randomicon.rstb}
06-17 09:58:41.728: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb agent=android.os.BinderProxy@40aaa058
06-17 09:58:41.728: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' android.app.backup.SharedPreferencesBackupHelper@40835bd0
06-17 09:58:41.738: DEBUG/PerformBackupThread(303): starting agent for backup of BackupRequest{app=ApplicationInfo{40da2cd8 uk.co.randomicon.rstb} full=false}
06-17 09:58:41.748: DEBUG/BackupManagerService(303): awaiting agent for ApplicationInfo{40da2cd8 uk.co.randomicon.rstb}
06-17 09:58:41.748: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' android.app.backup.SharedPreferencesBackupHelper@408769b8
06-17 09:58:41.748: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb agent=android.os.BinderProxy@40a99a20
06-17 09:58:41.768: DEBUG/PerformBackupThread(303): starting agent for backup of BackupRequest{app=ApplicationInfo{40d451b8 uk.co.randomicon.rstb} full=false}
06-17 09:58:41.768: DEBUG/BackupManagerService(303): awaiting agent for ApplicationInfo{40d451b8 uk.co.randomicon.rstb}
06-17 09:58:41.768: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' android.app.backup.SharedPreferencesBackupHelper@40708440
06-17 09:58:41.768: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb agent=android.os.BinderProxy@40a89c58
Selbst wenn dies sofort ausgeführt wird, führt das Ausführen einer Aktion "bmgr restore" in logcat zu folgenden Ergebnissen:
06-17 09:38:36.002: DEBUG/BackupManagerService(303): MSG_RUN_RESTORE observer=android.app.backup.IRestoreObserver$Stub$Proxy@40c0ec50
06-17 09:38:36.682: WARN/BackupManagerService(303): Signature mismatch restoring uk.co.randomicon.rstb
Die Konsolenausgabe für die Wiederherstellung lautet:
restoreStarting: 2 packages
onUpdate: 0 = uk.co.randomicon.rstb
restoreFinished: 0
done
Irgendwelche Ideen? Es ist offensichtlich die gleiche Version und Signatur, da ich nicht deinstalliert / gelöscht / irgendetwas habe. Ich bin alle für den Sicherungsdienst angemeldet und der Schlüssel ist korrekt eingegeben usw.
edit: Es scheint, dass es als mit Debug-Schlüssel signierter Build gut funktioniert, aber auf einem exportierten, verschleierten, mit Zipalignierten Release-Schlüssel signierten apk schlägt dies fehl. Das wäre für mich sinnvoll, wenn ich versuchen würde, Daten aus dem Debug-Build in den Release-Build wiederherzustellen, aber das bin ich nicht.
edit2: Habe versucht, die Hilfsnamen usw. zu ändern, und ich bekomme immer noch das gleiche Verhalten. Apk mit Debug-Schlüssel signiert funktioniert einwandfrei, kann sichern, deinstallieren, neu installieren und wird automatisch wiederhergestellt. Release Key signierte apk tut dies jedes Mal. Ich bin immer noch ein wenig besorgt über die wiederholten Backup-Aufrufe mit unterschiedlichen @ -Nummern trotz nur eines internen Funktionsaufrufs. Das Debug-Programm macht dies jedoch auch, so dass es nicht ganz so sein kann.
Die Ausgabe der dumpsys-Sicherung zeigt mein Paket viermal ...
Backup Manager is enabled / provisioned / not pending init
Auto-restore is enabled
Last backup pass: 1308330167956 (now = 1308330359754)
next scheduled: 1308333767956
Available transports:
* com.google.android.backup/.BackupTransportService
com.android.inputmethod.latin - 112 state bytes
com.android.browser - 20 state bytes
com.android.providers.userdictionary - 8 state bytes
com.android.vending - 0 state bytes
android - 172 state bytes
com.zegoggles.smssync - 100 state bytes
com.smartandroidapps.audiowidgetpro - 416 state bytes
org.connectbot - 260 state bytes
net.cachapa.libra - 96 state bytes
com.icenta.sudoku.ui - 52 state bytes
com.android.providers.settings - 36 state bytes
@pm@ - 378 state bytes
uk.co.randomicon.rstb - 164 state bytes
android/com.android.internal.backup.LocalTransport
Pending init: 0
Participants:
uid: 1000
com.android.providers.settings
android
uid: 10000
com.android.providers.userdictionary
uid: 10002
com.android.browser
uid: 10022
com.android.inputmethod.latin
uid: 10045
com.android.vending
uid: 10050
uk.co.randomicon.rstb
uk.co.randomicon.rstb
uk.co.randomicon.rstb
uk.co.randomicon.rstb
uid: 10058
com.zegoggles.smssync
uid: 10063
org.connectbot
uid: 10084
net.cachapa.libra
uid: 10094
com.smartandroidapps.audiowidgetpro
uid: 10111
com.icenta.sudoku.ui
Ancestral packages: 8
com.android.browser
com.zegoggles.smssync
org.connectbot
android
com.android.vending
com.android.providers.userdictionary
com.android.inputmethod.latin
com.android.providers.settings
Ever backed up: 12
org.connectbot
com.zegoggles.smssync
com.android.browser
com.icenta.sudoku.ui
com.smartandroidapps.audiowidgetpro
com.android.vending
android
net.cachapa.libra
uk.co.randomicon.rstb
com.android.providers.userdictionary
com.android.inputmethod.latin
com.android.providers.settings
Pending backup: 0
edit3: Durch die konsequente Deinstallation und Neuinstallation werden immer wieder neue Instanzen meiner App unter derselben UID hinzugefügt. Es ist der gleiche Build der gleichen App von der gleichen apk, aber es macht immer wieder neue Instanzen von sich selbst in dieser Liste. Ist das richtig? Nachdem ich mir die BackupManager
-Quelle angesehen habe, scheint es (wenn ich sie richtig gelesen habe), dass sich der Manager im Debug-Modus nicht wirklich um Signaturen kümmert, weshalb er dann wahrscheinlich in Ordnung läuft.
Lösung 3
Es hat sich gerade selbst repariert.Alle mehreren Instanzen sind vorhanden, aber es funktioniert jetzt.Habe plötzlich aufgehört, mich über nicht übereinstimmende Signaturen zu beschweren.
Wenn Sie sicher sind, dass Sie es richtig gemacht haben, warten Sie einfach: P
Andere Tipps
Backup aus Einstellungen deaktivieren -> Datenschutz, alle Backups werden gelöscht.Aktivieren Sie es dann und alles wird wieder funktionieren.
Ich hatte das gleiche Problem und bmgr wipe <transport> <package>
hat es nicht gelöst.
Was mir geholfen hat, war das Umschalten der Sicherung von adb shell
:
bmgr enable false
bmgr enable true
bmgr run
Übrigens.Während ich "normaler" Benutzer war, schlug dies mit folgendem Fehler fehl:
java.lang.SecurityException: uid 2000 does not have android.permission.UPDATE_APP_OPS_STATS.
Mit su
und übergebenen Operationen zum Superuser gewechselt.