# adb pull /system/app/Vending.apk /tmp/
# apktool d /tmp/Vending.apk /tmp/Vending
# apktool b /tmp/Vending
# keytool -genkey -v -keystore /tmp/Unknown.keystore -alias Unknown
-keyalg RSA -keysize 2048 -validity 10000
< interact with the keytool in the obvious way >
# jarsigner -verbose -keystore /tmp/Unknown.keystore
/tmp/Vending/dist/Vending.apk Unknown
< enter password for the key you chose above >
# zipalign 4 /tmp/Vending/dist/Vending.apk /tmp/Vending/Vending.apk
# adb shell mount -o remount,rw `adb shell mount | grep system | cut
-f 1 -d' '` /system
# adb push /tmp/Vending/Vending.apk /system/app
# adb shell mount -o remount,ro `adb shell mount | grep system | cut
-f 1 -d' '` /system
# adb logcat -v threadtime *:V
< try to launch market on the phone/emulator >
< observe exception reported earlier >
incidentally, the Vending.apk version for which this fails is 1.82
will try with different system apks next to see if I get more/different errors
01-27 13:05:20.560 291 291 E AndroidRuntime: FATAL EXCEPTION: main
01-27 13:05:20.560 291 291 E AndroidRuntime:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.android.vending/com.android.vending.AssetBrowserActivity}:
android.view.InflateException: You must specifiy a valid layout
reference. The layout ID @layout/asset_list_no_loading is not valid.
I am however happy to report that with apktool 1.3.1 this _doesn't_ happen. \o/
I am not ruling out to have made a mistake earlier.
One issue remains however. The reassembled apk doesn't appear to have
be granted the same permissions as the original (and so is unusable).
Any ideas on that? Is that a problem with apktool or might that be
simply an apk authentication issue (because I signed it myself)?
I will post a more specific debug message on that one later.
> simply an apk authentication issue (because I signed it myself)?
Yes. Resign the system to match the key