ADM for Amazon Kindle Fire - INVALID_SENDER - android

Hi I am new to Amazon Kindle Fire,
I downloaded a sample code snsmobilepush.zip from docs.aws.amazon.com
and when i am following to get Obtaining ADM Credentials
To create an API Key,
I have expoted and created myapp.keystore file. When I am exporting, MD5 is taken like below
and API Key Name : test_profile_com.mycompany.kindletest
Package : com.mycompany.kindletest
Signature : 19:BB:B2:9C:91:0E:92:2D:8E:CC:9E:16:9E:F0:EE:34 (This is taken from above image while exporting) and press add button to create API_KEY and pasted in string.xml
I am getting error code INVALID_SENDER in the method onRegistrationError(final String string){.
Where am I wrong, Can you please anyone tell me ?
and to work ADM...
Do we need publish the app in Amazon App Store ?
Is it necessary Server side implementation for testing ?
Is it necessary to create api_key.txt in Assets folder ?

I have resolved this issue by exporting the apk from ecllipse and then install manually on my Kindle. Previously I was trying it from ecllipse.
To manually install apk on the kindle try following command
adb install -i com.amazon.venezia YOUR_APK_NAME.apk

Related

Huawei App Signing can not create zip file

In Huawei App Gallery I have to update an existing aab application. Site redirects me to App signing page and there are steps that I have to follow in order to sign the app successfully. These are the steps provided:
Obtain the pepk.jar file from the Internet or another legitimate source.
Export and encrypt your private key and public key certificate into a ZIP file. Parameters in bold must be replaced as needed. Then, enter your data storage location and key password as prompted.
java -jar pepk.jar --keystore test.jks --alias test --output=output.zip --encryptionkey=<some_encryption_key> --include-cert
Upload the ZIP file containing the private key and public key certificate. (The ZIP file contains only certificate.pem and encryptedPrivateKey.)
Now I have 2 problems.
First one is, when I run the code in 2nd step in CMD. I get include-cert flag is not provided error. However when I write --include-cert=certificate.pem or --include-cert certificate.pem it says flag is unrecognized.
Second one is, I put certificate.pem and private key to folder and then turn it into ZIP. But when I click on submit it gives me Make sure the package contains only the certificate.pem and encryptedPrivateKey files error. Is not encryptedPrivateKey is the file that is exported by AndroidStudio when you generate an app bundle or Apk into the same location with .pepk extension?
I don't know what am I missing in order to sign my application. Any help would be appreciated, thanks in advance
If "No value provided for flag: include-cert" is displayed, the pepk.jar file is incorrect. You need to replace it with a correct one.
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-appsigning-faq-0000001052944432
I get include-cert flag is not provided error. However when I write --include-cert=certificate.pem or --include-cert certificate.pem it says flag is unrecognized.
It is recommended that you do not change the command and follow the commands in the document.
You could click here to try out.
And this is the App Signing Operation Guide video for reference.

amplify init fails constantly

I don't know whats really wrong with my amplify. I run amplify init and get this error message. I have downloaded my amplify cli using npm and have successfully run 'amplify configure'.
init failed
InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST
/apps
host:amplify.ap-south-1.amazonaws.com
x-amz-content-sha256:79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29
x-amz-date:20210121T154050Z
host;x-amz-content-sha256;x-amz-date
79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29'
The String-to-Sign should have been
'AWS4-HMAC-SHA256
20210121T154050Z
20210121/ap-south-1/amplify/aws4_request
b150344845c2c575fd957d63172173a367f2bacf0e817764a02e5b20d03c3811'
Okay, so I finally found out what was bugging me for last three days. A whitespace ( ).
Yes!
I had my folder inside the user with a whitespace in it, as in "First Last". Instead what I should have done is changed my folder name inside my C:\Users\First Last to C:\Users\FirstLast before starting, and then try to install my amplify CLI using the command curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd and proceed as mentioned in the documentation here.
To change the name of the User folder in windows 10, I watched this great YT! video
On Mac:
I was also getting the same error while using the aws amplify CLI tool in my nodejs project.
Like #miraquee noted above about the issue being a white space. I suspected that I also had the same issue. What I did to start clean was:
Delete the local .aws folder in my home folder on mac to start clean
rm -rf ~/.aws/
Ran amplify init again. This time when reaching the step where it asks you to create an IAM user, which subsequently takes opens your web browser to finish the creation of the new IAM user, I was very careful about copying in the Access Key Id and Secret Access Key
This time when I went through the flow in the CLI it worked.
If you want to see a video of these steps, checkout this YouTube video built by one of the engineers on the AWS amplify team
Youtube video link: https://www.youtube.com/watch?v=fWbM5DLh25U

I forgot my keystore credentials ,how can I submit an update now?

So I just posted an app about 15 days before and now I want to upload a new update but while generating the Signed Apk Android studio is asking me for key store credentials... and I read that I have to provide the same credentials that I used on first submission (I did not remember anything about that)
Somehow I managed to get an backup of keystore.store file (which is stored at my project's directory inside a folder named KEY_STORE ) now when I'm putting the suspected alias and passwords I'm getting this error :
Failed to read key from myalias from store /mypath/for/keystore cannot recover key
Now what I can do to get back my credentials ???
You can't recover credentials.
The only way to do this is to try a tool like
http://maxcamillo.github.io/android-keystore-password-recover/
I've never use it.
I think it will try to brute force your credentials.
UPDATE:
I've tested it and it works.
Go to
http://maxcamillo.github.io/android-keystore-password-recover/
Add java files download from the url to a new Java Project (ex. using ItelliJ IDEA)
Add the keystore file to the root of the project
Add this option to program args in this way
-m 1 -k keystorefilename
Run the program
Alternatively, run the jar download from the url and use the same args.
Sorry bro, no way to recover now, you have to have the correct credentials. All you can do is publish a new application in the same name.

Google OAuth 2.0 and debug key for Google Drive API

I've set up 2 Client IDs for Android application in the GoogleDriveAPI console: the first for the release APK and the second for Debug purposes. Everything ok with the released app, but my issue is only related to the second Client ID.
I'm getting this exception: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException
after the following lines:
Drive.Files.List request;
request = service.files().list();
String query = "mimeType='application/vnd.google-apps.folder' AND trashed=false AND title='" + title + "' AND '" + parentId + "' in parents";
request = request.setQ(query);
com.google.api.services.drive.model.FileList files = request.execute(); // <=I'm getting the exception here
I'm using ADT on windows, I've obtained the sha1 fingerprint for debug keystore from Windows->Preferences->Android->Build for the debug mode, but the Google Drive API authorization fails! Why?
The (only) solution I've found is to use the "Release" Client ID also in Debug mode, with a custom fingerprint (and that actually works).
Try this:
Take the *.apk file that isn't working (DEBUG.apk), I don't know what's your IDE, so I can't tell you where to find it, but it should be easy.
Open the '*.apk' file in 7-zip or similar unzipper and find 'META-INF\CERT.RSA' file in the archive. Unzip it, for instance to your ...\desktop\
Run 'keytool -printcert -file ...\desktop\CERT.RSA'.
You should see the SHA1 of the APK file in question, compare it with the SHA1 you registered in the console. Double-check the package name as well. PackageName-SHA1 combination is what authorizes the app version with Google Drive.
I vaguely remember this happening to me after re-installing/upgrading my IDE or moving project to another machine (basically generating different debug SHA1 than I registered).
I know it is a long shot, but this is what I use when run into trouble.

"An internal error occurred" with integration of Google Plus Login

I am trying to integrate a Google plus Login in my application as per the instruction provided by following link :
https://developers.google.com/+/quickstart/android#install-sdk
I am following all the instructions perfectly. And when I run the sample application on a real device provided in the android-sdk and click the signin button, it display a Toast message that An internal error occurred
What am I doing wrong?
I have this problem and even after creating 10 different client IDs with different SHA and package name, it doesn't work... until I found out that you have to fill the Consent screen.
According to GoogleDevelopers Console -
The consent screen will be shown to users whenever you request access
to their private data using your client ID.
This can happen when you haven't set the signature for the client ID in your API console project, or if you copied the wrong key value from keytool. Doing so is documented in the steps of the quick start guide on steps 7, 8, 9, and 10.
I've solved problem by removing .setScopes("PLUS_LOGIN") in the PlusClient.Builder.
I got this toast message error in my android application:
An internal error occurred
Summary:
Assuming you made a mistake configuring the negotiation between your android app and the Android API server granting you access. Most likely caused by you not adding the correct package name or correct SHA1 fingerprint. I followed these steps to blow out the wrong configuration and do it right.
Steps to fix:
Go to your google api console and login: https://code.google.com/apis/console
Click "API Access" tab.
Click the button: "Create another client ID".
Choose: "Installed Application" radio button.
Choose: "Android" radio button.
Enter the package name of the android app that is displaying the above error. You can find it defined at the top of the PlusSampleActivity.java code file. For me it is com.google.android.gms.samples.plus
Acquire your SHA1 fingerprint value:
a. Use the command keytool -list -v -keystore /home/el/.android/debug.keystore. Enter password, If you never set it, the default password is 'android'.
b. The SHA1 fingerprint is shown on screen, copy that.
Paste the above value into the "Signing certificate fingerprint (SHA1):" box.
Click the button: "Create client ID".
Run your android application again, click "Sign in".
Now you are presented with an Activity to "Sign in to Google+ SDK with Google".
In my case, the solution was to actually set an email address in the Consent Screen.
First, I was a bit reluctant to select my personal address and for an strange reason you can save the form without this piece of data with no error. After checking what others have suggested, as soon as I set my email address in that form, it started working.
I have been searching how to fix this for a day with full of research without luck finally i managed
to resolve this issue with the following approach.
Before i begin resolving this (at least how ti worked for me) i have to say that everything on the
documentation is correct and you don't have to change any lines of code or so.
It looks like more of a bug in the https://cloud.google.com/console cloud console
First ensure you got the correct SHA1 and your project's package name as described in the docs
https://developers.google.com/+/quickstart/android
Now this bug as i noticed (at least for me) was that in my cloud console, the project i have created
was long ago with the old interface and few months ago i migrated to the new GUI.Once you get the new look on cloud console you will notice that new projects have an auto generated project id
like this atlantean-ares-331 while old projects got a long integer value as project id which is not visible. So if your project was created with the old GUI and you have just created new client id for OAuth for that project you will get the Toast "An internal error occurred” while trying to sign in with google.
How to Fix
Go to your cloud console
Make a new project i would suggest a name like
oldprojectname-gplus
In APIs section enable Google+ API
Ensure that none of your projects has the same package name on
OAuth Client ID with the one you will use now otherwise you will get Error This client ID is globally unique and is already in use.(you will have to delete the old OAuth client id with the same package name you will use now).
Go to Credentials Create New Client ID for OAuth.
Installed application
Android
Enter your project's package name and your SHA1
Done
My solution to the problem was following.
I did everything others recommended and there was no typo regarding the package name and SHA1 key. I also tried removing the key and then adding it again but it didn't help.
What did help is removing the key and creating a new project (at https://code.google.com/apis/console) and then creating the Client ID (with package+sha1) again there. After that (5 secs) everything worked on my Android device.
This problem is related to the permissions from the api console.
if you are using a permission related with SCOPE_PLUS_LOGIN, in the api console you must create two keys, one for OAuth client id, and other for public api key.
In my case the problem was that I changed the package name of the app and didn't update in dev console.
For me it was that i was attempting to use my production key when installing it using my debug key. Make sure your using the right SHA1 from the right keystore.
I turned around to the Google IO 2013, and changed the initialization of PlusClient, then it works.
public static final String AUTH_SCOPES[] = {
Scopes.PLUS_LOGIN,
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/developerssite" };
mPlusClient = new PlusClient.Builder(this, this, this)
.setScopes(AUTH_SCOPES)
.build();
Thanks Thano for the solution
"Now this bug as i noticed (at least for me) was that in my cloud console, the project i have created was long ago with the old interface and few months ago i migrated to the new GUI.Once you get the new look on cloud console you will notice that new projects have an auto generated project id like this atlantean-ares-331 while old projects got a long integer value as project id which is not visible. So if your project was created with the old GUI and you have just created new client id for OAuth for that project you will get the Toast "An internal error occurred” while trying to sign in with google."
Recreating the project in the Google Console worked for me after several other attempts:
For any reason my project did not have a project ID (old console/new console?).
As Thano (above) suggested, I created a brand new project, created Client IDs, ... and then in worked. Thanks for the advice!!
Remember to use the built-in debug keystore for testing. I had everything else working correctly, but I had set my production keystore SHA1 fingerprint in the Credentials in the Developers Console, which caused it not to work.
If your facing this error when you try to run the sample application "or" copy the project which you have created in other machine which was running successfully in that and giving such pop-up error in the other machine where you are trying to run ,you can follow the below method and it will help.
If your are building the app for testing/debug purpose then,
1.Generate the new SHA1 if you copy your project and run it on other machine for the package name and path provided for keystore.
2.Change the ClientId in developers console for new generated SHA1 and run it in the new machine where you have copied the project and trying to run it.
Something often overlooked is the package name. I'd like to clarify the step 6 by Eric Leschinski above (can't comment there): the required package is not the package of an activity, rather the package of your app's manifest.
You may retrieve the correct value from the root element of AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ntk.darkmoor"
android:versionCode="1"
android:versionName="1.0" >
In this example define "com.ntk.darkmoor" while creating the Client ID
I had the same issue when I used SHA1 for debug.keystore for debuging then exported my application forgetting to generate SHA1 for keystore that I used to export my application.
Its working for me when i connect the device and install the apk from Android Studio.
But its now working for me when i generate the .apk and install it from dropbox.
I went through all the answers provided here and others as well. In my case the issue was the SHA-1 as well. The reason I was getting the incorrect SHA-1 was my keytool export cert command.
Previously I was using
C:\Users\mysuername\.android SHA 1 signature keytool -exportcert -alias androiddebugkey -keystore "keystorepath" -list -v
The problem was in the androiddebugkey variable. Here you have to give the name of the key you use for signing the application.
C:\Users\mysuername\.android SHA 1 signature keytool -exportcert -alias mykeyname -keystore "keystorepath" -list -v
Hope this helps someone!
To add to this long list of reasons my problem was that i got the debugkey from the jks file rather than the app.
Its always something small.

Categories

Resources