How to restore the content of .android folder? - android

I am working for a React-Native project and using MAC.
I have accidentally deleted .android folder. Then I completely deleted Android Studio and installed once again. Now, .android folder is created automatically, But still some content seems missing like keystore files. Due to to this I am unable to create Signed Bundles.
Is there any way to have keystore files inside .android folder?
By the way I have a copy of keystore files inside <root>/android/app/ location.

.android folder is auto-generated. That means that you should not store anything that is not autogenerated in it(especially keystore files). It should not be subjected to version control also.
The official and correct way to have it as you want - is to have a separate not autogenerated android folder that can be put under version control. I can see that you have it like that already which is good.
To build your signed bundles and apk files you should set up a correct path to your keystore(from /android/app/) in your build.gradle file in the signing config section - here is the official info about how to do it.
About how to restore .android content - if you had no version control there or any other snapshot - you cannot restore it. You can tweak its content a bit via the general project/ide settings but that is it.

I'm no expert but.
It seems that it didn't uninstall the software entirely.
Try
Updating the Android Studio
Or Reinstall it again
Or Install the Nightly Build/Developer Release I reckon that there is no builds for mac.

Related

Where can I find the default location for keystores created by Xamarin Android in Visual Studio?

When I archive an Android app, then distribute it, I'm given the option to create a keystore. Once I create it, where does it go by default?
In Visual Studio, Xamarin lets you create the keystore when distributing. However, it doesn't make it clear where exactly it puts it.
I found it in:
C:\Users\yourusername\AppData\Local\Xamarin\Mono for Android\Keystore\
There are many folders in there, generally matching the names of the distribution profiles you seen when archiving Android packages in Visual Studio.
I found my keystore files in those folders.
You can also do a search in that folder for the keystore name and find it relatively quickly.
Good luck!
You can find them in C:\Users\yourusername\AppData\Local\Xamarin\Mono for Android\Keystore
You can simply click on Open Folder Below Distribute while Archive the Apk.
From there you can simply found Mono for Android in above Folders From there Go to Key store and you can find Respective Project Key store files

Is it ok to delete old .apk after renaming the project?

I renamed the project successfully but now there seems to be having two .apk files. Do I have to keep the old .apk? . Currently my new .apk file has no errors. Will it corrupt later?. Or if I remove it will my project be still fine forever? I have a long term usage idea for this project so what is best to do.
But keeping the old name.apk is like keeping garbage I need a clean project... What can I do? And how this affects when I need to sell application in Android market.
Delete the old .apk file, it only because you rename your project, so it generates a different file.
Google Play (Android Market) will see it as a new app if you change the package name.
If you haven't already uploaded the original version, yes, you can just delete your local .apk.
delete bin and gen folder to clean up with old built data.it will be built again automatically if you have checked true in front of Build automatically option in Project tab.

Where does Eclipse ADT store the default keystore path?

I have a slightly embarrassing problem:
I have an Android app on the store for which I'd like to push an update. My problem is that I've changed computers and now I can't find the keystore used to sign the App.
I most certainly have the file (and private key) as I have a full backup, but my problem is that I can't find the file in it (and cannot remember what I've named it in the first place).
What I would like to know is how I can track this file, either through some fulltext search for headers or by checking the (old) eclipse and/or android configuration files for a path to the file (since it Eclipse had already the path to the keystore everytime i built, it must be saved somewhere...)
I'm using Mac OS X (at the time, Snow Leopard)...
Thank you all for you time
EDIT:
I've partially answered my own question: Couldn't find the config file where Eclipse ADT caches the keystore path, but found out the Eclipse ADT on Mac OS X saves keystores by default in Eclipse.app/Contents/Mac OS (yes, inside the .app package) ... probably a oversight regarding "current directory", but silly nonetheless...
its may in
C:\Users\nainit\.android

Can an APK be repacked after a minor text edit?

I'm creating a software that will guide the user through a few steps, to publish an android application (APK file).
The way I am doing this, is that the APK file is already compiled, and all I need to do is replace an XML file in the package, and that will change the behaviour of the application. My big problem now, is that unpacking the apk file, and doing any tiny text edit, and then packing it again, breaks the signature and prevents the application from running on any device, giving a message that the signature is incorrect.
How can I solve this? I want to safely open the APK, write something in a text file, and close it again. Note that this operation will be done on the user's computer (after he purchases our application) so we're look for a command-line tool with no special requirements like JDK.
Any help?
Ok I reached the best "tested" solution - I'm posting it here to save other developers hours of googling. The only downside is that I will require the customer to install JDK on his machine, unfortunately. The reason is because I did not find any apk-signing tool that works purely on windows, without relying on JDK.
I have my android application created using Air, so this makes things easy for me - all of the air files are treated as resource assets. So have your APK archive file ready.
Once you have your modifications ready, put them inside a temporary folder named "assets". You will use the 7-zip command line tool (free: http://sourceforge.net/projects/sevenzip/) to update the contents of your apk. To have it working with your apk you will have to rename your apk's extension to zip - don't worry, you'll change it back later.
Now from a .bat file (or directly in the command prompt) from the location containing both your apk file (zip extensioned) and your assets folder, you'll call: 7za u APK-file.zip assets
Now your apk file is updated. Rename it back to .apk extension
Now you'll use the signAPK tool from here https://code.google.com/p/signapk/ and note that this is the only step requiring JDK installed. It also assumes that you have your key files ready (replace the dummy ones included in the package). Extract the file contents and call: java -jar signapk.jar key.x509.pem key.pk8 [android_app].apk [signed_android_app].apk
At the very end, you may find your signed apk file size drammatically increased. So you need to use the android's zipAlign tool: (darn, can't post the link since new users can only post a maximum of two hyperlinks)
you will be calling the command: zipAlign -c 4 [signed_android_app].apk
And voila! That's the route I'm taking.
If someone finds a way to do the signing process without relying on JDK (assuming the key files are ready) please share.
How can I solve this?
You don't. If you modify an APK file, by any means, it must be re-signed.
Android apk files must be signed. That signature proves that the contents of the apk have NOT BEEN MODIFIED from what was initially published. (Which is exactly what you are doing.) The signature at the same time, also proves who the author is.
So in a normal signed apk file:
You know who the author is. (Even if it's not something you as a human can understand.)
You know the contents were put there by the author, and not modified since.
This is a key security measure built into Android, is there for very good reason, and cannot be overcome. It prevents things like viruses from being embedded inside innocent apk files.

Keystore Eclipse ADT file location

I have developed and released an app on the Android Market.
I compiled the release, signed and zipaligned with Eclipse ADT export.
This process created a Keystore for me in the wizard.
The steps i took are detailed in the Android dev guide.
I want to know, Where does the newly created keystore reside? I want to take it and reuse on another project but i am not sure where i can find it.
I thought it would be named something like my-release-key.keystore but i cant find it.
Sorry if this comes out as a dumb question but i am quite new to this and is a wearied thing to get stuck on.
Edit:
I used the Eclipse ADT Wizard and in there i entered the location as follows...
I am developing on a Mac and a very new mac user. I just dont know where this file has been placed. It i not in the project folder or the "cd /" location.
Thanks
OK, I found out the Eclipse ADT on Mac OS X saves keystores by default in Eclipse.app/Contents/Mac OS :-(
When using eclipse wizard you can explicitly set keystore destination folder. But if you didn't do it (in your case), eclipse will save new key in your home directory.
You should manually create it with keytool. This step described in Obtain a suitable private key part of the guide.
Basically in windows(Checked in Window 7) the release_kestore stores by default in C:\Users\xyz\release_keystore. Then we have to move it to our comfortable place.

Categories

Resources