Modding a 2.1 Sense UI rom (Hero Based.... but more of a hybrid)
Hey, I've edited the AndroidManifest.xml of the HtcDialer.apk, repackaged, sign and first tried to adb push it to my phone - didn't work, tried adb install - parser error, so I repackaged the entire update.zip and reflashed - still didn't work.
Logcat shows this:
Package com.android.htcdialer has no signatures that match those in shared user android.uid.shared; ignoring!
Click to expand...
Click to collapse
I tried popping into recovery and running "fix apk uid errors" but it still throws the same logcat and the dialer won't open.
How do I fix this?
EDIT: I've got this problem, facebook sync and camera/video to fix, then I'll be releasing the fastest SenseUI rom you guys have EVER seen. No joke.
OK, I'm grasping at straws here - so I've also tried, through ADB, completely uninstalling it and rm'ing any traces, then I tried to adb install it and it still won't work, I get an ADB error:
INSTALL_FAILED_UPDATE_INCOMPATIBLE
But everything should be deleted! It shouldn't matter that the old and new signatures don't match, its an entirely fresh install!
I've also noticed that when I adb pu****, I get a list of the HTC apps that share that uid.shared - and at one point they all said "uid=10011" - now they all say "uid=10010". I'm trying to fix this back to he original to see if this is part of the problem, but I can't find this anywhere in the androidmanifest.xml for any off these apps (like contacts, phone, etc).
I know HTC has this shared id stuff for all of their apps, but there must be an easy way to update JUSt an androidmanifest.xml file with a single line to give it vibrate permission. Is there any way I can resign the modified .apk AS Htc?
I have a similar problem (probably the same), does anyone know anything that might help?
Take what was edited and open the original apk with 7zip just drag the edited files in the 7zip window it will ask if you want to add the files, click yes then close out 7zip now pack it up in a update.zip and sign.......Do not sign the apk leave the original signature in there.
Flash adn that should take care of it.
Related
This has happened twice to me:
1) I modify a xml file in framework-res.apk (using apktool)
(I modified the two slide lock screen xmls. apktol rebuilt it without any errors)
2) push the rebuilt apk back. (didnt sign it)
3) reboot
During the reboot i get a ton of app permission errors, and then a "Failure starting core service" error, a few seconds later the phone restarts
The permission errors ("no group null"):
http://pastebin.com/p2ut8MmB
And then the actual errors:
http://pastebin.com/Hg4M9jcA
Fixed by:
1)pushing the backup framework-res.apk back.
2)fixing UID mismatches using the utility in AMON-RA's recovery
Solution: http://forum.xda-developers.com/showpost.php?p=6334647&postcount=5
Questions:
What am I doing wrong?
What triggers the permission errors?
My suggestion didn't work, see below for alternative.
I don't know much about all these signing mechanisms, but I had exactly the same problems when I was testing framework-res rebuilding capabilities of apktool. Tried to sign it using testsign, but had no luck.
I searched for help on IRC and prash told me that I must testsign update.zip file, not framework-res.apk. I did as he said and it worked for me
Brut.all said:
I don't know much about all these signing mechanisms, but I had exactly the same problems when I was testing framework-res rebuilding capabilities of apktool. Tried to sign it using testsign, but had no luck.
I searched for help on IRC and prash told me that I must testsign update.zip file, not framework-res.apk. I did as he said and it worked for me
Click to expand...
Click to collapse
Thanks for the info. Great tool by the way
Will try the update.zip method, and the method djmcnz mentioned.
Update:
Brut.all's tip worked!! thanks again man. I learnt how to create update zips now
Also tried djmcnz's test but it did not work.
update 11/19/2010:
All you need to do is copy/install the file while the OS is not running. The signing part was only needed to allow the update to be flashed
Since AmonRa 2.0 has an option to turn off signature checking all you need to do is
1) update whatever you need in framework-res.apk
2) put the new framework-res.apk in any update.zip whose script copies it to /system/framework. (get a CM nightly if you dont have one)
3) reboot to recovery
4) turn off update signature checking (options>)
5) flash the update. and reboot.
Hmm, is this nexus specific? I'm trying to update framework-res.apk
on motorole milestone, but I get only crashreport after my device boots up.
I jarsign and zipalign this apk and set mode 644 before reboot.
herrlado said:
Hmm, is this nexus specific? I'm trying to update framework-res.apk
on motorole milestone, but I get only crashreport after my device boots up.
I jarsign and zipalign this apk and set mode 644 before reboot.
Click to expand...
Click to collapse
see #3 "..I must testsign update.zip file, not framework-res.apk. I did as he said and it worked for me "
OK Thx, do not need we to zipalign framework-res.apk?
Lado
rori~ said:
see #3 "..I must testsign update.zip file, not framework-res.apk. I did as he said and it worked for me "
Click to expand...
Click to collapse
I was tying to make a fancy updater-script for an add-on for my ROM, but I kept getting a Status 6 error when flashing, so I stripped it back to nothing, just the most basic commands, and eventually got it to work. I made a copy, tried editing it to add the fancy stuff back in... broke again.
So I stripped the copy back to the basic commands... and it still breaks .
As far as I can see, the two files I have attached are identical in every single way, but one fails with a Status 6, the other flashes (BattMod works, update doesn't). Both are edited using gedit on Ubuntu, both zips are created in Ubuntu, neither are signed.
Can anyone see why, I am really tearing my hair out here... all I want to do is add some ui_prints and some progress bars .
I haven't looked it them yet, but make sure you are using the correct update-binary. Different ones support different number of parameters in the mount command.
Don't leave junk files in the update like updater-script.old, it's bad practice
My guess would be that since it's named update.zip, it's looking for a signature and it can't find one. Try renaming update.zip to battmod.zip and see if it works, or sign it first with testsign.
l0st.prophet said:
I was tying to make a fancy updater-script for an add-on for my ROM, but I kept getting a Status 6 error when flashing, so I stripped it back to nothing, just the most basic commands, and eventually got it to work. I made a copy, tried editing it to add the fancy stuff back in... broke again.
So I stripped the copy back to the basic commands... and it still breaks .
As far as I can see, the two files I have attached are identical in every single way, but one fails with a Status 6, the other flashes (BattMod works, update doesn't). Both are edited using gedit on Ubuntu, both zips are created in Ubuntu, neither are signed.
Can anyone see why, I am really tearing my hair out here... all I want to do is add some ui_prints and some progress bars .
Click to expand...
Click to collapse
With what are you editing it?
I've found out that editing it with notepad or any program won't work even if i'm using the right commands, so i decided to use amend2edify, you select an update-script (an update-script you can edit it with notepad without any problem) and it converts it into updater-script, updater-binary, but you have the possibility to edit anything in the output that you want and save it, or just copy-paste into the output the commands in your updater-script onto output by overwriting the converted output.
Don't know if i explained myself well.
Good luck
Try This One
Blank-CWM.zip
It's made for the Moto Photon, so you will need to:
1) Replace the update-binary with one from your phone.
2) Copy the file you wish to flash
3) Delete the txt files in it as well as any folders that you do not need to use in the process of flashing
4) Be sure to set the permissions to target the folder or file you are flashing. If you do NOT update this, you will end up in bootloops (Don't say I didn't warn you)
5) Flash away
Cheers!
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.
I want to change locales and images in system apk of CM 7.2.0 on my LG-P500. It is Contacts.apk and CMParts.apk. Decompiling and compiling passed without errors. Everything is ok! But!
When i put on phone already changed Contacts.apk upon transition to a tab of a dialer I receive an (android.process.acore Force Close!) And
When i put on phone already changed CMParts.apk upon transition to Interface/Notification Power Widget/Widget Buttons/Brightness modes I receive an (android.process.acore Force Close!).
Help me please...! I don't know that I do not so. Thanks!
(Sorry for my English)
Did you sign the apk?
I know that some people claim you don't need to sign system apps, but there are times when signing it is the only way to make it work.
Also, did you decompile and recompile with the appropriate framework-res.apk installed (the one from the rom you are using)?
Yes. I put signed and not signed apks. All the same too most. And when I try to decompile with dependences APK Manager writes that this application not the dependent.
TroyxRUS said:
Yes. I put signed and not signed apks. All the same too most. And when I try to decompile with dependences APK Manager writes that this application not the dependent.
Click to expand...
Click to collapse
Have you tried running a logcat to see what the issues are? That's what I always do when I get errors. Usually the logcat will tell you the error in a detailed enough manner that you can go back and fix the code.
Is this by any chance a stock rom? Because if its a stock rom, I've heard of people having issues sticking modified apks into a stock rom.
I have the same problem and would like very very much to know how to solve that ...
thanks
How to install framework?
Press Thanks on getting Helped by me
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