Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,785,371 Members 38,767 Now Online
XDA Developers Android and Mobile Development Forum

How to edit an APK name ?!

Tip us?
 
joanjoan_10
Old
#1  
joanjoan_10's Avatar
Senior Member - OP
Thanks Meter 30
Posts: 384
Join Date: Dec 2011
Location: Damascus
Default 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 ??
 
SifJar
Old
#2  
SifJar's Avatar
Senior Member
Thanks Meter 244
Posts: 586
Join Date: Jul 2009
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).
The Following 4 Users Say Thank You to SifJar For This Useful Post: [ Click to Expand ]
 
joanjoan_10
Old
(Last edited by joanjoan_10; 14th July 2012 at 07:23 PM.)
#3  
joanjoan_10's Avatar
Senior Member - OP
Thanks Meter 30
Posts: 384
Join Date: Dec 2011
Location: Damascus
Quote:
Originally Posted by SifJar View Post
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).
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 ...
!!!
The Following User Says Thank You to joanjoan_10 For This Useful Post: [ Click to Expand ]
 
zac1256
Old
#4  
zac1256's Avatar
Junior Member
Thanks Meter 1
Posts: 4
Join Date: Feb 2012
Location: pittburgh pa
Thumbs up apk rename

all u need to do is put you sd in your computer and rename it that way.that is what i do
The Following User Says Thank You to zac1256 For This Useful Post: [ Click to Expand ]
 
joanjoan_10
Old
#5  
joanjoan_10's Avatar
Senior Member - OP
Thanks Meter 30
Posts: 384
Join Date: Dec 2011
Location: Damascus
man ... are u kidding .. LoL
what will change if I renamed file name ?!!
 
SifJar
Old
(Last edited by SifJar; 15th July 2012 at 12:47 PM.)
#6  
SifJar's Avatar
Senior Member
Thanks Meter 244
Posts: 586
Join Date: Jul 2009
Quote:
Originally Posted by zac1256 View Post
all u need to do is put you sd in your computer and rename it that way.that is what i do
Quote:
Originally Posted by joanjoan_10 View Post
man ... are u kidding .. LoL
what will change if I renamed file name ?!!
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 android:label="@string/app_name" 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 android:label="Canabalt MOD" 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.
The Following 4 Users Say Thank You to SifJar For This Useful Post: [ Click to Expand ]
 
joanjoan_10
Old
#7  
joanjoan_10's Avatar
Senior Member - OP
Thanks Meter 30
Posts: 384
Join Date: Dec 2011
Location: Damascus
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
Attached Files
File Type: apk HTCCamera.apk - [Click for QR Code] (5.83 MB, 96 views)
The Following User Says Thank You to joanjoan_10 For This Useful Post: [ Click to Expand ]
 
SifJar
Old
#8  
SifJar's Avatar
Senior Member
Thanks Meter 244
Posts: 586
Join Date: Jul 2009
Try this, should show up as "HTC Camera"
Attached Files
File Type: apk HTCCamera_mod.apk - [Click for QR Code] (4.90 MB, 91 views)
The Following 2 Users Say Thank You to SifJar For This Useful Post: [ Click to Expand ]
 
joanjoan_10
Old
#9  
joanjoan_10's Avatar
Senior Member - OP
Thanks Meter 30
Posts: 384
Join Date: Dec 2011
Location: Damascus
Quote:
Originally Posted by SifJar View Post
Try this, should show up as "HTC Camera"
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 )
 
SifJar
Old
#10  
SifJar's Avatar
Senior Member
Thanks Meter 244
Posts: 586
Join Date: Jul 2009
Quote:
Originally Posted by joanjoan_10 View Post
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 )
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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes