Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get previous code in android studio [closed]

Tags:

java

android

Hey i have this issue where I first created an app, put it on playstore and then i tried to integrate google adsense into it later. I had to change some code in the build file which has now completely ruined my project and i can't even revert back my changes since i had closed android studio.

I've spent hours trying to fix the code but it just wouldnt work. I need to see what have i done wrong. In the previous version it was working fine. Is there any way to see the code in the previous apk? or reset changes or anything like that in android studio?

like image 782
AxeManTOBO Avatar asked May 28 '16 18:05

AxeManTOBO


People also ask

How do I roll back an Android Studio project?

Switch view to Android in the left part of the Android Studio, right-click the app node, Local History , Show History . Then find the revision you want back, right click it and choose Revert . Your whole project will be reverted to this state.

How do I get my activity back on android?

You opened the new activity from another activity with startActivityForResult. In that case you can just call the finishActivity() function from your code and it'll take you back to the previous activity.

How do I revert to an older version of Android Studio?

Currently there is no direct way with which a downgrade can be done. I managed to do the downgrade by downloading Android Studio 3.0. 1 from here and then running the installer. It will prompt whether to uninstall previous version, and when you allow and proceed, it will remove 3.1 and install 3.0.


2 Answers

Android Studio has a code history feature which allows you to see previous versions of a corresponding file. Just right click on a file in the IDE's file explorer and you will see this option.

like image 143
Ukubu Avatar answered Oct 14 '22 08:10

Ukubu


Right click the file in android studio, Local History -> Show History. Maybe you can see old version of file.

If not, here is the certain solution: download old apk from Play store, use Dex2jar to decompile old .dex file and see codes with JD-GUI.

Or you can use Jadx too.

like image 27
Ozgur Avatar answered Oct 14 '22 09:10

Ozgur