increase security of in-app billing & fixing bugs#8
Open
ranjbarhadi wants to merge 3 commits intocafebazaar:masterfrom
Open
increase security of in-app billing & fixing bugs#8ranjbarhadi wants to merge 3 commits intocafebazaar:masterfrom
ranjbarhadi wants to merge 3 commits intocafebazaar:masterfrom
Conversation
this little code check if the target package is bazaar client. this prevents malicious tools like lucky patcher to easily impersonate as bazaar client app and unlock premium content.
…stalled on devices with older android version, if bazaar client is not installed a null pointer exception will be thrown resulting a force close when user wants to buy something
ranjbarhadi
commented
Apr 24, 2017
|
|
||
| Intent serviceIntent = new Intent("ir.cafebazaar.pardakht.InAppBillingService.BIND"); | ||
| serviceIntent.setPackage("com.farsitel.bazaar"); | ||
| if (!mContext.getPackageManager().queryIntentServices(serviceIntent, 0).isEmpty()) { |
Author
There was a problem hiding this comment.
this line will cause a null pointer exception to be thrown if bazaar client is not installed
ranjbarhadi
commented
May 5, 2017
| if (!mContext.getPackageManager().queryIntentServices(serviceIntent, 0).isEmpty()) { | ||
| PackageManager pm=mContext.getPackageManager(); | ||
| List<ResolveInfo> intentServices = pm.queryIntentServices(serviceIntent, 0); | ||
| if (intentServices != null && !intentServices.isEmpty()) { |
Author
There was a problem hiding this comment.
this new approach will fix the app crashing issue
ranjbarhadi
commented
May 5, 2017
| logDebug("Disposing."); | ||
| mSetupDone = false; | ||
| if (mServiceConn != null) { | ||
| if (mServiceConn != null && mService!=null) { |
Author
There was a problem hiding this comment.
also, we should check if the service is not null
ranjbarhadi
commented
May 5, 2017
| return; | ||
| } else { | ||
| mService = IInAppBillingService.Stub.asInterface(service); | ||
| } |
Author
There was a problem hiding this comment.
this is the part that we check for the authenticity of target app.
Author
|
@remohammadi @moallemi @hirbodk you guys may wanna take a look at this |
rexiliano89
approved these changes
Jan 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this little code check if the target package is bazaar client. this prevents malicious tools like lucky patcher to easily impersonate as bazaar client app and unlock premium content.