I need to import my apk into eclipse - possible? - java

I am an app developer, and I recently had to re-install windows, so I lost all of my app data :(
I have the apps on the market, so can get the APK's, but my question is:
Can I decompile them back into eclipse, or will I have to re-make them from scratch?
Thanks for your answers, Liam

Unfortunately, there's not any way to get your source code back from just an apk.
I highly recommend in the future using a source control management system (I use git) and back up online (I use bitbucket).

I doubt very much the APK contain your source, unless you configure your build to include them. So no, you can decompile each class and reconstruct some of the code, but chances are, u have to rebuild from scratch.

Related

Linux Version of Eclipse is freezing when trying to open binary files (with .bin extension)

I had tried opening binary files of size 32MB. Eclipse (in Linux version) is freezing and I'm unable to perform any other operations (because of this hang in the Eclipse product).
I'm not even able to run other processes (like Task manger to exit the Eclipse IDE) which forces me to re-boot the system.
It seems that there is a problem in a particular plugin that you are using in your product, and that it is affecting your users.
If the plugin developer isn't helping you, your options are limited:
You could "bug him" about it ... but this probably won't help.
You could offer him (or someone else) money to fix the problem.
You could try to find and fix the problem for yourself (assuming that the plugin is open source).
You could identify an alternative plugin with the functionality you require.
You could implement a replacement plugin yourself ... or pay someone else to do it.
From the technical perspective, I doubt that we can help you unless you explain in depth what the nature of the problem is, and what you have found. On the face of it, it sounds like a scalability issue; i.e. the plugin is using an SWT widget that does not work with huge files. If that is what the problem is, then the technical solution is probably to use the widget in a different way ... that avoids the issue.
Opening 30Mb binary files in an editor is kind of pathological.

replace android studio project and keep signature

I've been working on this project for months, and when I started out I knew nothing about android dev, gradle or signatures. Since Android studio was also quite new when I started in June, and updates often brought errors in the gradle, the code is a bit messy.
Now, I've been trying to get the new support library imported into my project - without success. Re-importing the project seems to fix this nice and easy, but this means I have to replace the old project(package anomaly). My question is, since this app is already deployed, will I loose the old signature and with it the possibility to update the app on Google Play store?
Hope to hear from ye! Thanks.
[EDIT]
Yep, worked like a charm :) Thank you Samuel!
If I am answering the question I think you are asking, can you change the package name and still upload the application as "updates" to one that is already in the market the answer is no.
Once an application is uploaded to the market, pretty much everything can change except the key and the package.
As long as you still use the same signature and key then you should be able to compile with different things and still upgrade successfully. I highly suggest compiling what you have now and trying to upgrade it in the app market and that will very quickly determine whether or not it is possible. If you do this post back on this post if it worked or not for everyone else to see

Recover corrupted java file

I tried to reimport my android project on eclipse to solve a problem but I accidently overwrote all my files in the project. All of them had been corrupted which means their size is now 0B...
I tried to use Local History but it's useless since my project is no longer in my workspace, same for .metadata.
I also tried to use Recuva (Software for recovering files) which see my files with their real size but when I try recover them, their size is always 0B...
I lost about 7 days of work and I don't really want to rewrite my code using Java Decompiler...
So my question is, is there any solution to recover that files ?
I wrote 200 lines of code and suddenly system restarted. I lost all code. But I recovered data from eclipse's local history. Right click on the file -->replace with-->previous from Local History
Eclipse has a local history, although by default it's set very low - one of my first tasks when setting up a new development machine is to up the values (in addition to my other version control)
If you do have a history you can right click on your class, and select compare with local history.
You could try decompiling with something like JD-GUI. It might not be as onerous as you think. Obfuscators exist for a reason.
It is not really programming question, but i had similar situation and "Mini Tool Power Data Recovery" tool helped me (it is paid tool, free version exists, but maybe you can search in this direction and find something open source). I tried some another tools then, but with no results.

How do you back up an android app?

I just had my app crash and now after alot of work its back to were I had it, I was wondering how would I back up the app so I can reInstall is again if this ever happens again?
u should use a version control system, example: git version control
http://git-scm.com/
happy coding!
use a version control system.. like svn or git ... in any case even if you were not using this, you should have taken backup of your code regularly... these version control system manages this for you easily...
This question is not specific to Java or Android, but rather, how to "backup" code properly. As others have already mentioned, you should be using source control systems such as Git or Subversion. Not only will this "backup" your code, it will allow you to track the changes you make to the code as well as maintain multiple versions of your code.

Replacing/Rebuilding framework.jar in Android Source

This could be a rather crazy question, but I wanted to get some insight on it before I spend all the time trying it.
Is it possible to rebuild framework.jar (like say pulling the framework.jar from MIUI), decompile it to smali and then rebuilt it from scratch (via reading through and remaking it yourself into java)?
I planned on doing that + taking the similar files from Cyanogen mod as a reference to build off of. The reason I was interested in doing all this was because I have a phone that needs the Radio Interface Layer more or less rebuilt and it's just become too much of a hassle to deal with editing the smali directly and debugging it.
I figured I would ask here because people would be less quick to rush to judgment on whether it was possible or not. I don't see why it wouldnt work if you are adding everything correctly (in theory) and rebuilt the classes.dex file in the source after.
Main reason I am asking is part of an effort to port MIUI to my phone. I figured the lesser of too headaches was rewriting the java and rebuilding a working framework.jar (which has parts in it that are not in the CM7 or AOSP sources) than editing the framework.jar that comes with MIUI to work correctly.
While there are various ways to decompile a dex file back into java, none of them will produce java that is perfectly compilable. You would have to spend tons of effort cleaning up the java code from a decompiler, to get it to compile. It's pretty much not an option for something as big as that.
Your best bet is to get something like AOSP or CM working on your phone, so that you can build the framework yourself directly, with whatever modifications you need.

Categories