Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Android Market has just updated an app in my device. I liked the update, but its fully different from last version which was also my favorite. So, I want to keep last version too. I have last version's apk thanks to Titanium Backup. But, I can't install it without replacing current one (Android architecture sucks). Is there any way to do this? Hacks etc..
Note: I want to keep current version which must be connected with Market to receive future updates.

share|improve this question
add comment

4 Answers

up vote 13 down vote accepted

It can be done, but not simple for the reasons eldarerathis mentioned. You need apktool. Refer to this guide on how to use it. And this on signing the apk after you're done.

You need to modify the AndroidManifest.xml file. Find the line that looks like this:

manifest package="com.example.app"

and change it to something like:

"com.example.app.foo"

After you're finished, recompile then resign. To restore your data, try the following via adb:

adb rm /data/data/com.example.app.foo
adb push /data/data/com.example.app /data/data/com.example.app.foo

Where com.example.app is the package name of the original and com.example.app.foo is the modified.

There's always a slight chance that the app will break, or depending on the way the app is structured you may receive a dialog every time you change the screen prompting you to choose which app you want to launch, but it's definitely worth a try if you want it badly enough.

Of course, the two apps will not share the same settings and data.

share|improve this answer
2  
Great... I don't think it'd be subject to legal issues as I am not going to distribute/sell it.. Thanks! –  Sachin Shekhar Mar 19 '12 at 19:57
1  
It depends on your country. In Hungary it is legal to reverse engineer an app for learning/personal purposes but I don'T know about the rest of the world. But since you're not distributing anything you will not get in trouble. –  Richard Borcsik Mar 19 '12 at 20:25
add comment

You can't do this. Each Android application has a package name, which effectively defines the Java/Dalvik namespace that its classes occupy. You cannot have two packages of the same name installed because it would create overlapping namespaces, which is why it always replaces the old one when you install a new one. The only way you could feasibly do this is if you were able to get the source for the app and change all of the package definitions.

share|improve this answer
add comment

You could try repackaging the application. I once installed some edited version of a game and the result was two games. If remember good, package names weren't the same.

share|improve this answer
add comment

Sometimes, there are some references in executable library (.so), and changing package name (also smali -> classes.dex) does not help either.

In simple cases look for ApkEditor.

share|improve this answer
    
This is a good start, but doesn't explain what changes you need to make in ApkEditor. If you want your answer to be helpful, you might want to edit it to add a bit more information. –  Dan Hulme Aug 19 '13 at 22:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.