Related
Hello,
I have found why I couldn't change HTCLaucher.apk or why the Dude's beta4 has install issue: we MUST resign all apk INCLUDE those in framework! I did it and now I have an auto rotate HTCLaucher.apk because I can use testsign.jar to resign it.
I hope it will help.
hello,
just to keep thread up.
You can just replace the apk's without resigning.
nono2lozere said:
Hello,
I have found why I couldn't change HTCLaucher.apk or why the Dude's beta4 has install issue: we MUST resign all apk INCLUDE those in framework! I did it and now I have an auto rotate HTCLaucher.apk because I can use testsign.jar to resign it.
I hope it will help.
Click to expand...
Click to collapse
Because of framework ?
I use Soulife Roger, and it's ok.
I have a little problem with all rogers rom: I can't replace HTCLauncher.apk by other Launcher.apk from TheDude 1.3RC1 or from hero theme. I have done this on haykuro 6.0H and it has worked. I tried to remove HTCLauncher.apk from /system/app and push the new Launcher.apk in it but I have this errors on logcat:
before resigning:
Code:
D/PackageParser( 79): Scanning package: /system/app/Launcher.apk
I/PackageManager( 79): /system/app/Launcher.apk changed; collecting certs
W/PackageParser( 79): Exception reading /system/app/Launcher.apk
W/PackageParser( 79): java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest for AndroidManifest.xml in /system/app/Launcher.apk
W/PackageParser( 79): at java.util.jar.JarVerifier.verifySignatures(JarVerifier.java:398)
W/PackageParser( 79): at java.util.jar.JarFile$JarFileInputStream.read(JarFile.java:124)
W/PackageParser( 79): at android.content.pm.PackageParser.loadCertificates(PackageParser.java:213)
W/PackageParser( 79): at android.content.pm.PackageParser.collectCertificates(PackageParser.java:346)
W/PackageParser( 79): at com.android.server.PackageManagerService.collectCertificatesLI(PackageManagerService.java:1734)
W/PackageParser( 79): at com.android.server.PackageManagerService.scanPackageLI(PackageManagerService.java:1783)
W/PackageParser( 79): at com.android.server.PackageManagerService.access$1200(PackageManagerService.java:104)
W/PackageParser( 79): at com.android.server.PackageManagerService$AppDirObserver.onEvent(PackageManagerService.java:3187)
W/PackageParser( 79): at android.os.FileObserver$ObserverThread.onEvent(FileObserver.java:91)
W/PackageParser( 79): at android.os.FileObserver$ObserverThread.observe(Native Method)
W/PackageParser( 79): at android.os.FileObserver$ObserverThread.run(FileObserver.java:56)
I/PackageManager( 79): Failed verifying certificates for package:com.android.launcher
after resigning:
Code:
D/PackageParser( 79): Scanning package: /system/app/Launcher.apk
I/PackageManager( 79): /system/app/Launcher.apk changed; collecting certs
D/dalvikvm( 79): GC freed 8212 objects / 532656 bytes in 203ms
D/PackageManager( 79): Scanning package com.android.launcher
D/PackageManager( 79): Shared UserID android.uid.shared (uid=10026): packages=[PackageSetting{437583a0 com.htc.CustomizationSetup/10026}, PackageSetting{4379da08 com.android.providers.im/10026}, PackageSetting{437466b8 com.android.contacts/10026}, PackageSetting{4372c9f8 com.htc.provider.CustomizationSettings/10026}, PackageSetting{437571a8 com.android.googlesearch/10026}, PackageSetting{437568c8 com.android.launcher/10026}, PackageSetting{43755d98 com.android.providers.contacts/10026}]
W/PackageManager( 79): Package com.android.launcher codePath changed from /system/app/HTCLauncher.apk to /system/app/Launcher.apk; replacing with new
E/PackageManager( 79): Package com.android.launcher has no signatures that match those in shared user android.uid.shared; ignoring!
after resigning apks in framework I can install the resigned one!
I think it's because when system boots the package installer scan framework directory before app directory and register the framework signature for android.uid.shared before scaning app. If framework has been signed with other key (release key I think) that one was used for Launcher.apk the system won't install it!
sorry for my bad english!
excuse me, but ... if i m to swap some files in / out of a signed rom,
do i have to resign everything? is resigning the update.zip good enoguh
side question: how do i specify a wallpaper for a rom?
kiddyfurby said:
excuse me, but ... if i m to swap some files in / out of a signed rom,
do i have to resign everything? is resigning the update.zip good enoguh
side question: how do i specify a wallpaper for a rom?
Click to expand...
Click to collapse
Update.zip is good enough.
For the wallpaper question, check the themes forum and search....you will find
Happy hunting
nono2lozere said:
I have a little problem with all rogers rom: I can't replace HTCLauncher.apk by other Launcher.apk from TheDude 1.3RC1 or from hero theme. I have done this on haykuro 6.0H and it has worked. I tried to remove HTCLauncher.apk from /system/app and push the new Launcher.apk in it but I have this errors on logcat:
Click to expand...
Click to collapse
Hi,
Have you find a solution for that ? I have the same problem...
If i'm not resign the apk, i get an error like "no signatures that match those in shared user android.uid.shared" for those packages i'm trying to install, and if i'm resign all the apk, i have the same error but for all..
I'm want to find/replace the root certificate, and replace it if possible, but i don't know how..
plus, i've found some apks and jars dont like to be signed with test-keys (all framework jars/apks and launcher.apk). It usually breaks things. Like mikey said, usually just the update zip is fine
I was curious if anyone has found a solution to re-signing all the apk's on the Rogers builds. Soulife, Enomther & I have been looking at this so we could include irrenhaus' Advanced Launcher v17 as a replacement for the stock HTCLauncher. If you have your phone setup & running, and flash the launcher as an update afterwards, it'll run fine. But as soon as you wipe or try to start clean, the phone will go into boot loops. If you resign all the apk's in /system/app & /system/framework, you can included the Launcher as a replacement for HTCLauncher and it will flash/boot w/ no problems until you want to sign into google or access the market. You can't. Same thing happens when you try to update the stock HTCLauncher when editing the AndroidManifest.xml file to enable auto-rotation. Re-sign the apk & it'll work fine till you wipe. Any suggestions would be appreciated. Thanks & take care.
There are (leaked) OTA updates for Samsung devices floating around.
These files have the .bin extension, but can different types: RBMT multidelta and .zip archives.
The information in this thread are related to RBMT multidelta (RedBend update agent patches).
Using the following steps, the RBMT file is split into delta.* files, ready to be flashed. The only requirement is to have a big enough /cache partition. Else you could play with symlinking the /cache/fota/ folder.
adb push TheNameOfTheOta.bin /sdcard/ota.bin
adb install FOTA.apk
adb shell
su
chmod -R 0777 /cache
Run FOTA application from app drawer
Press the button
Wait a few minutes (or check logcat to see when it's done)
Check the contents of /cache/fota, it should contain *.delta files and fota.status
In the adb root shell prompt enter:
LTE devices: reboot arm11_fota
Tablets: reboot fota
Phones:
echo -n "--install_fota" > /cache/recovery/command
reboot recovery
Wait for OTA update (percentage on screen)
Notes:
You must have the corresponding base ROM installed for the OTA (the required version can be read at the end of the .bin file)
Nadavi reported that the update fails at updating the bootloader. As a workaround, delete delta.Sbl from the fota folder
Arlicc reported that you must have the stock recovery before flashing back to stock with Odin. So flash the package twice, or the stock recovery first then the package.
Donations are always welcome PayPal
PS: Looking for P7300 ICS? -> http://forum.xda-developers.com/showthread.php?t=1893456
The main idea behind the technique consists in wrapping up a JNI interface for libdprw.so. This file is included in syncmldm.apk. Then we deodex syncmldm.odex and figure out the calls to the JNI.
cschmitt's info about the FOTA procedure pointed out some missing pieces.
There's also a working version for Galaxy Note with Gingerbread: Application => Procedure
I would prefer if someone would try the app from the first post and symlink /cache/fota/ to /data/fota/ to see if it works and generalize the problem.
For other devices, I need the dump of /system/app/syncmldm.apk, /system/app/syncmldm.odex and /system/framework/ (whole folder). I'll help as my time permits.
Changelog:
Check existence of /sdcard/ota.bin
Check if it's an RBMT multidelta
UI cosmetics
Todo:
Gather information about other devices
Provide a generalized application
Make the app fully automatic
Hi,
Great to see a truly knowledgable person get into this.
I've only come across a thread that explains how to capture an update .bin file. The good part is that it deals with exactly the same fotaclient process and the same /data/data folders as explained in the skyrocket thread.
This is what I found.
If not anything else it gives an idea about the address of the update servers and where the .bin files are downloaded from.
I bet that the SQlite database exploration will turn up a result as to where the.bin file is stored to be flashed thereafter.
Or what if the wssdmdatabase.db can be edited so that it will have the Software Update process start doing its thing with the .bin.
There is nothing revealing actually within fotaclient.apk.
All very simplistic approaches on my part, bu this is as far/near as my knowledge goes.
I have a very vague idea of the complex stuff you are talking about, but as far as I can understand, you wish to use a JNI wrapper to manually execute the code to split the .bin file.
Isn't there a way to just trigger the Software Update to do its thing with the .bin file in the right place instead?
Probably not the key to everything, but (at least to me) an understandable insight into redbend FOTA and delta files.
http://www.visionmobile.com/rsc/researchreports/Firmware_OTA_research_paper.pdf
Due to health problems, I didn't have time for this matter.
Started again, wrote a JNI Wrapper that loads libdprw.so (that contains the split functions). I have a strange problem when loading it (java.lang.UnsatisfiedLinkError: unknown failure), trying to figure it out...
EDIT: Library loaded, trying to communicate with it's functions...
EDIT2: The package name is hardcoded in the lib, so I need to hex edit it... or grant root privileges to the app
EDIT3: su gets root for the app, but not for the lib
EDIT4: hexing partially works, we still need root for /cache partition
Code:
09-18 18:17:53.960: D/dalvikvm(3122): Trying to load lib /data/data/ro.tracid.fota/lib/libdprw.so 0x4076cee8
09-18 18:17:53.960: D/dalvikvm(3122): Added shared lib /data/data/ro.tracid.fota/lib/libdprw.so 0x4076cee8
09-18 18:17:53.960: I/jnifota.cpp(3122): JNI_OnLoad
09-18 18:17:53.960: I/jnifota.cpp(3122): FOTA_WriteFlag
09-18 18:17:53.960: I/dp.c(3122): call dp_set_flag
09-18 18:17:53.960: I/dp.c(3122): mkdir(/cache/fota/): ret=-1 errno=13
09-18 18:17:53.960: I/dp.c(3122): Open fail /cache/fota/fota.status
09-18 18:17:53.960: I/jnifota.cpp(3122): FOTA_DeltaWrite :
09-18 18:17:53.960: I/dp.c(3122): dp_write_fw_delta path : /sdcard/ota.bin
09-18 18:17:54.030: I/dp.c(3122): Open /sdcard/ota.bin
09-18 18:17:54.040: I/dp.c(3122): DP Version : DP_7_0
09-18 18:17:54.040: I/dp.c(3122): APFWDeltaSize(kernel): 4553496
09-18 18:17:54.040: I/dp.c(3122): APFSDeltaSize(platform): 252019202
09-18 18:17:54.040: I/dp.c(3122): APSBLDeltaSize(sbl): 0
09-18 18:17:54.040: I/dp.c(3122): APUADeltaSize(ua): 324664
09-18 18:17:54.040: I/dp.c(3122): BPFWDeltaSize(modem): 367644
09-18 18:17:54.040: I/dp.c(3122): BPSBLDeltaSize(hidden): 53529324
09-18 18:17:54.040: I/dp.c(3122): BPUADeltaSize(recovery): 5044224
09-18 18:17:54.040: I/dp.c(3122): CPFWDeltaSize(modem_3g): 0
09-18 18:17:54.040: I/dp.c(3122): CPSBLDeltaSize(modem_lte): 0
09-18 18:17:54.040: I/dp.c(3122): CPUADeltaSize(not used): 0
09-18 18:17:54.040: I/dp.c(3122): APFSTrgValDeltaSize(flex): 0
09-18 18:17:54.040: I/dp.c(3122): mkdir(/cache/fota/): ret=-1 errno=13
09-18 18:17:54.060: I/dp.c(3122): dp_split offset = 0x50, size = 0x457b18, path=/cache/fota/delta.zImage
09-18 18:17:54.250: I/dp.c(3122): dp_split path=/cache/fota/delta.zImage
09-18 18:17:54.260: I/dp.c(3122): Failed to open /cache/fota/delta.zImage: Permission denied
09-18 18:17:54.260: I/dp.c(3122): dp_split(kernel) failed with return value: -1
EDIT5: chmod 0777 /cache did the trick
Code:
[email protected]:/cache/fota $ ls -al
ls -al
-rw-r--r-- app_110 app_110 53529324 2012-09-18 18:22 delta.hidden
-rw-r--r-- app_110 app_110 367644 2012-09-18 18:22 delta.modem
-rw-r--r-- app_110 app_110 252019202 2012-09-18 18:21 delta.platform
-rw-r--r-- app_110 app_110 5044224 2012-09-18 18:22 delta.recovery
-rw-r--r-- app_110 app_110 324664 2012-09-18 18:22 delta.ua
-rw-r--r-- app_110 app_110 4553496 2012-09-18 18:21 delta.zImage
-rw-r--r-- app_110 app_110 36 2012-09-18 18:21 fota.status
Update in progress
First post from official ICS GTab 8.9
Sent from my GT-P7300 using xda app-developers app
:thumbup:
Wysyłane z mojego GT-P7300 za pomocą Tapatalk 2
tracid said:
First post from official ICS GTab 8.9
Click to expand...
Click to collapse
OMG I'm moved to tears. :good:
Anything working fine? I think we'd need some further tests for battery, 3G (is it working all over the world? we'll see), etc.. which languages are included?
Can anyone dump the system for me so that i can make a CWM Flashable zip
I'm already working on it, please be patient.
tracid, Can you please create an application to handle these .bin files.
from .bin to the parts inside. then we can use ODIN to write them or create update.zip.
Here is a sample one For the Galaxy Note: "http://www.hotfile.com/dl/171858907/a3bc9d2/GT-N7000_ILO_354458940.bin.html"
Nadavi, the application is semi-automatic. You need to chmod 0777 /cache before running it. Even if the app itself gets root permission granted, the library seems to run under the apps normal permission. Will try to fix and upload it these days.
HI,
i don't have the ota update on my phone.
i have the .bin file.
How to start?
Can you post the needed files?
instructions?
Nadav.
First post updated with instructions + application.
tracid said:
First post updated with instructions + application.
Click to expand...
Click to collapse
thanks it is time to flash ...
The ICS dump for P7300 has been posted here: http://forum.xda-developers.com/showthread.php?t=1893456
tracid said:
First post updated with instructions + application.
Click to expand...
Click to collapse
How to bypass the maximum folder size of the Cache Folder? I am stuck at that step, trying to extract an Galaxy S2 DBT update.
darth_mickrig said:
How to bypass the maximum folder size of the Cache Folder? I am stuck at that step, trying to extract an Galaxy S2 DBT update.
Click to expand...
Click to collapse
Send me your libdprw.so file. It's included syncmldm.apk/lib/
It is possible that your files are extracted somewhere else (maybe /sdcard)
tracid said:
Send me your libdprw.so file. It's included syncmldm.apk/lib/
It is possible that your files are extracted somewhere else (maybe /sdcard)
Click to expand...
Click to collapse
Here is the lib. Hope you can solve this problem.
Hello all! I have a nexus 5 which has been previously rooted -- likely, poorly-- and must return to a factory state before updating to the 4.4 in my notifications.
Upon further research, it appears as though I may be able to jump straight to 5.0
This is my first rooting/flashing experience. I'm fairly tech savvy, so naturally, I've read through a few step-by-steps and now assume that I can do this.
I'm looking at Google's nexus images and attempting to follow their step-by-step and am stuck at the point of flash-all ... I don't seem to have a bat file.
This is where I am stuck:
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
D:\Derrick\documents\Android\adt\sdk\platform-tools>dir
Volume in drive D is TB_Storage
Volume Serial Number is 14C9-3414
Directory of D:\Derrick\documents\Android\adt\sdk\platform-tools
11/13/2014 02:00 PM <DIR> .
11/13/2014 02:00 PM <DIR> ..
11/13/2014 01:21 PM 1,009,664 adb.exe
11/13/2014 01:21 PM 96,256 AdbWinApi.dll
11/13/2014 01:21 PM 60,928 AdbWinUsbApi.dll
11/13/2014 01:21 PM <DIR> api
11/13/2014 01:21 PM 73,728 dmtracedump.exe
11/13/2014 01:21 PM 338,944 etc1tool.exe
11/13/2014 01:21 PM 196,608 fastboot.exe
11/13/2014 01:06 PM 583,276,888 hammerhead-5.0.tgz
11/13/2014 01:21 PM 39,424 hprof-conv.exe
11/13/2014 01:21 PM 753,215 NOTICE.txt
11/13/2014 01:21 PM 16,517 source.properties
11/13/2014 01:21 PM 700,928 sqlite3.exe
11/13/2014 01:21 PM <DIR> systrace
11 File(s) 586,563,100 bytes
4 Dir(s) 116,558,458,880 bytes free
D:\Derrick\documents\Android\adt\sdk\platform-tools>adb reboot bootloader
D:\Derrick\documents\Android\adt\sdk\platform-tools>fastboot oem unlock
...
FAILED (remote: Already Unlocked)
finished. total time: -0.000s
D:\Derrick\documents\Android\adt\sdk\platform-tools>flash-all
'flash-all' is not recognized as an internal or external command,
operable program or batch file.
My nexus is waiting in fastboot-- I'm probably going to start over when I get a bit of guidance.
Thank you for your help ^-^
I did do some updates with the sdk manager
Installed are
[/]Tools>
>Android SDK tools r23.0.5
>Android SDK platform-tools r21
>Android SDK Build-tools r21.1.1 and r20
[X]Android 5.0A (API 21)
[/]Extras>
>Android Support Repository r8
>Android Support Library 21.0.1
>Google USB Driver r11
Just looking at the list, should I do the Google repository? How do I access the Flash-all bat that, from my understanding, will flash the hammerhead-5.0.tgz
Thank you again,
Salud!
questions go into the q&a section, not into the general section.
thank you-- moved
make-gapps-zip is an opensource project that allows you to create your own flashable GApps zip from existing firmware (e.g., Nexus factory images) on Linux/OS X/Windows. AFAIK there is only a Windows-only tool. Some other "devs" only publish GApps packages and are not transparent about the origin/methodology. For this reason, the project was started to document GApps files (Android >= 5.0) and create tooling for it.
The main tools that is part of this project are odex2apk.py and make-update-zip.py. Since these are Python scripts, these run on Linux, OS X and Windows. The only other dependency is Java 7 or newer.
odex2apk.py uses oat2dex.jar by Riddle Hsu. Given an OAT-optimized .odex file, it will add classes.dex to the APK file if missing. This process reproducible such that the resulting file contents are byte-for-byte identical given the same source files.
make-update-zip.py uses the above odex2apk.py script to create deodexed APK files, then creates a flashable .zip file that can be installed from recovery.
Links:
Project site: https://github.com/Lekensteyn/make-gapps-zip
GApps Documentation
Please report issues at https://github.com/Lekensteyn/make-gapps-zip/issues
Example invocation and output:
[[email protected] make-gapps-zip] $ ls -F /tmp/pfiles/
app/ bin/ build.prop etc/ fonts/ framework/ lib/ media/ priv-app/ recovery-from-boot.p usr/ vendor/ xbin/
[[email protected] make-gapps-zip] $ ./make-update-zip.py -o update.zip -c keys/testkey.x509.pem -k keys/testkey.pk8 -r /tmp/pfiles GoogleLoginService GoogleServicesFramework Phonesky PrebuiltGmsCore GoogleContactsSyncAdapter CalendarProvider -f lib/libjni_latinimegoogle.so
Code:
odex2apk: Processing boot directory, may take a minute...
odex2apk: Added /tmp/pfiles/priv-app/GoogleLoginService/arm/GoogleLoginService.dex to /tmp/pfiles/priv-app/GoogleLoginService/GoogleLoginService.apk as classes.dex
odex2apk: /tmp/pfiles/priv-app/GoogleLoginService/GoogleLoginService.apk is ready!
odex2apk: Added /tmp/pfiles/priv-app/GoogleServicesFramework/arm/GoogleServicesFramework.dex to /tmp/pfiles/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk as classes.dex
odex2apk: /tmp/pfiles/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk is ready!
odex2apk: /tmp/pfiles/priv-app/Phonesky/Phonesky.apk is ready!
odex2apk: /tmp/pfiles/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk is ready!
odex2apk: Added /tmp/pfiles/app/GoogleContactsSyncAdapter/arm/GoogleContactsSyncAdapter.dex to /tmp/pfiles/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk as classes.dex
odex2apk: /tmp/pfiles/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk is ready!
odex2apk: Added /tmp/pfiles/priv-app/CalendarProvider/arm/CalendarProvider.dex to /tmp/pfiles/priv-app/CalendarProvider/CalendarProvider.apk as classes.dex
odex2apk: /tmp/pfiles/priv-app/CalendarProvider/CalendarProvider.apk is ready!
make-update-zip: Adding system/priv-app/GoogleLoginService/GoogleLoginService.apk
make-update-zip: Adding system/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk
make-update-zip: Adding system/priv-app/Phonesky/Phonesky.apk
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libsslwrapper_jni.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libjgcastservice.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libgmscore.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libgms-ocrclient.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libgcastv2_support.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libgcastv2_base.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libgames_rtmp_jni.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libconscrypt_gmscore_jni.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libWhisper.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/lib/arm/libAppDataSearch.so
make-update-zip: Adding system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk
make-update-zip: Adding system/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk
make-update-zip: Adding system/priv-app/CalendarProvider/CalendarProvider.apk
make-update-zip: Adding system/lib/libjni_latinimegoogle.so
make-update-zip: Created zip update.zip, trying to sign it...
make-update-zip: Update zip update.zip is ready!
[[email protected] make-gapps-zip] $ unzip -l update.zip
Code:
Archive: update.zip
signed by SignApk
Length Date Time Name
--------- ---------- ----- ----
1675 2008-02-29 03:33 META-INF/com/google/android/update-binary
36483 2008-02-29 03:33 system/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk
677372 2008-02-29 03:33 system/lib/libjni_latinimegoogle.so
136107 2008-02-29 03:33 system/priv-app/CalendarProvider/CalendarProvider.apk
4473468 2008-02-29 03:33 system/priv-app/GoogleLoginService/GoogleLoginService.apk
3388642 2008-02-29 03:33 system/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk
11703391 2008-02-29 03:33 system/priv-app/Phonesky/Phonesky.apk
28516157 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk
517592 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libAppDataSearch.so
452308 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libWhisper.so
13500 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libconscrypt_gmscore_jni.so
13496 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libgames_rtmp_jni.so
177520 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libgcastv2_base.so
194000 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libgcastv2_support.so
304752 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libgms-ocrclient.so
1630700 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libgmscore.so
30092 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libjgcastservice.so
1243632 2008-02-29 03:33 system/priv-app/PrebuiltGmsCore/lib/arm/libsslwrapper_jni.so
4995 2008-02-29 03:33 META-INF/com/android/otacert
2100 2008-02-29 03:33 META-INF/MANIFEST.MF
2324 2008-02-29 03:33 META-INF/CERT.SF
1714 2008-02-29 03:33 META-INF/CERT.RSA
--------- -------
53522020 22 files
[[email protected] make-gapps-zip] $ sha1sum update.zip
87986ca452217658c6e3d72b91b631f40fe6dd2f update.zip
[[email protected] make-gapps-zip] $ du -b update.zip # size in bytes
30224904 update.zip
[[email protected] make-gapps-zip] $ grep ro.build.description /tmp/pfiles/build.prop
ro.build.description=hammerhead-user 5.1.1 LMY48I 2074855 release-keys
[[email protected] make-gapps-zip] $ java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
Click to expand...
Click to collapse
Note: the tool is designed for Android 5.0 or newer. It can be adapted for Android 4.4 by using baksmali and adjusting the paths, but meh, it is outdated stuff... Have fun with these docs and tools!
Reserved.
Cool ma.. thanks a lot
Sent from my SM-T231 using XDA Free mobile app
Thank you for your work @Lekensteyn. I am very interested in your work for our Open Gapps package (but you already noticed that on GitHub) but personally I can't believe this thread gets so little attention.
One moment everybody cares about stagefright and their safety and security, but when it comes to GApps packages, no one seems to care. Also the comment and general lack of response you got from cgapps is sort of unbelievable :-/
Dear everyone,
I'd like to backup all apps and their data and settings from my old phone (Android 4.0.4, have a root shell if needed) and restore them to a new phone (Android 10) which I don't want to root. I've considered the following options, but would be glad about some guidance.
1. Backup with adb backup, restore with adb restore
This would be the obvious choice, I guess. However, my old phone is an Xperia Ray with stock ROM, which cannot run adb backup.
If I try to backup an app, I get the following in adb logcat:
Code:
V/BackupManagerService( 290): Requesting full backup: apks=false shared=false all=false pkgs=[Ljava.lang.String;@2c36b0b8
I/BackupManagerService( 290): Beginning full backup...
D/BackupManagerService( 290): Starting backup confirmation UI, token=940595255
I/ActivityManager( 290): START {act=fullback flg=0x10000000 cmp=com.android.backupconfirm/.BackupRestoreConfirmation (has extras)} from pid 290
E/BackupManagerService( 290): Unable to launch full backup confirmation
D/BackupManagerService( 290): Full backup processing complete.
The "Unable to launch full backup confirmation" is because BackupRestoreConfirmation.apk is missing.
I downloaded a system image from https://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-14_r02.zip, extracted the files with unyaffs, and tried installing the BackupRestoreConfirmation.apk with adb install. This fails with INSTALL_FAILED_DEXOPT because it's an odexed app.
Using a root shell, I copied the extracted BackupRestoreConfirmation.apk and BackupRestoreConfirmation.odex to /system/app and rebooted the phone. I can see that the files are there:
Code:
$ adb shell ls -l /system/app | grep -i 'backup'
-rw-r--r-- root root 88093 2011-11-24 00:00 BackupRestoreConfirmation.apk
-rw-r--r-- root root 11816 2011-11-24 00:00 BackupRestoreConfirmation.odex
-rw-r--r-- root root 84730 2012-05-08 20:51 GoogleBackupTransport.apk
However, it still does not show up among the system apps:
Code:
$ adb shell pm list packages -f | grep -i 'backup'
package:/system/app/GoogleBackupTransport.apk=com.google.android.backup
I was expecting an entry for com.android.backupconfirm.
Q: Am I missing anything to install it as a system app? Is there any configuration file it needs to be added to?
2. Backup with a modified adb backup, restore with adb restore
Since I have root access, would it be possible to replace some code on my device such that adb backup does not require a confirmation?
adb backup calls /system/bin/bu, which runs /system/framework/bu.jar. From https://android.googlesource.com/pl...fs/tags/android-4.0.4_r2.1/cmds/bu?autodive=0, it seems that this calls somewhere into https://android.googlesource.com/pl...roid-4.0.4_r2.1/core/java/android/app/backup/, but is not directly responsible for the confirmation dialog.
Going backwards instead, "Unable to launch full backup confirmation" is printed from https://android.googlesource.com/pl...android/server/BackupManagerService.java#4911, which lives in /system/framework/services.jar.
Q: How complicated is it to compile and install a modified version of services.jar/services.odex? Is this even possible in a live system?
3. Create .ab file without adb backup, restore with adb restore
Since I have root access, I can copy out all the files I want. An .ab file is a compressed .tar archive with a special 24-byte header. If I knew which files go into the .ab file, and maybe in which order, with which permissions and user ids, and how to create the 24-byte header, I could manually create the .ab files to feed to adb restore.
Q: Is there a generic recipe for creating a .ab file for an app? Or does each app decide individually which files to backup and restore?
Thank you for any hints!
May be this helps you:
Backup android app, data included, no root needed, with adb
Backup android app, data included, no root needed, with adb - android-backup-apk-and-datas.md
gist.github.com
jwoegerbauer said:
May be this helps you:
Backup android app, data included, no root needed, with adb
Backup android app, data included, no root needed, with adb - android-backup-apk-and-datas.md
gist.github.com
Click to expand...
Click to collapse
Thank you! Unfortunately, this also uses adb backup to pull the data, for which I need to find a way to install com.android.backupconfirm on my device.
I use ApkExport* from Playstore on my non-rooted 10+ to backup all my loaded apps.
Have done a full restore using only the stored copies; worked perfectly. Cut down load time substantially... took Playwhore out of the loop.
*freeware, no ads, no internet connection
blackhawk said:
I use ApkExport* from Playstore on my non-rooted 10+ to backup all my loaded apps.
Click to expand...
Click to collapse
Thank you! But if I see correctly, this only copies the .apk files (basically, the /data/app directory), but does not export their settings and data to be imported to a new device.
f0k said:
Thank you! But if I see correctly, this only copies the .apk files (basically, the /data/app directory), but does not export their settings and data to be imported to a new device.
Click to expand...
Click to collapse
This is correct. Probably better this way especially if the phone was compromised by malware.
My important apps that are hard to reconfigure are backed up separately. I deliberately picked ones that allow for complete backup like Poweramp, PD MDM and ColorNote.
f0k said:
Thank you! Unfortunately, this also uses adb backup to pull the data, for which I need to find a way to install com.android.backupconfirm on my device.
Click to expand...
Click to collapse
The mentioned missing APKs you can fetch here:
Root - Stock APK's
Directory of \m830\rom\app 10/12/2012 05:21 PM 143,392 AccuweatherDaemon.apk 10/12/2012 05:21 PM 3,064,214 AccuweatherWidget.apk 10/12/2012 05:21 PM 5,808,937 AccuweatherWidget_Main.apk 10/12/2012 05:21 PM 124,220 Activation.apk 10/12/2012 05:21 PM...
androidforums.com
jwoegerbauer said:
The mentioned missing APKs you can fetch here:
Root - Stock APK's
Directory of \m830\rom\app 10/12/2012 05:21 PM 143,392 AccuweatherDaemon.apk 10/12/2012 05:21 PM 3,064,214 AccuweatherWidget.apk 10/12/2012 05:21 PM 5,808,937 AccuweatherWidget_Main.apk 10/12/2012 05:21 PM 124,220 Activation.apk 10/12/2012 05:21 PM...
androidforums.com
Click to expand...
Click to collapse
The download link does not work any more. However, as described above, I already extracted the missing .apk and .odex from an official sysimg from https://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-14_r02.zip. That .apk is 88093 bytes and the .odex is 11816 bytes. The link you posted had a .apk of 15089 bytes and misses the .odex. Not sure if this is relevant.
In any case, user "animania260" in the thread you posted had the same problem as me: I copied the .apk and .odex into /system/app and rebooted, but adb backup still fails with the same error, and /system/app/BackupRestoreConfirmation.apk is not listed among the installed apps (adb shell pm list packages -f).
Is there anything else that needs to be done to get the phone to accept a new system app? Or are there any special requirements for system apps? Do they need to be signed differently than what's included in the official sysimg, for example?
Another route could be to compile https://android.googlesource.com/pl....0.4_r2.1/packages/BackupRestoreConfirmation/ into a deodexed .apk and install it as a user app, but I don't know how to do that yet, and I don't know if https://android.googlesource.com/pl...android/server/BackupManagerService.java#4988 will just happily start a user app if it happens to provide an intent of the correct name.
f0k said:
I copied the .apk and .odex into /system/app and rebooted, but adb backup still fails with the same error, and /system/app/BackupRestoreConfirmation.apk is not listed among the installed apps (adb shell pm list packages -f).
Is there anything else that needs to be done to get the phone to accept a new system app? Or are there any special requirements for system apps? Do they need to be signed differently than what's included in the official sysimg, for example?
Click to expand...
Click to collapse
IMO the APKs in question must NOT get simply 1:1 copied into /system/app but also renamed
Example:
Code:
/system/app/BackRestoreConfirmation-1.apk
and additionally given 0644 permission. Phone has to get re-booted afterwards, too, if that's not automatically done.
But I may err as always ...
jwoegerbauer said:
IMO the APKs in question must NOT get simply 1:1 copied into /system/app but also renamed
Click to expand...
Click to collapse
Renaming the package did not help, but this time I started adb logcat directly after adb reboot, and found something relevant that came up early in the boot process:
Code:
I/PackageManager( 291): /system/app/BackupRestoreConfirmation-1.apk changed; collecting certs
I/dalvikvm( 291): DexOpt: mismatch dep signature for '/system/framework/core.odex'
E/dalvikvm( 291): /system/app/BackupRestoreConfirmation-1.apk odex has stale dependencies
E/dalvikvm( 291): odex source not available -- failing
W/PackageManager( 291): StaleDexCacheError when reading apk: /system/app/BackupRestoreConfirmation-1.apk
W/PackageManager( 291): dalvik.system.StaleDexCacheError: /system/app/BackupRestoreConfirmation-1.apk
W/PackageManager( 291): at dalvik.system.DexFile.isDexOptNeeded(Native Method)
W/PackageManager( 291): at com.android.server.pm.PackageManagerService.performDexOptLI(PackageManagerService.java:3080)
W/PackageManager( 291): at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:3634)
W/PackageManager( 291): at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:2963)
W/PackageManager( 291): at com.android.server.pm.PackageManagerService.scanDirLI(PackageManagerService.java:2775)
W/PackageManager( 291): at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:1066)
W/PackageManager( 291): at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:837)
W/PackageManager( 291): at com.android.server.ServerThread.run(SystemServer.java:167)
D/PackageManager( 291): No files in app dir /vendor/app
So if I interpret this correctly, there really is a problem with the signatures. Just out of curiosity, I tried whether apps in /vendor/app would be treated differently. I created /vendor/app, moved the .apk and .odex there and rebooted, but get the same error just with different paths.
Some googling informs me that this is probably because the /system/framework/core.odex on my device is not the same as the framework/core.odex in the sysimg I took the odexed BackupRestoreConfirmation.apk from.
From https://android.googlesource.com/pl...roid-4.2.2_r1/vm/analysis/DexPrepare.cpp#1142, it seems it would be trivial to just go ahead and replace the signatures of all dependencies in BackupRestoreConfirmation.odex (with a hexdump, I can see there are nine dependencies). Is the .odex signed to catch such a modification, or would it pass through? And how would I obtain the SHA-1 signatures from the source DEX files? My device apparently knows them.
/edit: They're part of the .odex header, the signature is at offset 0x34 and has 20 bytes, so I could copy out the SHA-1 signatures from the dependencies on my phone and implant them in BackupRestoreConfirmation.odex. But that signature check will be there for a reason, I assume the .odex will point at specific offsets in its dependencies and crash if the dependencies are not the original ones.
So I will either have to recompile BackupRestoreConfirmation.apk from source with WITH_DEXPREOPT=0 or to deodex the compiled one, so I don't need a .odex file at all.
I'm learning a lot more about the internals of Android than I ever intended to
Finally got around continuing this quest, and it worked! I deodexed the BackupRestoreConfirmation.apk, resigned it, installed it as a system app, and can now run adb backup on my Xperia Ray, Android 4.0.4 ICS.
For posterity, I am documenting all required steps (assuming a Linux machine).
1. Download and extract a stock system image
Download a system image for Android 4.0.4: https://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-14_r02.zip
Unzip it.
Extract the image with unyaffs (can be installed with apt install unyaffs in Ubuntu):
Code:
mkdir /tmp/sysimg
unyaffs armeabi-v7a/system.img /tmp/sysimg
It will say Warning: Can't restore owner/group attribute, run unyaffs as root, that can be safely ignored, we do not need files to be owned by root.
2. Deodex BackupRestoreConfirmation.apk
Download smali and baksmali (https://github.com/JesusFreke/smali, find download link in the README), put the two .jar files somewhere (I assume /tmp)
Extract the .odex file. java -jar /tmp/baksmali*.jar x --help is pretty self-explanatory. I did:
Code:
mkdir /tmp/backuprestore
java -jar /tmp/baksmali*.jar x -a 14 -d /tmp/sysimg/framework -o /tmp/backuprestore/out /tmp/sysimg/app/BackupRestoreConfirmation.odex
Assemble the smali files into a .dex file. Again, java -jar /tmp/smali*.jar a --help is pretty self-explanatory. I did:
Code:
java -jar /tmp/smali*.jar a -a 14 -o /tmp/backuprestore/classes.dex /tmp/backuprestore/out
Add the .dex file to the .apk file. We will copy the .apk to be sure.
Code:
cp /tmp/sysimg/app/BackupRestoreConfirmation.apk /tmp/backuprestore
cd /tmp/backuprestore
zip BackupRestoreConfirmation.apk classes.dex
It is not needed to do a new zipalign. If you're curious, you can install it (in Ubuntu, sudo apt install zipalign) and run zipalign -c 4 BackupRestoreConfirmation.apk && echo aligned || echo not aligned to check it.
If you try to install the file with adb install BackupRestoreConfirmation.apk now, it will say: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES], because it is not correctly signed any longer. We need to resign it.
Install signapk (in Ubuntu, sudo apt install signapk. If you want, you can first verify that it is indeed not signed:
Code:
jarsigner -verify BackupRestoreConfirmation.apk
It should say jarsigner: java.lang.SecurityException: SHA1 digest error for classes.dex.
The original .apk is signed correctly; with
Code:
jarsigner -verify -verbose -certs /tmp/sysimg/app/BackupRestoreConfirmation.apk
you will see that it was signed by "[email protected], CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US" with a 2048-bit key.
Create a key for signing. This can be done with keytool, but this will set up a keystore that will be left behind. Instead, I followed a guide from https://sites.google.com/site/delocatedsystems/android/howto/create-cert-signapk, using 2048 instead of 1024 bits:
Code:
openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out request.pem # this will ask for some data, make up something
openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem
openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt
Finally, we can sign the .apk:
Code:
signapk certificate.pem key.pk8 BackupRestoreConfirmation.apk BackupRestoreConfirmation_signed.apk
mv BackupRestoreConfirmation{,_unsigned}.apk
mv BackupRestoreConfirmation{_signed,}.apk
And optionally verify it with jarsigner -verify BackupRestoreConfirmation.apk -certs -verbose.
3. Install BackupRestoreConfirmation.apk
If you just install it with adb install BackupRestoreConfirmation.apk, it will be installed as user app. If you then run adb backup, the confirmation dialog will appear as intended. But if you confirm it, you will get:
Code:
D/BackupManagerService( 292): acknowledgeFullBackupOrRestore : token=1892071259 allow=true
D/AndroidRuntime( 8310): Shutting down VM
W/dalvikvm( 8310): threadid=1: thread exiting with uncaught exception (group=0x2b542210)
E/AndroidRuntime( 8310): FATAL EXCEPTION: main
E/AndroidRuntime( 8310): java.lang.SecurityException: acknowledgeFullBackupOrRestore: User 10104 does not have android.permission.BACKUP.
(Uninstall again with adb shell pm uninstall com.android.backupconfirm if needed.) So the .apk must be installed as a system app to have the android.permission.BACKUP permission.
To do so, copy the .apk file to your device:
Code:
adb push BackupRestoreConfirmation.apk /data/local/tmp
Now open a root shell on the device. This can be done via an exploit I explained in another post. Assuming you are in a root shell on the device, do:
Code:
remount -o rw,remount /system
cat /data/local/tmp/BackupRestoreConfirmation.apk > /system/app/BackupRestoreConfirmation.apk
chmod 644 /system/app/BackupRestoreConfirmation.apk
remount -o ro,remount /system
exit
In my case, the app was picked up directly, without having to reboot the phone. Verify with:
Code:
adb shell pm list packages -f | grep -F backup
If it worked, the list will contain:
Code:
package:/system/app/BackupRestoreConfirmation.apk=com.android.backupconfirm
Otherwise you may need to reboot your phone with adb reboot.
When you now try to backup an app with adb backup -f theappname.ab -apk com.theappname (where com.theappname is taken from the list of user apps produced with adb shell pm list packages -3), you may find that instead of a 0-byte file that you get with a missing BackupRestoreConfirmation.apk, you get a 41-byte file, which is only a moderate improvement. In adb logcat, you may find:
Code:
V/BackupManagerService( 811): Requesting full backup: apks=false shared=false all=false pkgs=[Ljava.lang.String;@4181ffc8
W/BackupManagerService( 811): Unknown package '-apk' 'com.theappname', skipping
It may not be apparent at first, but the quotes around -apk and com.theappname in the error message are not put there by BackupManagerService, they are introduced by recent versions of adb to safeguard against a shell injection. This is why -apk is not detected as a flag, and the package name is not recognized as a package. The solution is to downgrade to an earlier version of adb, as explained in more detail on https://android.stackexchange.com/a/132921.
To check the version of adb on your computer, run:
Code:
adb version
To check the version of adb on the phone, run:
Code:
adb shell adb version
In my case, the phone is running 1.0.29, but downgrading adb to 1.0.31 was enough. Precompiled versions are available for Linux, Mac, Windows.
Finally, you can backup apps with adb backup (at least those apps which support it). Phew!
(PS: If you want to run adb backup -shared, you will need to deodex and install SharedStorageBackup.apk. Didn't try.)