[Q] apk decompiled, recompiled, signed won't install - Android Q&A, Help & Troubleshooting

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.

Related

[Q]Edit strings.xml in APK files. Need help!

I looked everywhere tried every program from APK Edit, APK Tool, APK Manager, Eclipse and a few others, I cannot figure out how to edit the Strings.xml in APK files.
APK Edit and APK Tool / APK Manager just gives me issues when i try to edit the strings, when i finally get them changed over and push to the phone it doesn't install the .apk, tried this on two different devices with no change.
I'm making theme files but i require to edit the strings value so the names are different, and i'm using an OEM file as my base file.
When I edit the .apk with my themed graphics and go to install it, it always wants to overwrite the original, but i've found that others have been able to just rename the strings value to another name so it wouldn't replace it.
What i'm trying to do is not replace original skins in HTC sense 2.x. Since there installable they can be installed multiple times if there values are changed in strings.xml, allowing for massive customization options.
I need the developers community to show me how to do this, i've tried on my own and i've failed each time, and i also tried contacting the themers that have done this on there own but they refuse to help me.
I have a bunch of skins i'm working on but i can't render my skins and theme the apk files until i can do this
You guys are my last bit of help i can find.

[Q] how to modd .xml files of a theme ?

Hi all,
I'd like to modify some .xml files in the Gingerbread Theme that are in the resources.arsc file. I'm using Apk Manager 4.9 and I'm unable to compile twframework-res and framework-res: a lot of errors appears and resources.arsc isn't rebuild. It seems that it's a problem of dependencies. What file(s) I need ? Is there a way ?
I have a lot of errors like this :
"......\public.xml:172: error: Public symbol drawable/ic_menu_account_list declared here is not defined."
I tried with all the 38 themes and it's the same thing.
Note: When i use apk manager with an app it works and resources.arsc is rebuild.
Thanks in advance
clarkkov said:
You should discuss this with the app developer, this is obviously app specific issue - and who is most likely to know this app the best(?). I think that framework.apk(s) depend on more .apk(s) inside the OS, i.e. they are not independent like the 3rd party apps.
Click to expand...
Click to collapse
Yes. It's strange because when I use apk manager with a stock framework apk (JPM for example) there are no errors and resources.arsc is rebuild. So there is no dependencies with the OS...
And all the modded themes are uncompilable ...
thx !
I found the reason :
The framework-res.apk contains corrupted .9.png's images files ...
And every theme posted around there were modified with the sames .9.png's corrupted files ! Someone forgot to use the tools to mod this king of files or forgot to compile them ...
So, to solve this and to be able to compile all the framework-res.apk you have to get back the non corrupted .9.png's files from stock ROM.
I think the same problem is also present in twframework-res.apk; I will see later.
cheers.

[Q] How do you rename the package of a published android app?

Hi guys,
I am been working a on an an android app called Inomail that is available on the android market. I have done an overhaul changing the background colours, buttons to blue and green neon colours, change all icons and change text such app name plus other strings elsewhere.
Everthing work fine and I am certain it will be popular download if published.
I have been using APK Manger and Eclipse and Java decompilers to convert smali to java codes.
I successfully signed with a private key and it worked but this the obvious problem renaming the package when changing it crashes. I done everthing including refactoring and renaming in Eclipse, also renamed all the package name to all sub packages but to no avail.
If rename tthe package name back to original name it works but changing it crashes.
Now I have done some search on here there also a code to the package name which the reason for it to crash and the best way it to use a rooted device which I have and install the app.
So my 2 questions would anyone know where is the folder on smartphone would I find the file or code and second question have anyone manage to rename package published app on the market and how please?
Your help greatly appreciated.
rename of installed android app
Darkfunnyguy said:
Hi guys,
I am been working a on an an android app called Inomail that is available on the android market. I have done an overhaul changing the background colours, buttons to blue and green neon colours, change all icons and change text such app name plus other strings elsewhere.
Everthing work fine and I am certain it will be popular download if published.
I have been using APK Manger and Eclipse and Java decompilers to convert smali to java codes.
I successfully signed with a private key and it worked but this the obvious problem renaming the package when changing it crashes. I done everthing including refactoring and renaming in Eclipse, also renamed all the package name to all sub packages but to no avail.
If rename tthe package name back to original name it works but changing it crashes.
Now I have done some search on here there also a code to the package name which the reason for it to crash and the best way it to use a rooted device which I have and install the app.
So my 2 questions would anyone know where is the folder on smartphone would I find the file or code and second question have anyone manage to rename package published app on the market and how please?
Your help greatly appreciated.
Click to expand...
Click to collapse
pls, help how to change my android app label name and logo ?

[Dev Help][Emergency]Regarding Modifying AndroidManifest.xml and signing system apps

I am trying to modify AndroidManifest.xml of settings.apk
But as we all know, if we modify that AndroidManifest.xml, we have to sign the apk so when I modify the AndroidManifest.xml and sign the settings.apk and push it then it doesnt get installed and I get a error in logcat saying there is a mismatch in signatures of the apk and system uid.
Then I tried restoring stock signatures but it still doesnt get installed and in log it says the apk has no signatures because I modified AndroidManifest.xml.
Do anyone have solution for this to sign system apps properly or any other workaround?
I came to know that every system apk and framework apk must be batch signed incase of editing the manifest xml.
I don't think that every apk needs to be re-signed. I've never done this, but my thought was that any apk that has an AndroidManifest.xml with the same original modified dates (you can check the dates with 7-zip) need to re-signed together. Won't it mess up some other apks that don't need to be re-signed if you were to re-sign everything? Please let me know if I am way off..
Also, note that there are other ways to invert the colors in apks besides editing the AndroidManifest... (i.e. edit the /values/styles.xml, /layout/*.xml, etc... can be a pain, but it works) - Sorry, but I guess I am assuming that that's what you are going after by editing the AndroidManifest in the Settings.apk... again, anyone feel free to correct me if I'm wrong on anything here - I am all for learning and sharing!
^^No I dont want to theme it or colorize it
I am adding new functionality for which some new permissions and activity declaration is needed in Manifest file
But if I modify Manifest and use stock signature files it doesnt install and if I resign it then it say signature mismatch with system uid.
Bump!!
I have edited the AndroidManifest.xml in the Settings.apk (for theme color change), and I did not re-sign it after compiling, I retained the originals.
And, it worked fine when I put it on my phone alone (with a flashable zip package), BUT (this is a big but), - it did not get installed when I put it in a ROM package together with all the system files. That's when the signatures become an issue... you need to then re-sign all, or nearly all apps and framework.
At least that's my experience...
Check out this thread.. http://forum.xda-developers.com/showpost.php?p=28475720&postcount=63
Sent from my phone's mind
Oh then I have to sign all system apks
Any other way?
Do you know how to sign with system key which will match system uid?
Only for AOSP ROMs you can resign and apks work. Samsung use closed source.....how could you ever match signatures? Also don't change the Manifest. Leave it. Who says you have to change it?
Note that its via the public.xml that you need to add these listings as to what the apk is now doing. No the manifest. Is it going to market? No so don't change manifest simple. If it is then it shouldn't really be a system app. Also you can disable signature checking within your ROM if that is all you are worried about. I have signed apks from the market that I have themed and then installed them to system and they work fine. Its the apks you use that have dependencies that WON'T work. I.e. apks like Samsung TWiz apks that listen for the system vold boot complete proprietary to Samsung or say an ASOP apk that is trying to chime into something that is framework related in a non-asop ROM.....this then becomes a permissions issue
---------- Post added at 05:09 AM ---------- Previous post was at 05:05 AM ----------
PS: I have edited androidmanifest anyway and apks still work fine.... upgraded the SNS apk to ensure it was fit for use above and beyond SDK 10
varun.chitre15 said:
I am trying to modify AndroidManifest.xml of settings.apk
But as we all know, if we modify that AndroidManifest.xml, we have to sign the apk so when I modify the AndroidManifest.xml and sign the settings.apk and push it then it doesnt get installed and I get a error in logcat saying there is a mismatch in signatures of the apk and system uid.
Then I tried restoring stock signatures but it still doesnt get installed and in log it says the apk has no signatures because I modified AndroidManifest.xml.
Do anyone have solution for this to sign system apps properly or any other workaround?
Click to expand...
Click to collapse
Did you figure out in the end? Still stuck with same problem as you

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!

Categories

Resources