For some time I've been generating signed .apk files in Android Studio and then I was sending generated .apks to other people. Usually they were changing certificates of the apps.
Right now they can't do it, because every time I generate an apk in Android Studio it's locked for modifications and acts like read-only file. Is there a way to somehow disable that restriction in Android Studio or Gradle settings?
In Windows CMD the only attrib of generated and signed .apk file is an 'A'.
Related
I'm developing an android application with react-native (0.59), and I want to test it on different devices. My goal is to create an .apk file that can be installed by simply transferring the file, without any requirement for development server running, usb cables, etc..
I have looked at different reply on previous questions about the subject but so far nothing as worked.
This reply still needs a dev-server to run: How to generate dev APK file without asking for dev settings server ip in react native
This reply generate an apk that won't install on the device with the error "app not installed": Build and Install unsigned apk on device without the development server?
I have tried the publish method from the react-native docs (ref: https://facebook.github.io/react-native/docs/signed-apk-android), I generated the .aab file, then I use bundletools to convert it with apks, as explained here: Generate Apk file from aab file (android app bundle) in this answer:
So far nobody has provided the solution to get the APK from an AAB.
This solution will generate a universal binary as an apk.
Add --mode=universal to your bundletool command (if you need a signed
app, use the --ks parameters as required).
bundletool build-apks --bundle=/MyApp/my_app.aab
--output=/MyApp/my_app.apks
--mode=universal Change the output file name from .apks to .zip
Unzip and explore
The file universal.apk is your app
This universal binary will likely be quite big but is a great solution
for sending to the QA department or distributing the App anywhere
other than the Google Play store.
But unfortunately in my case, when I open the .zip file, there's no file called universal.apk:
All the .apk are pretty small in size (around 10mb, while the .aab file is 300).
Is there any other solution?
After you go through https://facebook.github.io/react-native/docs/signed-apk-android you can simply run
// for build and run
react-native run-android --variant=release
and take apk in
<rn_project_dir>/android/app/build/outputs/apk/release/app-release.apk
I've been learning programming on Android Studio and already have an app about to publish. Some points are missing for trying to learn by myself and my question may sound silly.
3-4 months ago I generated my first signed apk. Since then as I developed my app, sometimes I generated apks to test my app. When I was generating signed apks keystore file (jks) path
was remembered and I quickly click forward button to generate signed apk. The location of my jks file was "C:\Users\Me\AndroidStudioProjects\MyApp\feature\build\outputs". After Android Studio update I can not generate signed apk with this key. Whatever I do, they all end with "No key with alias '....' found in keystore C:\Users\Me\Desktop\"
Keystore path is always seems as desktop. I can not change it. When generating apk I already select my existing keystore path but Android Studio always looks for keystore file on desktop.
Another problem is alias name mentioned in the error message is different my existing alias name. Android Studio looks wrong place and wrong alias name. So why is Android Studio acting like this? How can I generate a signed apk again?
I have re-signed all system apps of LineageOS with my own key and have replaced them all before the first boot. LineageOS boots normally but then all re-signed system apps crash with an error like:
SystemUI stopped, Settings stopped.
It seems that the re-signed system apps are unusable. Maybe I made some mistake or LineageOS has some anti-tampering check implemented?
What i have done:
I opened all system apps with the winrar zip manager and removed the CERT.RSA and CERT.SF files in each META INF folder and deleted all the names and SHA-256 digest entries in all MF manifest-files. Also all other apk for example, in the framework folder, like the framework-res.apk file, I edited them like this. Then I created a keystore with Key, using the Java keytool, I think this is self-signed. Then I signed all APKs with the Uber Apk signet tool and successfully performed zip-aligning. Then I flashed Lineage OS with TWRP on the phone. Before the first boot, I deleted the system apks with the TWRP file manager and replaced them with my self-signed ones.
Uber-Sign-Tool: https://github.com/patrickfav/uber-apk-signer
Picture of the error: https://imgur.com/a/hAwsJuO
Thanks for your help
Mike the android-noob
I am developing an android application. All the things is going well when I run the application into genymotion virtual device.And Since the apk is stored in F:...\app\build\outputs\apk location. So I just want to collect it from this location and download it to install in a android phone.As I simultaneously updating the application with code but this apk doesn't provide me the updated apk file according to the updated code .They just give me the old apk file even if i run my application again and again from the android studio. Can anyone suggest me why this is happening ??? I just want to run this apk into phone or download this apk file for another purpose.
This three steps will do Go build->Build apk
Go to Build > Build APK to generate a normal APK.
Go to Build > Generate Signed APK to generate signed APK.
Signed APK are those which we generate to release our application. Here it is, why is it necessary to generate signed APKs: Why should I Sign my Application APK before release
If you build a debug APK, it will still work on all devices but you cannot release it.
From terminal run the following command to make sure that you get the updated apk.
1. gradle clean (from windows )
-or-
./gradlew clean (from linux) -
Above command deletes the build folder.
2. gradle build (from windows)
-or-
./gradlew build(from linux)
Above command builds all the flavor for your application.
Edit: Original answer
Signed apk is needed to install in any other non debug device. This will be same as the debug app that runs in your test device/emulator.
Build -> Generate signed apk
If i use the .apk file that is in the bin directory in the project in the workspace instead of generating the .apk by exporting the project does it make difference?
The apk file in the bin is signed using the debug key, which loses the benefit of signing your App. Your App should be signed using your own key (which is specified when you export the project) which kind of uniquely identify your Apps and protects (or tries to protect) your Apps from having someone alter your App and republish it. Also, when you upload an update for your App, it must be signed with the same key as the original App, so make sure to keep this key safe.
You can use the apk from the bin folder while debugging, but when publishing the app, you must export a signed apk, or sign the one from the bin folder manually.
However, an easier method would be to directly debug on a hardware device from eclipse, as this gives you access to various tools like the adb and LogCat, See this link for details.