Android App not displaying images from cloud Firestore in release build but works in debug build - android-studio

I recently finished building a wallpaper app. The app works fine in debug build, but not in release. I have added anonymous authentication to the app and the following rules in cloud Firestore:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if
request.auth != null;
}
}
}
Moreover I have added the release sha1 and sha256 keys to firebase and updated the json file as well.
Nothing seems to fix this issue.
The app displays the images properly here when I run it from Android Studio:
App doesn't work when I export it to Play Store and download. The images simply wont show up:

when you upload an app in android studio the SHA1 key changes. There are two types of SHA1 keys one is used for debugging and other is used for Release. In your case when you use App in android studio it will not give you error as you have entered in firebase the SHA1 key for debugging.
for Android studio you need SHA1 key for Release for which you need to go to the play console and select your app. Then under setup go to app integrity here you will find SH1 key. Enter that key in your firebase authentication.
Always check your apk on emulator after the Signed built before uploading on PlayStore.
you can also find the SHA1 release key in android studio in Terminal.
you will need keytool command for that.
To execute Keytool command you need to go to the directory of Android Studio where Keytool.exe file is placed. for that you need to search Android studio directory. For me it was in "C:\Program Files\Android\Android Studio\jre\bin". So i entered in that directory using command
cd C:\Program Files\Android\Android Studio\jre\bin
then use keytool command
keytool -list -v -keystore "C:\Users\Yah\Google Drive\Android\booksapp\booksappkey.jks" -alias key0
This is the place where jks file is placed which was used for generation of signed apk
you will be asked for the password that you always used to generate signed apk
and the SHA1 key will be displayed which will be same as used in google play console.

I found a fix it wasn't related to the keys at all disabling progaurd fixed my issue app works fine now looks like I need to create rules to let the app load images not sure but this is what worked for me.

Related

Signing an assembly in Visual Studio 2022

I am trying to write a simple console app in Visual Studio 2022 and then debug it. This would be so simple but the IT dept here have added a group policy that all applications must be digitally signed before they can be executed.
How can I sign the compiled executable file in order to run it in the VS debugger? I have a PFX certificate file but nothing I've tried seems to add a signature to the file properties in the exe file in the bin folder.
Thank you in advance.
I have tried:
Installing the certificate which was successful.
Generating a strong name snk file and ticking the option to sign the assembly which was successful.
Running the signtool in PS to apply the certificate which failed.
I would like to sign the executable as part of the build process in order to hit F5 and debug as normal.

Website2APK with Android

I'm relatively new to coding so I have a website that I wanted to convert to an APK to upload to Google Play, so as I'm relatively new I used the program website2apk, all that went OK so when I went to upload it to Google Play I had this error
"
Unoptimised APK
Warning:
This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimising your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower installation success rates and take up storage on users' devices.
Resolution:
Use the Android App Bundle to automatically optimise for device configurations, or manage it yourself with multiple APKs."
So I installed Android Studio and tried importing the APK and the build is greyed out.
So decompiled it and tried importing the project, However I try to import it I get this (see the screenshot: http://prntscr.com/o2aoak).
So from there I'm clueless on what to do as I have tried both options and both don't seem to work.
Then when I tried create project from existing files it said I need to migrate to Gradle and I don't know how to do that.

Automated conversion of aps-environment from development to production in Xamarin

In my Xamarin iOS project, Entitlements.plist has aps-environment set to development, for dev testing purposes. I'm using the Visual Studio Team Services Extension for the App Store to automate publishing builds to TestFlight. However, when it uses fastlane pilot to upload the app, I get this error:
ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, value 'development' for key 'aps-environment' in 'project' is not supported.
It looks like the environment should get switched to production when running the continuous integration build. How do I automate this?
Remove Entitlements.plist, and add Entitlements.developer.plist and Entitlements.production.plist. In iOS Bundle Signing, enter the corresponding plist file for Customer Entitlements based on the build configuration.
I have just removed aps-environment from Entitlements.plist without adding new files and it worked for me

Android Studio where is Master Password stored?

When you generate a APK in Android Studio you can secure the generation with a Master Password. Where in the filesystem is this password stored? I'm hoping I'm not committing this file in my project, i.e. and uploading it to Github:-)
The master password isn't actually stored, but it's used to encrypt the master password file, which lives in the security.xml file with your Android Studio preferences. That file contains encrypted versions of your keystore and key passwords if you check the "Remember Passwords" checkbox in the Generate Signed APK wizard; if you don't tell it to remember passwords, nothing is stored.
Where that file lives depends on your platform, but in general on Windows it will be in <User home>\.AndroidStudioPreview\config\security.xml, ~/Library/Preferences/AndroidStudioPreview/options/security.xml on MacOS, and ~/.AndroidStudioPreview/config/security.xml on Linux. See http://www.jetbrains.com/idea/webhelp/project-and-ide-settings.html for more information on where preferences are stored for IntelliJ; it's essentially the same for Android Studio.
You can find a little more information on the file in a SO question about trying to decrypt the file contents if the master password is known: Intellij IDEA - view saved password
For Android Studio version 1.0.2 on windows 7, the security.xml is located at
.AndroidStudio\config\options\security.xml
In my linux system this is where the security.xml file is located::
~/.AndroidStudio2.2/config/options/security.xml
Master passwords are encrypted (AES) and saved in security.xml file. It's location could change based on system and the version of android studio that you are using.
You can run the following command in command shell.
locate security.xml

How can I sign a Windows Mobile application for internal use?

I'm developing a Windows Mobile application for internal company use, using the Windows Mobile 6 Professional SDK. Same old story: I've developed and tested on the emulator and all is well, but as soon as I deploy to advice I get an UnauthorizedAccessException when writing files or creating directories.
I'm aware that an application installed to a device needs to be signed but I'm running into roadblocks at every turn:
Using the project properties 'Devices' window I select 'Sign the project output with this certificate, and choose one of the sample certificates from the SDK. This results in a build error: "The signer's certificate is not valid for signing" when running SignTool.
If I try to run SignTool.exe from the commandline, I get an error telling me to run SignTool.exe from a location in the system's PATH.
I can't use the 'Signing' tab in the Project Properties to create a test certificate - this is greyed out (presumably for WinMobile projects?).
If at all possible, I would like to avoid having to go through Versign or the like to get a Mobile2Market certificate. If I have to go this route for a final version that's fine, but I need to at least be able to test the app on real devices.
Any advice would be most welcome!
First, make sure you really do need to sign it (you might be able to adjust the device security model).
If you do, then run signtool.exe, but from a Visual Studio command prompt. The easiest way to get there is fromt he Start menu, select Microsoft Visual Studio 2008->Visual Studio Tools->Visual Studio 2008 Command Prompt. This will set up all the proper pathing for you.

Resources