Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

How to edit an APK name ?!

OP joanjoan_10

14th July 2012, 07:58 PM   |  #1  
joanjoan_10's Avatar
OP Senior Member
Flag Damascus
Thanks Meter: 30
 
384 posts
Join Date:Joined: Dec 2011
More
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 ??
14th July 2012, 08:02 PM   |  #2  
SifJar's Avatar
Senior Member
Thanks Meter: 245
 
588 posts
Join Date:Joined: 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: [ View ]
14th July 2012, 08:11 PM   |  #3  
joanjoan_10's Avatar
OP Senior Member
Flag Damascus
Thanks Meter: 30
 
384 posts
Join Date:Joined: Dec 2011
More
Quote:
Originally Posted by SifJar

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 ...
!!!
Last edited by joanjoan_10; 14th July 2012 at 08:23 PM.
The Following User Says Thank You to joanjoan_10 For This Useful Post: [ View ]
14th July 2012, 09:22 PM   |  #4  
zac1256's Avatar
Junior Member
Flag pittburgh pa
Thanks Meter: 1
 
4 posts
Join Date:Joined: Feb 2012
More
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: [ View ]
14th July 2012, 09:37 PM   |  #5  
joanjoan_10's Avatar
OP Senior Member
Flag Damascus
Thanks Meter: 30
 
384 posts
Join Date:Joined: Dec 2011
More
man ... are u kidding .. LoL
what will change if I renamed file name ?!!
15th July 2012, 01:29 PM   |  #6  
SifJar's Avatar
Senior Member
Thanks Meter: 245
 
588 posts
Join Date:Joined: Jul 2009
Quote:
Originally Posted by zac1256

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

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.
Last edited by SifJar; 15th July 2012 at 01:47 PM.
The Following 4 Users Say Thank You to SifJar For This Useful Post: [ View ]
15th July 2012, 03:42 PM   |  #7  
joanjoan_10's Avatar
OP Senior Member
Flag Damascus
Thanks Meter: 30
 
384 posts
Join Date:Joined: Dec 2011
More
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, 138 views)
The Following User Says Thank You to joanjoan_10 For This Useful Post: [ View ]
15th July 2012, 06:23 PM   |  #8  
SifJar's Avatar
Senior Member
Thanks Meter: 245
 
588 posts
Join Date:Joined: 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, 141 views)
The Following 2 Users Say Thank You to SifJar For This Useful Post: [ View ]
15th July 2012, 08:18 PM   |  #9  
joanjoan_10's Avatar
OP Senior Member
Flag Damascus
Thanks Meter: 30
 
384 posts
Join Date:Joined: Dec 2011
More
Quote:
Originally Posted by SifJar

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 )
15th July 2012, 08:26 PM   |  #10  
SifJar's Avatar
Senior Member
Thanks Meter: 245
 
588 posts
Join Date:Joined: Jul 2009
Quote:
Originally Posted by joanjoan_10

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.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes