pschw / InAppReview

Implementation of the Google Play In-App Review API for Godot 3.2.3
MIT License
11 stars 2 forks source link

Certificate Mismatch #2

Open finepointcgi opened 3 years ago

finepointcgi commented 3 years ago

Hello,

I am attempting to make a video about your plugin and im running into a small problem. When I attempt to execute the plugin it looks like it attempts to fire however it says I have a cert mismatch. Im not sure if this is an issue with your code infact im sure its not but I would like to get some guidance. Here is some logs from ADB, from what I can tell it says my cert is missmatched however im not exactly sure how to fix this.

02-27 19:04:48.742 25021 25063 I godot   : getting user review
02-27 19:04:48.743 25021 25063 I godot   : made it here
02-27 19:04:48.743 25021 25063 I godot   : trying to get review
02-27 19:04:48.743 25021 25063 I godot   : finished inapp review
02-27 19:04:48.743 25021 25021 I PlayCore: UID: [10309]  PID: [25021] ReviewService : requestInAppReview (org.FinePointCGI.InAppReview)
02-27 19:04:48.744 25021 25083 I PlayCore: UID: [10309]  PID: [25021] ReviewService : Initiate binding to the service.
02-27 19:04:48.754 25021 25021 I PlayCore: UID: [10309]  PID: [25021] ReviewService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.inappreviewservice.InAppReviewService})
02-27 19:04:48.754 25021 25083 I PlayCore: UID: [10309]  PID: [25021] ReviewService : linkToDeath
02-27 19:04:48.756 21450 24941 I Finsky  : [42886] gcr.<init>(18): org.FinePointCGI.InAppReview is installed but certificate mismatch
02-27 19:04:48.764 25021 25037 I PlayCore: UID: [10309]  PID: [25021] OnRequestInstallCallback : onGetLaunchReviewFlowInfo
02-27 19:04:48.764 25021 25083 I PlayCore: UID: [10309]  PID: [25021] ReviewService : Unbind from service.
02-27 19:04:48.764 25021 25021 D ReviewPlugin: The review flow has started.
02-27 19:04:48.767  1542  1635 D EventSequenceValidator: Transition from INIT to INTENT_STARTED
02-27 19:04:48.767  1542  4031 I ActivityTaskManager: START u0 {cmp=org.FinePointCGI.InAppReview/com.google.android.play.core.common.PlayCoreDialogWrapperActivity (has extras)} from uid 10309
02-27 19:04:48.774  1542  1635 D EventSequenceValidator: Transition from INTENT_STARTED to INTENT_FAILED
02-27 19:04:48.782 25021 25063 D CGI.InAppRevie: PlayerBase::pause() from IPlayer
02-27 19:04:48.782  1012  1012 I sensors-hal: batch_physical_sensor:285, android.sensor.accelerometer/11, period=200000000, max_latency=0
02-27 19:04:48.783  1012  1012 I sensors-hal: batch_physical_sensor:296, android.sensor.accelerometer/11, period=200000000, max_latency=0 request completed
02-27 19:04:48.783  1012  1012 I sensors-hal: activate_physical_sensor:220, android.sensor.magnetic_field/21 en=0
02-27 19:04:48.784  1012  1012 I sensors-hal: activate_physical_sensor:233, android.sensor.magnetic_field/21 en=0 completed
02-27 19:04:48.784  1012  1012 I sensors-hal: activate_physical_sensor:220, android.sensor.gyroscope/41 en=0
02-27 19:04:48.785  1012  1012 I sensors-hal: activate_physical_sensor:233, android.sensor.gyroscope/41 en=0 completed
02-27 19:04:48.795  1012  1420 W VSC     : Dropping sample(s) from disabled sensor (handle 0x8006)
02-27 19:04:48.800  1012  1082 D VSC     : @ 2185394.494: [Gravity Sensor] Stop accel
02-27 19:04:48.803  1012  1082 D VSC     : @ 2185394.495: [Gravity Sensor] Stop gyro
02-27 19:04:48.803  1542  2791 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (1040599968)
02-27 19:04:48.809  1542  3978 I ActivityTaskManager: START u0 {cmp=com.android.vending/com.google.android.finsky.inappreviewdialog.InAppReviewActivity (has extras)} from uid 10121
02-27 19:04:48.819  1542  2791 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (1040599983)
02-27 19:04:48.832 25021 25021 W Choreographer: Frame time is 0.272489 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
02-27 19:04:48.832  1542  1636 W Choreographer: Frame time is 0.248791 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
02-27 19:04:48.836 21450 21450 W ProxyAndroidLoggerBackend: Too many Flogger logs received before configuration. Dropping old logs.
02-27 19:04:48.848  1542  1635 D EventSequenceValidator: inc AccIntentStartedEvents to 1
02-27 19:04:48.848  1194  1957 W iorapd  : Rejecting transition from kIntentFailed to kActivityLaunchCancelled
02-27 19:04:48.865  2722  2722 I Elmyra/ElmyraService: Unblocked; current action: LaunchOpa [mIsGestureEnabled -> true; mIsOpaEnabled -> true]
02-27 19:04:48.866  1002  1002 V ContextHubHal: sendMessageToHub
02-27 19:04:48.866  1012  1082 D CHRE    : @ 2185394.560: Parsed nanoapp message from host: app ID 0x476f6f676c00100e, endpoint 0x1, msgType 200, payload size 10
02-27 19:04:48.867  1012  1082 D CHRE    : @ 2185394.561: Elmyra/Nanoapp Recognizer started
02-27 19:04:48.876  1542  4031 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
02-27 19:04:48.878  1037  1244 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1
02-27 19:04:48.878  2722  2722 I Elmyra/ElmyraService: Gated by NavigationBarVisibility [mIsNavigationHidden -> true; mExceptions -> [DismissTimer [mReceiverRegistered -> true], SnoozeAlarm [mReceiverRegistered -> true], SilenceCall [mSilenceSettingEnabled -> true], SettingsAction]; mIsNavigationGestural -> false; isActiveAssistantNga() -> false]
02-27 19:04:48.878  1002  1002 V ContextHubHal: sendMessageToHub
02-27 19:04:48.878  1037  1244 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1
02-27 19:04:48.878  1037  1244 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1
02-27 19:04:48.879  1012  1082 D CHRE    : @ 2185394.573: Parsed nanoapp message from host: app ID 0x476f6f676c00100e, endpoint 0x1, msgType 201, payload size 0
02-27 19:04:48.879  1012  1082 D CHRE    : @ 2185394.574: Elmyra/Nanoapp Recognizer stopped
02-27 19:04:48.892 25021 25021 D ReviewPlugin: The review flow has finished.

Thanks, Mitch

pschw commented 3 years ago

Hi Mitch,

a wild guess: Uninstall the app from the device, then install/deploy it again. If you sign the app with a certificate, then later sign a new app version with a different certificate the already installed version of the app will notice the mismatch in certificates.

I am currently unable to reproduce the error.

The plugin executes its happy path as shown in these log messages:

02-27 19:04:48.764 25021 25021 D ReviewPlugin: The review flow has started. 02-27 19:04:48.892 25021 25021 D ReviewPlugin: The review flow has finished.

So it appears to be working. Also note that the log "review flow has finished" does not necessarily mean that the review dialog was shown.

Let me know if it helps and keep up the good work. I briefly glimpse over your twitter account ;)

Pascal

finepointcgi commented 3 years ago

When generating the certificate is there anything special I need to do? eg When I generated my cert I used keytool -v -genkey -v -keystore InAppReview.keystore -alias InAppReview -keyalg RSA -validity 10000 I have the app in the inside test track signed under the name InAppReview its the only app I have signed with that cert and it hasnt changed.

image

image

image

Does it need to be reviewed first or in a production track?

I can see it attempt to pop up because the nav bar appears for a second so I know your code is working. Im sure its something stupid on my end. Im sorry to ask you about this.

Thanks if you have anything you want me to cover let me know! My goal is to show people all the hard work plugin makers have been doing to make Godot a great game engine.

pschw commented 3 years ago

Certificate log message The signing seems fine to me, the certificate log message could be unrelated to the problem.

Does it need to be reviewed first? "In-app reviews require your app to be published in Play Store." (link) Unfortunately publishing status is made up of three parts. So your guess is as good as mine what published means in this context.

Does it need to be a production track? No or the official documentation is lying, but then all is lost anyway ;)

Some more thoughts... Where and when do you call the plugin? Do you pause the game before calling the plugin?

02-27 19:04:48.742 25021 25063 I godot : getting user review 02-27 19:04:48.743 25021 25063 I godot : made it here 02-27 19:04:48.743 25021 25063 I godot : trying to get review 02-27 19:04:48.743 25021 25063 I godot : finished inapp review [...] 02-27 19:04:48.764 25021 25021 D ReviewPlugin: The review flow has started.

The logs make it seem like you start the review flow and continue your program. Keep the design guidelines in mind. Maybe the in app review is shown and godot draws itself over the form. I also know that calling plugins inside ready functions can cause problems with the plugins.

In my endless runner I call the plugin after a run has ended and the game is paused with the exception of a single node that enables the player to start another run or return to the main menu. The game also keeps track of all cookies ever collected so asking for a review only happens a certain milestones and not after every game over.

finepointcgi commented 3 years ago

All im doing is calling it via a button there is no other code in the project. I do not pause the game however I dont do any code other then click button run this code

extends Node2D

var review  
# Declare member variables here. Examples:
# var a = 2
# var b = "text"

# Called when the node enters the scene tree for the first time.
func _ready():
    pass # Replace with function body.

func start_in_app_review():
    print("getting user review")
    if Engine.has_singleton("ReviewPlugin"):
        print("made it here")
        review = Engine.get_singleton("ReviewPlugin")
        # Try to get a review
        print("trying to get review")
        review.startInAppReview()
        print("finished inapp review")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#   pass

func _on_Button_button_up():
    start_in_app_review()
    pass # Replace with function body.

I have put it out on google drive. https://drive.google.com/file/d/1Jj-SxBgilNc-A9x7HteVO4rCtWF6_W7F/view?usp=sharing

pschw commented 3 years ago

I took a quick look at the project and will further investigate during the weekend.

Out of curiosity: Why do you use custom apks in the project export?

finepointcgi commented 3 years ago

I'm sorry to cause so much trouble... That was a test to try and fix a error I got before I got to this point. I found I needed to change my gradle settings to export with a different version of the Android API 21, I think it was. I was getting an error that said your plugin required a newer sdk then 18. Regardless i was getting the issue both ways with custom export template and without..

On Thu, Mar 4, 2021, 6:14 AM Pascal Schwenke notifications@github.com wrote:

I took a quick look at the project and will further investigate during the weekend.

Out of curiosity: Why do you use custom apks in the project export?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pschw/InAppReview/issues/2#issuecomment-790537476, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3UWDDZTSHLD4EOQC4YIWDTB5TRBANCNFSM4YKOTAZA .

pschw commented 3 years ago

I see. There is another possible solution to the "minimum SDK error": Go to the folder ...\android\build open the file config.gradle and replace the line minSdk : 18, with minSdk : 21,

If I remember correctly I had to use minSdk 21 because of either the Google In App Review Api or its dependencacy on the Play Core Library.

Regarding the actual problem: I made a minimal app and uploaded it on an internal test track. Right now it is awaiting review and has no store listing yet. If I trigger the review there is the aforementioned pop up attempt but nothing happens afterwards. The logs are similar enough to yours. The app has to be downloaded from the google play store in order for the plugin to work.

Let me know any problem persists after the the app passed the review state and you have a valid play store link.

finepointcgi commented 3 years ago

Well its been a month or so and I still haven't gotten approved so im not sure whats going on...