[Q] Help me in changing Package name of Settings.apk - Android Q&A, Help & Troubleshooting

Please can anyone tell me how can I change package name of com.android.settings to something else..I have edited the manifest file but after recompiling it gives me a bunch of errors...i want to install two Settings.apk 1st id original Stock Settings.apk and another GB Settings.apk which I obtained from source system.img but both have some errors and when I try to open something it gives me FC's Something works and something doesn't So if i have installed both the apk i can redirect bu editing apk files so i will not have any errors or FC's plz help me..
can I do this using another method..??? if yes plz tell me how..

vaibhavcoolm said:
Please can anyone tell me how can I change package name of com.android.settings to something else..I have edited the manifest file but after recompiling it gives me a bunch of errors...i want to install two Settings.apk 1st id original Stock Settings.apk and another GB Settings.apk which I obtained from source system.img but both have some errors and when I try to open something it gives me FC's Something works and something doesn't So if i have installed both the apk i can redirect bu editing apk files so i will not have any errors or FC's plz help me..
can I do this using another method..??? if yes plz tell me how..
Click to expand...
Click to collapse
Package name is actually coded in its java source files, and just changing the name in xml files gives errors. And I guess its package name references to other core Android system files, which in this case if its renamed somehow will break other features. So I guess, its pretty much not possible to change the package name from com.android.settings to some other.

Related

newbie question -de/recompile androidmanifest.xml

OK, I've been working on my rom and for the most part its actually going really well - I've got it working fast, gsync is working, blah blah
I've run into a permission problem though, and I need to edit HTCDialer.apk's AndroidManifest.xml file to include a new permission line. Sadly, I haven't figured out how to do this on my own (I've been android devving for about 2 weeks now... maybe 3, i forgot haha).
How do I decode those androidmanifest.xml files?
Secondly - I've also tried making other changes to .apk files and using autosign.bat to resign them, but half the time my changed apk's never work. The apps just don't work or appear in my app list, and logcat says something about apk uid signatures not matching, so I ran "fix apk uids" from recovery but that didn't help either. i don't think my apk changes are being signed properly.
Is apktool what you're after?
YES! OMG thank you. I had thought they were just .dex'd xml files so I tried baksmali but I kept getting top level errors. apktool worked perfect for me, got apst whatever baksmali error I had and did it just fine. You're awesome, thanks!
Aeltrius said:
YES! OMG thank you. I had thought they were just .dex'd xml files so I tried baksmali but I kept getting top level errors. apktool worked perfect for me, got apst whatever baksmali error I had and did it just fine. You're awesome, thanks!
Click to expand...
Click to collapse
could please help me?
i would like to decode a exisisting apk to edit the androidmanifest.xml just a little bit to my personal need. somehow the apk tool just leads to an error everytime. when i just unpack the apk and edit the xml-file its of course crypted.
could you give me a explanation of how to just edit the androidmanifest.xml of an exisiting apk and package the apk again?
apktool d name.apk out
(now edit the androidmanifest.apk in out directory)
apktool b out
now you have to SIGN the out.apk that is in /out/dist directory

[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] 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.

[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

How to edit an APK name ?!

as I asked .. if I want to edit tha name of any apk .( sure I dont mean the file name ) ,, I mean .. the name that show up when you install it
for example : .. there is a CAM Mod .. and I dont want to flash it from recovery ( cuz if I do that ,, it will be the only app for camera ) .. and I dont want that .. but when you install it as APK .. you will get the 2 apps and you are free which one you want to use
BUT .. if the app is named ( Camera ) .. you cant install it .. cuz there is already an app with that name ..
any one got what I mean ??
use apktool to extract the apk, edit the manifest.xml and change the package name in there. then rebuild the APK with apktool and sign it. (you may be able to just use 7zip to extract the manifest.xml from the rebuilt app and then put it in the original, signed app, overwriting the one there, to avoid having to resign it [which is a pain to get your computer set up for if you haven't done it before, especially if you don't intend on doing it often again], but I am not 100% sure).
SifJar said:
use apktool to extract the apk, edit the manifest.xml and change the package name in there. then rebuild the APK with apktool and sign it. (you may be able to just use 7zip to extract the manifest.xml from the rebuilt app and then put it in the original, signed app, overwriting the one there, to avoid having to resign it [which is a pain to get your computer set up for if you haven't done it before, especially if you don't intend on doing it often again], but I am not 100% sure).
Click to expand...
Click to collapse
ok thanks .. but .. actually i dont know how to do that .. I didnt fine any file named ( manifest.xml )
could any one explain that please ?
EDIT :.. I edited that file but when I ( recompiled ) it ... it was just 1 KB ...
!!!
apk rename
all u need to do is put you sd in your computer and rename it that way.that is what i do
man ... are u kidding .. LoL
what will change if I renamed file name ?!!
zac1256 said:
all u need to do is put you sd in your computer and rename it that way.that is what i do
Click to expand...
Click to collapse
joanjoan_10 said:
man ... are u kidding .. LoL
what will change if I renamed file name ?!!
Click to expand...
Click to collapse
Changing the name of the file will do nothing. When the app is installed, it'll still have the same name (file name of the APK doesn't matter at all).
EDIT: As for how to do this, use apktool to unpack the app. Open "AndroidManifest.xml" and look for something like the following (in this example, I am using a manifest from Canabalt):
Code:
<application [COLOR="Red"]android:label="@string/app_name"[/COLOR] android:icon="@drawable/icon" android:name=".CanabaltApplication" android:debuggable="false">
The important one is the red one. Sometimes it will say something like android:label="Canabalt HD", in which case you'd just change it to what you want, and then rebuild it with apktool, but in this case there is an @ at the start of the name, which means that the name is stored in another file. As it is "@string/app_name", this means that the name is stored in the file "res\values\strings.xml" and has the name "app_name", so go into the folder "res", and then within that the folder "values" [if you use another language on your phone than the app's default language, go into the relevant folder e.g. for Spanish, you would go into "values-es" instead] and then within that open the file "strings.xml". Then you would look for something like this:
Code:
<string name="app_name">Canabalt HD</string>
Change this, save the file and then rebuild the APK with apktool. Afterwards, you'll need to sign the APK. Otherwise, it MAY be possible to take your edited APK, open it with 7zip, extract the file "AndroidManifest.xml" (or whatever file you edited e.g. strings.xml), then open the original APK with 7zip and replace the AndroidManifest.xml (or whatever file) with the modified version, and then not have to sign it. I haven't tried this though.
Also note that if there is an @ in the AndroidManifest.xml, you can still just edit the title in that file without finding the relevant entry in another file. In my above example, if I wanted to change the name to "Canabalt MOD", I'd change it to the following:
Code:
<application [COLOR="Red"]android:label="Canabalt MOD"[/COLOR] android:icon="@drawable/icon" android:name=".CanabaltApplication" android:debuggable="false">
The difference is basically doing it this way, it won't change for other languages, it will ALWAYS be "Canabalt MOD", regardless of the language of the phone. If you're just doing this for yourself, that probably doesn't matter, so it's simpler to just change it in AndroidManifest.xml.
Actually .. now I know that im noob
could u just try to reaname this app to any other name
I tried what u said but it didnt work
Try this, should show up as "HTC Camera"
SifJar said:
Try this, should show up as "HTC Camera"
Click to expand...
Click to collapse
ok .. thanks alot for ur job ... it is named like u said
bit ,, i still get ( its a system app .. do u want to replace )
joanjoan_10 said:
ok .. thanks alot for ur job ... it is named like u said
bit ,, i still get ( its a system app .. do u want to replace )
Click to expand...
Click to collapse
Need to change the package name as well as the label I guess, I'll do that tomorrow, don't have much time right now I'm afraid.
ok
Forgot about this yesterday, but I remembered now, so here it is
SifJar said:
Forgot about this yesterday, but I remembered now, so here it is
Click to expand...
Click to collapse
tahnks alot for remebering ,,, yea its new name now ,,,
but it cant be installed maybe its like a system app
any way .. the name is changed .. thanks for that
I forgot to resign it after editing, let's try again :fingers-crossed:
Should work this time.
Yea .. now it is installed
Hi SifJar. Could you do the same thing for whatsapp.apk? I've tried but with no luck :fingers-crossed:
extract apk
Apk Name
Could you please help with switching name of chompsms.apk? Thanks
ajeesh vijayan said:
extract apk
Click to expand...
Click to collapse
SifJar said:
Changing the name of the file will do nothing. When the app is installed, it'll still have the same name (file name of the APK doesn't matter at all).
EDIT: As for how to do this, use apktool to unpack the app. Open "AndroidManifest.xml" and look for something like the following (in this example, I am using a manifest from Canabalt):
Code:
<application [COLOR="Red"]android:label="@string/app_name"[/COLOR] android:icon="@drawable/icon" android:name=".CanabaltApplication" android:debuggable="false">
The important one is the red one. Sometimes it will say something like android:label="Canabalt HD", in which case you'd just change it to what you want, and then rebuild it with apktool, but in this case there is an @ at the start of the name, which means that the name is stored in another file. As it is "@string/app_name", this means that the name is stored in the file "res\values\strings.xml" and has the name "app_name", so go into the folder "res", and then within that the folder "values" [if you use another language on your phone than the app's default language, go into the relevant folder e.g. for Spanish, you would go into "values-es" instead] and then within that open the file "strings.xml". Then you would look for something like this:
Code:
<string name="app_name">Canabalt HD</string>
Change this, save the file and then rebuild the APK with apktool. Afterwards, you'll need to sign the APK. Otherwise, it MAY be possible to take your edited APK, open it with 7zip, extract the file "AndroidManifest.xml" (or whatever file you edited e.g. strings.xml), then open the original APK with 7zip and replace the AndroidManifest.xml (or whatever file) with the modified version, and then not have to sign it. I haven't tried this though.
Also note that if there is an @ in the AndroidManifest.xml, you can still just edit the title in that file without finding the relevant entry in another file. In my above example, if I wanted to change the name to "Canabalt MOD", I'd change it to the following:
Code:
<application [COLOR="Red"]android:label="Canabalt MOD"[/COLOR] android:icon="@drawable/icon" android:name=".CanabaltApplication" android:debuggable="false">
The difference is basically doing it this way, it won't change for other languages, it will ALWAYS be "Canabalt MOD", regardless of the language of the phone. If you're just doing this for yourself, that probably doesn't matter, so it's simpler to just change it in AndroidManifest.xml.
Click to expand...
Click to collapse
thx... i try find, but not found... Help me pizz
GuardDemon said:
thx... i try find, but not found... Help me pizz
Click to expand...
Click to collapse
If it's an Android app, I am fairly sure it must have the title stored in this manner. Try opening the XML file and pressing Ctrl+F to search within the file and search for "android:label" (without quotes).

Categories

Resources