[編輯]從我添加的所有信息看來,這可能是由於我的應用在相同的UID下注冊了自己作爲一個新的應用, 。任何想法從哪裏開始固定,將不勝感激恢復過程中備份代理簽名不匹配
我一直在使用輔助類,因爲我只是想備份共享偏好文件中實現在應用的過程中BackupAgent
。
它似乎在做它的備用電話罰款。如果我做了「BMGR運行」的應用做了dataChanged()
後,我得到的logcat如下:
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' [email protected]
06-17 09:58:41.628: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb [email protected]
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' [email protected]
06-17 09:58:41.648: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb [email protected]
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' [email protected]
06-17 09:58:41.668: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb [email protected]
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' [email protected]
06-17 09:58:41.688: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb [email protected]
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 [email protected]
06-17 09:58:41.718: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' [email protected]
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 [email protected]
06-17 09:58:41.728: DEBUG/BackupHelperDispatcher(6720): handling existing helper 'rstb_prefs' [email protected]
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' [email protected]
06-17 09:58:41.748: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb [email protected]
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' [email protected]
06-17 09:58:41.768: DEBUG/BackupManagerService(303): agentConnected pkg=uk.co.randomicon.rstb [email protected]
然而,即使馬上做,做一個在logcat的以下「BMGR恢復」操作的結果:
06-17 09:38:36.002: DEBUG/BackupManagerService(303): MSG_RUN_RESTORE [email protected]
06-17 09:38:36.682: WARN/BackupManagerService(303): Signature mismatch restoring uk.co.randomicon.rstb
爲恢復控制檯輸出爲:
restoreStarting: 2 packages
onUpdate: 0 = uk.co.randomicon.rstb
restoreFinished: 0
done
任何想法?這顯然是相同的版本和簽名,因爲我還沒有卸載/擦除/任何東西。我都註冊了備份服務,並且密鑰是正確的,等等。
編輯:它看起來可以作爲調試密鑰簽署版本正常工作,但在導出的,模糊處理的zipaligned版本上以這種方式失敗密鑰簽名的apk。如果我試圖從調試版本恢復數據到發佈版本中,那對我來說是有意義的,但我沒有。
edit2:曾嘗試更改助手名稱等,我仍然得到相同的行爲。調試密鑰簽名apk完美工作,可以備份,卸載,重新安裝,並自動恢復。發行密鑰簽名的apk每次都會這樣做。儘管只有一個內部函數調用,但仍然有點擔心使用不同@號碼的重複備份呼叫。但是,調試人員也這樣做,所以它不能完全是這樣。 dumpsys備份
輸出顯示我的包四倍...
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
@[email protected] - 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:卸載並重新安裝始終保持相同的UID下將我的應用程序的新實例。這是來自同一個apk的同一個應用程序的構建,但它只是在該列表中不斷創建自己的新實例。這是正確的行爲嗎?查看了BackupManager
源代碼後,似乎(如果我正確地讀了它),在調試模式下,管理器並不真正關心簽名,這可能是爲什麼它可以正常運行。
你等了多久? :-) – Blundell 2012-08-02 14:01:43
+1爲課程學習:)應該爲抱怨老闆的開發者製作一件T恤。 :) – vmatyi 2012-12-11 17:59:48
@Blundell我相信我在16日晚上設置了它,整個晚上都試圖修復它,在早上貼在這裏,當我坐下來再試一次,那天晚上就沒事了。所以在12到24小時之間。 – Zulaxia 2012-12-23 21:46:31