Android package file name

3 Methods To Change Or Rename Android App Package Name in Android Studio

Sometimes, we make our app using the code from youtube tutorials and blogs and may forget to change the package name at the start. Yes, this happens, most of the time.

We don’t want to display other website name or Youtube channel name to be as our package name, We want a package name that defines us. If you are searching for a tutorial about how to change or rename the Android app package name in Android Studio, then this post is for you.

Method I – How to rename android app package name in Android Studio

In this example, we will change package name com.androidride.myapplication” to “com.xyz.yourapplication”.

STEP 1

  • Open Android Studio project, Select package name or Java, Click the gear icon.

STEP 2

  • Deselect Hide Empty Middle Packages. This breaks your folder structure into parts.
  • The package is brocken down.

STEP 3

  • Right Click on AndroidRide, Refactor -> Rename . You can also use Shift + F6.

A warning will appear.

STEP 4

  • Click on Rename package

STEP 5

    Clear AndroidRide and put new Name in it. Here “xyz”

STEP 6

  • Click Do Refactor

STEP 7

  • Repeat the same process.
  • Right click on myapplication,Refactor -> Rename and Rename package.

STEP 8

  • Change myapplication to yourapplication

STEP 9

  • Click on Do Refactor.

STEP 10

  • After changing the package name, open build.gradle(module) and change Application Id

STEP 11

  • change applicationid “com.androidride.myapplication” to “com.xyz.yourapplication”.
  • After changing applicationid, click on sync now.

Method 2 – How to change full package name of project by creating new package

In this method, We are going to change package name “com.androidride.myapplication” to “info.xyz.yourapplication”

STEP 1

  • Right click on com.androidride.myapplication package and select Refactor->Move

STEP 2

  • Choose Move package “com.androidride.myapplication” to another package and click on OK.

STEP 3

Now you will get a warning dialog shows Multiple directories correspond to package com.androidride.myapplication

  • Click on Yes

STEP 4

    Enter the new package name except the last level, For example. If you want to make package name as “info.xyz.yourapplication” then type “info.xyz” only, like above. Avoid the last part, here “yourapplication”.

Читайте также:  Виджет калькулятор для андроида

STEP 5

  • Click YES for creating new package.

STEP 6

  • Click on Do Refactor. Now package name “com.androidride.myapplication” changes into “info.xyz.myapplication“.

STEP 7

Now we have to change the last package level name,

  • Right click on package name -> Refactor -> Rename

STEP 8

  • Click on Rename package

STEP 9

    Rename “myapplication” in to “yourapplication”.

STEP 10

  • Click on “Do Refactor”

STEP 11

  • Use CTRL key and select each package related to old package name and delete. You can use DELETE key in keyboard or right click after selecting old packages and click on delete option from the menu.

STEP 12

  • Open build.gradle file, change applicationId and Click on sync now.

Package name successfully changed to “info.xyz.yourapplication“.

Method III – How to rename android app package name in Android Studio using existing package

This method is also same as the second method. Just like second, we change package name “com.androidride.myapplication” to “info.xyz.yourapplication“.

STEP 1

    Right click on Java and select New -> Package

STEP 2

  • Next dialog box appears, choose …app\src\main\java as Destination Directory.

STEP 3

  • Enter your package name, here info.xyz.yourapplication

STEP 4

  • Now move old package files into new package. Here move files from “com.androidride.myapplication” to “info.xyz.yourapplication“. Just use CTRL key to select all files and drag it to new package.

STEP 5

  • Open AndroidManifest.xml and change package name into “info.xyz.yourapplication

STEP 6

    Open build.gradle (Module: app) file, change applicationId also. Change it to “info.xyz.yourapplication” and Click on Sync now.Now you might get errors. It is due to the R file import. There are two scenarios, we can do.

      Remove R file import line from both files and check the error still exists. If not then you can delete old package files now

It’s done. You have successfully changed the package name.

Otherwise, If the error still exists, do the below steps.

STEP 7

  • Select R file import line just like above and press CTRL + SHIFT + R . Replace with new package name. Click on replace all.

STEP 8

  • Click on replace

STEP 9

  • Delete old package and related files

STEP 10

Yes, the package name is changed.

Express your thoughts below and tell your friends about this post. Thank you.

Источник

[HOW TO][GUIDE][MOD] Change Package Names of APKs

Xtreme.Ornob

Senior Member

But some of them can’t really do it because of proper Programming Skills and Development Knowledge!

So today I will show you how to do it! Without Programming Skills or Extra Development!

Caution: Only use this if the App is Open-Source and ask for Developer Rights before doing this!
I and XDA do not support Piracy! So don’t try to ruin Humanity by doing Piracy of Apps!
So This shall be Only Used for Learning and Development Purposes!

Requirements:
· A Brain
· Apktool
· An APK to Work With!
· PC/Android Device
· DroidEdit/Notepad++
· A Little Knowledge in DroidEdit or Notepad++​

At First Decompile your APK using a Suitable and comfortable apktool. Use Apk-Multitool/Virtuous or other Tools.
As you can see there are 2 files and 2 Folders inside Decompiled XVipreSetting.apk Folder.

Now Edit the Package Name and APK Name as You Desire—
For Example:

Save the File and Close apktool.yml
Now Open AndroidManifest.xml and Look for these lines—

Now Edit the Package name here—
For Example:

Now Navigate to /smali/com/xvipre and Do the Following
· Rename settings to app

· Go Back to /smali/com Folder and Rename xvipre to modded

Now It’s Time to Go Hardcore!!
Open Notepad++ And Press Ctrl+F to Open “Find”
Click on Find in Files
Now in Directory, Click on “Browse” or “…”

Now Navigate to your Working Folder and Select /smali/

Now Click on Find What: and Type Your Package Name! But Like This—

Click on Replace in Files

Now It Shall take up to 1-2 Minutes to Find and Replace all the package names in smalis!

When Done, Just Re-Check All the Files, Folder Names, Recheck AndroidManifest.xml to Find Another Line with Package name And Make Corrections Yourself!
Done for Now! Just Re-Compile and *SIGN* your Newly Created APK!!
Install the APK as User App! See if it Worked!
If you Like my Guide… Just Leave a little Thanks!

Comment if this guide has mistakes or I said anything Wrong, About Errors or Suggestions!

Written by Xtreme Ornob
Official Developer of XVipre ™

Thanks to
Google Inc.
XDA-Developers.
Mushfiqus Salehin (For giving me the Title of “Debeloper Sab” in Bangladeshi Groups)
Everyone Hail to Sadia Afrin Rumu for Teaching me the Usage of Android And Facebook Groups.

She’s an idol to me as she made me realize that I am a “Dim” and also a “Choto Pola” ​

marco2tiger8

Senior Member

Thx button pressed Thx for making this guide. June 2014, hmm still fresh :good:

bigrammy

Senior Member

Shahzeb5444

Senior Member

If I want to change it from com.xviper.settings

Xtreme.Ornob

Senior Member

Then You’ll have to make a Folder named «something» and put your activities (.smali) in there

For Example Create a folder like this /com/modded/app/*something*

Then Go Back to /app and Cut everything from there and paste into /something

Then Follow the guide from the top

barth2

Senior Member

Excellent tutorial. Thanks.

I like to add a couple of things

1) in some cases, you also need to change the package name in all *.xml under res/ not just in AndroidManifest.xml, because there may be layouts that refer to the package. In above example, you want to replace

com.xvipre.settings
with
com.modded.app

in all *.xml files under res/

2) You probably want to give the app a different name, too. In AndroidManifest.xml find

xxxx may be something like My Awesome App or @string/app_name. Just replace that with what name you want. This is the user friendly name that will appear in the home screen, app drawer, etc.

Someone coming across this may wonder what are concrete, LEGITIMATELY reasons to want to do this. I can tell you why /I/ did it.

a/ I have an app that does not support multiple accounts. I asked the dev to add it, and of course he was like okay I’ll think about it, which meant like never So I decompiled the app, made a new package name, and now I have a cloned app that has its own separate set of account and settings.

b/ I have another app that I made some mods to, for my own education and use. But I want to keep the original app for reference. Also, in case something funky happens in the modded app, I want to make sure I can reproduce the bug in the original app before I report it to the dev.

Matrixie

Senior Member

barth2

Senior Member

Sorry I don’t use snap chat so I don’t know. It must have some other wrinkle.

What do you see in the log cat?

D2Y aka E

Senior Member

[email protected]

Senior Member

Shaftamle

Inactive Recognized Themer

So you missed this paragraph??
Caution: Only use this if the App is Open-Source and ask for Developer Rights before doing this!
I and XDA do not support Piracy! So don’t try to ruin Humanity by doing Piracy of Apps!
There is nothing wrong with this thread. Threads don’t pirate apps. People pirate apps. Its called personal responsibility.

[email protected]

Senior Member

So you missed this paragraph??
Caution: Only use this if the App is Open-Source and ask for Developer Rights before doing this!
I and XDA do not support Piracy! So don’t try to ruin Humanity by doing Piracy of Apps!
There is nothing wrong with this thread. Threads don’t pirate apps. People pirate apps. Its called personal responsibility.

i_4_u89

Senior Member

But some of them can’t really do it because of proper Programming Skills and Development Knowledge!

So today I will show you how to do it! Without Programming Skills or Extra Development!

Caution: Only use this if the App is Open-Source and ask for Developer Rights before doing this!
I and XDA do not support Piracy! So don’t try to ruin Humanity by doing Piracy of Apps!
So This shall be Only Used for Learning and Development Purposes!

Requirements:
· A Brain
· Apktool
· An APK to Work With!
· PC/Android Device
· DroidEdit/Notepad++
· A Little Knowledge in DroidEdit or Notepad++​

Источник

Читайте также:  Убрать экран блокировки андроид xiaomi
Оцените статью