Hatena::ブログ(Diary)

linuzau’s diary このページをアンテナに追加 RSSフィード

2009-01-12

HTC Dream(aka T-Mobile G1, Android Dev Phone 1)の標準アプリをバックアップしてみる

HTC Dream(いわゆるAndroid Dev Phone 1)のファームを書き換える前に標準アプリをバックアップしてみる。


adbでログイン

USB接続してPCからadbでログインする。

adb shell
$ pwd
pwd
/

意外とあっさり入れた。コマンドはいちいちエコーバックするらしい。以降の表記はエコーバックを省略。


何があるか

見てみる。

$ ls -l /system/app
-rw-r--r-- root     root       211385 2008-11-04 07:24 gtalkservice.apk
-rw-r--r-- root     root       212284 2008-11-04 07:24 YouTube.apk
-rw-r--r-- root     root       348368 2008-11-04 06:05 Vending.apk
-rw-r--r-- root     root       282341 2008-11-04 07:24 Talk.apk
-rw-r--r-- root     root       389877 2008-11-04 07:24 Maps.apk
-rw-r--r-- root     root        67854 2008-11-04 07:23 GoogleApps.apk
-rw-r--r-- root     root        16422 2008-11-04 06:05 GDataFeedsProvider.apk
-rw-r--r-- root     root        90922 2008-11-04 06:05 CalendarProvider.apk
-rw-r--r-- root     root       213796 2008-11-04 06:05 Calendar.apk
-rw-r--r-- root     root      1055091 2008-11-04 06:05 Browser.apk
-rw-r--r-- root     root        10510 2008-11-04 06:05 Updater.apk
-rw-r--r-- root     root        93791 2008-11-04 07:23 Street.apk
-rw-r--r-- root     root        38223 2008-11-04 06:05 TelephonyProvider.apk
-rw-r--r-- root     root        44471 2008-11-04 06:05 SoundRecorder.apk
-rw-r--r-- root     root       260241 2008-11-04 06:05 SetupWizard.apk
-rw-r--r-- root     root        19696 2008-11-04 06:05 Sync.apk
-rw-r--r-- root     root        16438 2008-11-04 06:05 SettingsProvider.apk
-rw-r--r-- root     root       756506 2008-11-04 06:05 Settings.apk
-rw-r--r-- root     root       645338 2008-11-04 06:05 Phone.apk
-rw-r--r-- root     root        40247 2008-11-04 06:05 PackageInstaller.apk
-rw-r--r-- root     root       310548 2008-11-04 06:05 Music.apk
-rw-r--r-- root     root       568911 2008-11-04 06:05 Mms.apk
-rw-r--r-- root     root        33634 2008-11-04 06:05 MediaProvider.apk
-rw-r--r-- root     root      1381982 2008-11-04 06:05 Launcher.apk
-rw-r--r-- root     root        27066 2008-11-04 06:05 ImProvider.apk
-rw-r--r-- root     root        12288 2008-11-04 06:05 GoogleSearch.apk
-rw-r--r-- root     root         5357 2008-11-04 06:05 HTMLViewer.apk
-rw-r--r-- root     root        86922 2008-11-04 07:23 GmailProvider.apk
-rw-r--r-- root     root       322700 2008-11-04 07:23 Gmail.apk
-rw-r--r-- root     root       127962 2008-11-04 06:05 FieldTest.apk
-rw-r--r-- root     root       413942 2008-11-04 06:05 Email.apk
-rw-r--r-- root     root        10475 2008-11-04 06:05 DrmProvider.apk
-rw-r--r-- root     root        40745 2008-11-04 06:05 DownloadProvider.apk
-rw-r--r-- root     root        54675 2008-11-04 06:05 ContactsProvider.apk
-rw-r--r-- root     root       258215 2008-11-04 06:05 Contacts.apk
-rw-r--r-- root     root       350363 2008-11-04 06:05 Camera.apk
-rw-r--r-- root     root        82629 2008-11-04 06:05 Calculator.apk
-rw-r--r-- root     root         4929 2008-11-04 06:05 Bugreport.apk
-rw-r--r-- root     root       160822 2008-11-04 06:05 AlarmClock.apk

39個ある。


バックアップ (失敗1)

どれをバックアップしたらよいか分からないので全部SDカードにコピーしてみる。

$ mkdir /sdcard/dreamapps
$ cd /system/app
$ for i in *; do
> cp $i /sdcard/dreamapps
> done
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied
cp: permission denied

rootじゃないといけないのか。


バックアップ (失敗2)

rootになってから。

$ su
# for i in *; do
> cp $i /sdcard/dreamapps
> done
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found
cp: not found

cpがないだと。


バックアップ (やっとできた)

# for i in *; do
> cat $i > /sdcard/dreamapps/$i
> done
# ls -l /sdcard/dreamapps
----rw-rw- system   system     160822 2009-01-12 09:44 AlarmClock.apk
----rw-rw- system   system    1055091 2009-01-12 09:44 Browser.apk
----rw-rw- system   system       4929 2009-01-12 09:44 Bugreport.apk
----rw-rw- system   system      82629 2009-01-12 09:44 Calculator.apk
----rw-rw- system   system     213796 2009-01-12 09:44 Calendar.apk
----rw-rw- system   system      90922 2009-01-12 09:44 CalendarProvider.apk
----rw-rw- system   system     350363 2009-01-12 09:44 Camera.apk
----rw-rw- system   system     258215 2009-01-12 09:44 Contacts.apk
----rw-rw- system   system      54675 2009-01-12 09:44 ContactsProvider.apk
----rw-rw- system   system      40745 2009-01-12 09:44 DownloadProvider.apk
----rw-rw- system   system      10475 2009-01-12 09:44 DrmProvider.apk
----rw-rw- system   system     413942 2009-01-12 09:44 Email.apk
----rw-rw- system   system     127962 2009-01-12 09:44 FieldTest.apk
----rw-rw- system   system      16422 2009-01-12 09:44 GDataFeedsProvider.apk
----rw-rw- system   system     322700 2009-01-12 09:44 Gmail.apk
----rw-rw- system   system      86922 2009-01-12 09:44 GmailProvider.apk
----rw-rw- system   system      67854 2009-01-12 09:44 GoogleApps.apk
----rw-rw- system   system      12288 2009-01-12 09:44 GoogleSearch.apk
----rw-rw- system   system       5357 2009-01-12 09:44 HTMLViewer.apk
----rw-rw- system   system      27066 2009-01-12 09:44 ImProvider.apk
----rw-rw- system   system    1381982 2009-01-12 09:44 Launcher.apk
----rw-rw- system   system     389877 2009-01-12 09:44 Maps.apk
----rw-rw- system   system      33634 2009-01-12 09:44 MediaProvider.apk
----rw-rw- system   system     568911 2009-01-12 09:44 Mms.apk
----rw-rw- system   system     310548 2009-01-12 09:44 Music.apk
----rw-rw- system   system      40247 2009-01-12 09:44 PackageInstaller.apk
----rw-rw- system   system     645338 2009-01-12 09:44 Phone.apk
----rw-rw- system   system     756506 2009-01-12 09:44 Settings.apk
----rw-rw- system   system      16438 2009-01-12 09:44 SettingsProvider.apk
----rw-rw- system   system     260241 2009-01-12 09:44 SetupWizard.apk
----rw-rw- system   system      44471 2009-01-12 09:44 SoundRecorder.apk
----rw-rw- system   system      93791 2009-01-12 09:44 Street.apk
----rw-rw- system   system      19696 2009-01-12 09:44 Sync.apk
----rw-rw- system   system     282341 2009-01-12 09:44 Talk.apk
----rw-rw- system   system      38223 2009-01-12 09:44 TelephonyProvider.apk
----rw-rw- system   system      10510 2009-01-12 09:44 Updater.apk
----rw-rw- system   system     348368 2009-01-12 09:44 Vending.apk
----rw-rw- system   system     212284 2009-01-12 09:44 YouTube.apk
----rw-rw- system   system     211385 2009-01-12 09:44 gtalkservice.apk

やっとバックアップできた。


正攻法

adbでPCに直接バックアップできるらしい。

adb pull /system/app dreamapps
pull: building file list...
pull: /system/app/AlarmClock.apk -> dreamapps/AlarmClock.apk
pull: /system/app/Bugreport.apk -> dreamapps/Bugreport.apk
pull: /system/app/Calculator.apk -> dreamapps/Calculator.apk
pull: /system/app/Camera.apk -> dreamapps/Camera.apk
pull: /system/app/Contacts.apk -> dreamapps/Contacts.apk
pull: /system/app/ContactsProvider.apk -> dreamapps/ContactsProvider.apk
pull: /system/app/DownloadProvider.apk -> dreamapps/DownloadProvider.apk
pull: /system/app/DrmProvider.apk -> dreamapps/DrmProvider.apk
pull: /system/app/Email.apk -> dreamapps/Email.apk
pull: /system/app/FieldTest.apk -> dreamapps/FieldTest.apk
pull: /system/app/Gmail.apk -> dreamapps/Gmail.apk
pull: /system/app/GmailProvider.apk -> dreamapps/GmailProvider.apk
pull: /system/app/HTMLViewer.apk -> dreamapps/HTMLViewer.apk
pull: /system/app/GoogleSearch.apk -> dreamapps/GoogleSearch.apk
pull: /system/app/ImProvider.apk -> dreamapps/ImProvider.apk
pull: /system/app/Launcher.apk -> dreamapps/Launcher.apk
pull: /system/app/MediaProvider.apk -> dreamapps/MediaProvider.apk
pull: /system/app/Mms.apk -> dreamapps/Mms.apk
pull: /system/app/Music.apk -> dreamapps/Music.apk
pull: /system/app/PackageInstaller.apk -> dreamapps/PackageInstaller.apk
pull: /system/app/Phone.apk -> dreamapps/Phone.apk
pull: /system/app/Settings.apk -> dreamapps/Settings.apk
pull: /system/app/SettingsProvider.apk -> dreamapps/SettingsProvider.apk
pull: /system/app/Sync.apk -> dreamapps/Sync.apk
pull: /system/app/SetupWizard.apk -> dreamapps/SetupWizard.apk
pull: /system/app/SoundRecorder.apk -> dreamapps/SoundRecorder.apk
pull: /system/app/TelephonyProvider.apk -> dreamapps/TelephonyProvider.apk
pull: /system/app/Street.apk -> dreamapps/Street.apk
pull: /system/app/Updater.apk -> dreamapps/Updater.apk
pull: /system/app/Browser.apk -> dreamapps/Browser.apk
pull: /system/app/Calendar.apk -> dreamapps/Calendar.apk
pull: /system/app/CalendarProvider.apk -> dreamapps/CalendarProvider.apk
pull: /system/app/GDataFeedsProvider.apk -> dreamapps/GDataFeedsProvider.apk
pull: /system/app/GoogleApps.apk -> dreamapps/GoogleApps.apk
pull: /system/app/Maps.apk -> dreamapps/Maps.apk
pull: /system/app/Talk.apk -> dreamapps/Talk.apk
pull: /system/app/Vending.apk -> dreamapps/Vending.apk
pull: /system/app/YouTube.apk -> dreamapps/YouTube.apk
pull: /system/app/gtalkservice.apk -> dreamapps/gtalkservice.apk
39 files pulled. 0 files skipped.
1067 KB/s (0 bytes in 9067966.008s)

まったく簡単。

投稿したコメントは管理者が承認するまで公開されません。

スパム対策のためのダミーです。もし見えても何も入力しないでください
ゲスト


画像認証

トラックバック - http://d.hatena.ne.jp/linuzau/20090112/1231731230