[Q] Unpack and pack *.apk files - Android Q&A, Help & Troubleshooting

Hello guys,
i have to unpack, modify and pack apk-files automatically. I work on Linux and my first attempt was to unpack it with unzip and pack it again without modification. The installation failed because package was not signed correctly. I removed CERT.* files and pack it again. After signing the archive with jarsigner I installed it on my rooted Galaxy S2, Android 4.1.2. But if I start the app, it deadlocks and I have to reboot the device. The app is very simple only showing some views without any function. Did I miss any special about apk-files?
Hope, you can give me an advice .
Thanks, Fabian

Solution found - my failure!
Uh, that's awkward . I forget recursive parameter by zipping it. Were some hours fighting to this .
Fabian

Related

[Q] How to just update an apk in ROM pack?

Hi all,
I'm new here. May I ask what are the minimal necessary steps to replace an apk with updated one in a ROM image?
(e.g. If I want to replace the google map in a ROM file with latest version)
Thanks alots!
A newbie developer
N.B. I tried to replace the apk directly in the ROM .zip but it reported errors during verification in installation. There should be some checksum updates in certain files in the ROM and signings steps I omitted.
you only need to replace the APK.
what kind of error appears in logcat?
ykxhda said:
N.B. I tried to replace the apk directly in the ROM .zip but it reported errors during verification in installation. There should be some checksum updates in certain files in the ROM and signings steps I omitted.
Click to expand...
Click to collapse
After replacing this APK you have to resign this zip. Try Android Commander to sign thiz zip.
Another more "direct" way to sign update files (or apk/jar files if they need signing) is using the Win-sign.zip from this post: http://forum.xda-developers.com/showthread.php?t=629151
Look at the README and sign.bat inside for how to use it, its quite simple.

[Q] apk decompiled, recompiled, signed won't install

Hello,
I'm trying to hack an apk.
My first step was to use apk multi tool, and to just decompile and recompile it.
This is what i've done:
decompiling
recompiling (without any mod)
signing
No error appears during those steps.
But this new apk won't install on my phone !
If I check difference between the two apk:
all xml files are differents
.RSA and .SF have not the same name
classes.dex, resources.arsc and manifest.mf are differents
I don't understand those difference. can somebody help me to understand that and how to recomile a proper version ?
PS: This app is a french app that shows speed cameras on the road. However this app is now only showing a big zone and not the exact location for france. But it stills show precise location for other countries, so obfuscation is done at the apk level, and I already found where it is in the code, so i'd like to bypass it and recompile a "special' version
Thanx
Just a few quick questions. Is you phone set to install from sources than Droid market? You do know the newly compiled and signed project will be located in the "place_package _here_ for_Modding" folder and is named "Signed(yourappnamehere).apk?
Sent from my SAMSUNG-SGH-I727 using xda premium
Hi,
yes, i took the newly compiled apk in this directory, and yes my phone is set accept unknown sources.
When i install the apk, i first have the
- liste of phones serviesc that will be used
- then the install progress bar
- then the message "application not installed"
I guess there is some kind of protection in the sources...
I also noticed that the two apk - original, and resigned one - don't have same size.
The only difference is actually in the META-INF directory : the .RSA and the .SF files.
In the original application they are:
- IFOX_.RSA
- IFOX_.SF
But when recompiling, those files are:
- CERT.RSA
- CERT.SF
I'm shure the problem comes from here, but i'm too noob to analyse that...
So my proble can be sum-up by:
Why the recompilation doesn not give me the same RSA and SF file ??
Beware there are some modifications that you cant do on decs, expecially the packagename.
also beware to disable the "non-market" tag on the phone.
Yes, but for the moment i didn't make any modification:
Just decompiling, recompiling and resigning.
Maybe you want to tell that the apk name must stay the same ? (sorry my english is not perfect )
GOT IT WORKED !!!
You must first uninstall the previous application !
I was trying to install my new one over the old one, but the signatures are not the same !!!
Thanx everybody, and hope this will help somebody !
APK edit error 103
Ok im having a similar issue.
I know the file size is mismatched but ive never had this issue
as a test i only modded 1 thing but 4 files
changed a link in an html / changed an image and its name and the html included the link to the new name
when this failed i changed the manifest and the .sf to match the change i made with name but not the sha :"no clue here"
Tried...
APK multi tool ... and 7zip to make the mods
Tried... Bothsigned and unsigned.
Tried copying the sig from old apk to new with names corrected "notsha" fail still
Tried....
Origional APK installs no issue
Uninstall orig apk rebooted
Allow out side apps yes and no.both
using file manager explorer and root browser and es file manager
Copying directly to /system/app fail
copying to data/data/app/copy fail " yes it wont even copy to there"
Tried.. Multiple phones
I then tried a hex editor on the apk. And after changes install still fail.
I modded several other apk's even my framework but this is the first app that ha given me so many issues
This is an app to help elderly users access internet and the devs are AWOL and the project abandoned
Code:
https drive google com/folderview?id=0B5PggxVy7c8meDhrcjNJOGs5cFk&usp=sharing
Code:
www eldy eu/en/software/eldy-tablet/‎
"edited for posting "
The goal here is to make it more U.S. friendly its English base is geared to English UK and this does not help my family as we are in the U.S.
All i can get from logcat is error 103
Logcat shows package it.vegans.eldy has no certificate at entry AndroidManifest.xml ignoring
Knstallation error code 103
I tried apk multitool certify thing
i tried copying the certs from old to new apk
i tried modding the cert to correct names
So maybe im mentally challenged but i just cant figure this one out
---
Edit .
I attached a zip with original and modified apk's
All i want to do is simple html edits xml link edits and img changes since mostly the app is a series of pages.

Change version number in apk

I own a BB Playbook tablet for about a year now (bought it during the when it was about 200$ because I needed a 7'', the hardware was specs were nice at the time and the company promised Android app support). Regardless of the sanity of my decision the device saves me about 2 hours per day (I use it mainly to read pdf and build an xls database).
I've converted many apk to bar in order to sideload them to my device (not all of these work). Recently I tried Firefox on my Xperia mobile and was quite pleased with the ABP plugin So I tried to convert the apk but both the apk2bar and the Blackberry Graphical Aid Tool complain that the version number is too long...
Anyone knows how to shorten it? In what file is it located? Or anyone up for the task.
Keep in mind I'm not a dev.
Thanks in advance
android:versionName is what you need to change.
Thanks for the reply.
Tried the apps from your sig. I managed to edit AndroidManifest.xml. Recompiling (after the changes) doesn't seem to work (the result apk is much smaller... many files/folders from the original FF apk were not in the project folder or compiled apk).
Tried unpacking + zip + sign but this last step is failing. Wanam APK suite keeps giving an error message. My box runs Win7 x64 and at first I only had Java RE x86 7.10... it didn't find Java in my machine and stated signing would not work; after I installed the x64 it gives no preemptive messgae and I progress further but the signing process fails
frmariam said:
Thanks for the reply.
Tried the apps from your sig. I managed to edit AndroidManifest.xml. Recompiling (after the changes) doesn't seem to work (the result apk is much smaller... many files/folders from the original FF apk were not in the project folder or compiled apk).
Click to expand...
Click to collapse
Hi.
Look at the files in the apk before decompiling it and you'll see that all those files and folders aren't there to begin with. All those files and folders are from the decompiled resources.arsc so it's normal for them not to be there when recompiled, and when you add the resources.arsc, manifest and meta folder from the original apk to the recompiled apk, it will become larger.
I noticed yesterday I had put an old apktool in the folder but have corrected it now so download and try again.
I was attempting to do the same so I decompiled and edited the android:versionName and the android:versionCode . After doing that, recompiling and resigning I was able to convert using apktobar and load to the playbook with no issues......except the app opens to an all white page and nothing beyond that will work! Just to be clear I was attempting to convert Firefox as well. Hope someone has some helpful hints that could fix it!

[Q] Modifying APKs - wont install

I'm looking for a little bit of guidance. I want to modify some apps but when I do I can't seem to get them working on devices.
I am happy with the use of APK tool and zipaling, and have successfully modified my SystemUI.apk but when I try to mod apps it does not work.
I have tried modding the apk in data/app and just replacing the file and tried modding the downloaded apk and try to install.
My process:
Decompile (APKtool)
Mod
Recompile (APKtool) - with errors
I add the files from the original APK that errored during recompile with 7zip
Zipaling
Transfer back to the device
Devices
Samsung S3 mini & Nexus 7 - both running stock rooted JB 4.1.1
You need to sign the apk before you can install them. Get the signapk.jar and either get the test keys or make your own keys. Once the zip is final (after 7zip) sign the apk and then do a zipalign.
Unless you are sure that the compilation errors are serious, consider fixing them.

DJI Fly help clone (or rename package)

Hi guys ! I spent week trying to clone (rename package name) of last DJI Fly apk, but no success. I used JEB, Android studio, Jadx, apktool, xml2axml, i try debug, and other methods, but app still crush on start.
So for first i decompile apk with apktool, search throught all files for package name - dji.go.v5 and replace with dji.go.v7. Also i search through all binaries ( strings | grep) and find no any results for old package name, so i think i replace all old package name strings. Then i rebuild apk back with apktool (--aapt2 option needed) and sign with uber-signer. But after installation it crush again and again on start.
Also i look at logcat in Android Studio during starting the app and see something like this error.
Please help me with renaming or give any advices
Okay i find some info that app use SecNeo wrapper inside and SecNeo is app security company.

Categories

Resources