How to upload a new apk to Google Play Console (react-native) - react-native

My previous keystore was lost and I contacted the Google Support team and generated a new upload key using the command below.
keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks
Now I have the upload_certificate.pem file and the support team stated that they reset the key and I need to upload the new version of my application to the Google Play Console.
I have tried to upload once they reset it once before by generating an apk file as mentioned in the tutorial below.
Generate release mode APK for React-Native project to publish on PlayStore
But it doesn't work. Getting this error. Is there anything that I am doing wrong?

Related

hashkey mismatch error android faebook app

i created a react native android app. and then was using react-native-fbsdk to authenticate user using facebook..t i have registered the app in facebook developer portal and changed my manifest file and string file. when i launch the LoginManager.logInWithPermissions(['public_profile', 'email']) it authenticates and brings me to facebook, signs in and then gives me error "The key hash does not match any stored key hashes. Go to https://developers.facebook.com/docs/facebook-login/android for more information.".
i have created the hashkey with teh command in the help documenation with both the options here:
1.
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.android\debug.keystore | C:\Users\manshuk\Downloads\openssl-0.9.8k_X64\bin\openssl sha1 -binary | C:\Users\manshuk\Downloads\openssl-0.9.8k_X64\bin\openssl base64
and using the debug.keystore of the app itself like this:
keytool -exportcert -alias androiddebugkey -keystore android/app/debug.keystore | C:\Users\manshuk\Downloads\openssl-0.9.8k_X64\bin\openssl sha1 -binary | C:\Users\manshuk\Downloads\openssl-0.9.8k_X64\bin\openssl base64
i added the key in the app in facebook. in app setting, facebook.
Im not saying this works all the time. But, this worked for me.
First get you sha-1 (Read the code, youll have to EDIT it)
keytool -list -v -keystore "C:\Users\EDIT THIS\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
paste that in your Command prompt.
Now copy your sha-1
GO HERE > https://tomeko.net/online_tools/hex_to_base64.php
Paste your sha-1 key in the "HEX STRING:"
Copy the value of Output (base64):
Now paste that in your fb developer app hash keys
Save, delete your app in your phone, re-install, run.

ERROR:either bundle id or package name / hash are invalid, unknown, malformed

I am using react-native-linkedin-login npm when clicking on login button of linkedin app then alert generate like it
ERROR:either bundle id or package name / hash are invalid, unknown, malformed
I have have entered the right hash key and package name in linkedin developer account which generate using this command on terminal
keytool -exportcert -keystore ~/.android/debug.keystore -alias androiddebugkey | openssl sha1 -binary | openssl base64
i am working on react native applicaton social login
Make sure you are not modifying the APK in any way.
After signing the APK (debug build) I was manually editing the APK contents and this was causing the LinkedIn social login app to get suspicious. It seems like it validates your app's signing key. For me this was failing because I had mangled the APK.

Glassfish 4 certificate based client authentication

For couple of days I'm trying to set up my development environment for certificate-based client authentication and it just don't want to work. I'm using the Glassfish 4 documentation (security guide) and creating according to it self signed client certificate for test purposes but I'm not sure what I'm missing, since there is not complete description of the whole process. When I enable Client Authentication for my Http-Listener and don't get any error message in the server log, but when I try to connect from a browser I just cannot establish a connection with the server. Without this option my web application is working just fine. In chrome I see the following message:
This site can’t be reached
127.0.0.1 refused to connect.
ERR_CONNECTION_REFUSED
And in firefox:
The connection to 192.168.1.9:8181 was interrupted while the page was loading.
So for me it seems that something (unfortunately I cannot understand what exactly) is happening, but a connection cannot be established.
Since the setup is pretty complex I'm looking for a tutorial or how-to page which has step by step instruction, but any help and advise will be higly appreciated.
Ok, I finally got it how it works :) I found very good step by step instructions in the book Java EE 7 with GlassFish 4 Application Server, Chapter 9, The cerrtificate realm (p. 247)
One have to basicly do the following 3 Steps:
Create Client Certificate
1.1 Generate a self-signed certificate:
keytool -genkey -v -alias myalias -keyalg RSA -storetype PKCS12 -keystore clientCert_1.p12 -storepass wonttellyou -keypass wonttellyou
1.2 Import it in a browser
NB!: When the certificate is not imported the browser doesn't ask for it, but instead returns a connection error message, which for me is pretty misleading.
Export the certificate from step 1. into a format that Glassfish can understand
keytool -export -alias myalias -keystore clientCert_1.p12 -storetype PKCS12 -storepass wonttellyou -rfc -file clientCert_1.cer
RESULT => Certificate stored in file clientCert_1.cer
Since we issued a self-signed certificate, in order for GlassFish to accept our certificate, we need to import it into the cacerts keystore.
keytool -import -v -trustcacerts -alias myalias -file clientCert_1.cer -keystore ../cacerts.jks -keypass changeit -storepass changeit
Note
The part: -import -v -trustcacerts is not in the book, but without
it the keytool may crash throwing an exception.
changeit is the default glassfish password
Finally one needs to setup the application server for certificate based client authentication, which has two parts. The first one is adding the a login configuration to web.xml:
...
<login-config>
<auth-method>CLIENT-CERT</auth-method>
<realm-name>certificate</realm-name>
</login-config>
...
And the second one is configuring the role mapping in glassfish-web.xml, so that your application has a corresponding role for that login. It looks like this:
...
<security-role-mapping>
<role-name>YOUR_ROLE</role-name>
<group-name>YOUR_GROUP</group-name>
<principal-name>CN=Test User, OU=n/a, O=Test User, L=Cologne, ST=NRW, C=DE</principal-name>
</security-role-mapping>
...
For more detailed information, about key generation and setting up your glassfish consult the book.
And finally one more thing which was confusing for me. Over the admin interface one can find the SSL configuration tab of an existing http-listener. You don't have to enable the Client Authentication option!

Enterprise Mobility Manager - " Authentication Failed " issue on Mobile Phone

While I'm trying to register with my phone, I'm getting this error:
Authentication Failed
UPDATE 3.18.14;
Okay , i compiled .apk file correctly with correct .bks file .Still i'm getting same error ! Should i change hosts file in my phone(samsung NOTE 3) ?
NOTES:
In application conf, server address: 192.168.1.100
I can connect on mobile browser with https://192.168.1.100:9443
Just execute this command.
keytool -importkeystore -srckeystore CA.p12 -srcstoretype PKCS12
-destkeystore wso2mobilemdm.jks
CA needs to be the one you have used to sign your SSL certificate.
try creating all certificate in one folder.before creating ,just copy wso2carbon.jsk and client-truststore.jks in that folder.
try only single password wherever ask. but in last step use wso2_mobile when it ask.
copy wso2carbon.jsk, client-truststore.jks and wso2mobilemdm.jks from that folder to repository/resources/security folder to overwrite.
then in that folder copy bcprov-jdk15on-149.jar and run following command in that folder.
keytool -importcert -trustcacerts -keystore emm_truststore.bks -storetype bks -storepass wso2carbon -file ca_cert.pem -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath ./bcprov-jdk15on-149.jar
thats it you will see emm_truststore.bks in that folder.

Jarsigner - Signer certificate not yet valid (AIR Application code signing to publish on Google Play)

I have created a Self-Signed Certificate in Mac OS using Keychain Access to be used as a certificate for my AIR Application. After exporting a release build for my app in Flash Builder 4.6, I have verified my apk using jarsigner by executing the following command:
jarsigner -verify -verbose -certs myapp.apk
then, the following message was returned:
jar verified.
Warning:
This jar contains entries whose signer certificate is not yet valid.
is it ok to publish this app on Google Play?
if possible, how to validate my self-signed certificate?
root cause for my problem: since Google Play requires a certificate to be expired after October 22, 2033, i have changed my system date to an advance date.
Valid value for the validity period of Keychain Access certificate assistant is 20 years so if I'll create a new certificate, it will expire on June 26, 2033 which fails to achieve the requirement.
A validity period for an X509 certificate is the number of days the certificate
is valid from the time it is issued. Certificates issued by Certificate Assistant
have a maximum validity period of 20 years.
upon using this certificate for the code signing of my air application, Google Play prompts an error upon uploading the apk
Upload failed
You uploaded an APK signed with a certificate that is not yet valid.
You need to sign your APK with a certificate that is currently valid.
Learn more about signing.
So i created a new certificate using keytool by executing the following commands:
$ keytool -keystore cert.jks -genkeypair -alias cert -keyalg RSA -keysize 2048 \
-validity 18250 -dname 'CN=cert,OU=org,O=org,L=location,ST=state,C=PH'
$ keytool -keystore cert.jks -exportcert -alias cert \
| openssl x509 -inform der -text
$ keytool -importkeystore -srckeystore cert.jks -destkeystore cert.p12 \
-srcstoretype jks -deststoretype pkcs12