-
Notifications
You must be signed in to change notification settings - Fork 38
increase security of in-app billing & fixing bugs #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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
|
||
Intent serviceIntent = new Intent("ir.cafebazaar.pardakht.InAppBillingService.BIND"); | ||
serviceIntent.setPackage("com.farsitel.bazaar"); | ||
if (!mContext.getPackageManager().queryIntentServices(serviceIntent, 0).isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line will cause a null pointer exception to be thrown if bazaar client is not installed
if (!mContext.getPackageManager().queryIntentServices(serviceIntent, 0).isEmpty()) { | ||
PackageManager pm=mContext.getPackageManager(); | ||
List<ResolveInfo> intentServices = pm.queryIntentServices(serviceIntent, 0); | ||
if (intentServices != null && !intentServices.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this new approach will fix the app crashing issue
logDebug("Disposing."); | ||
mSetupDone = false; | ||
if (mServiceConn != null) { | ||
if (mServiceConn != null && mService!=null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, we should check if the service is not null
return; | ||
} else { | ||
mService = IInAppBillingService.Stub.asInterface(service); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the part that we check for the authenticity of target app.
@remohammadi @moallemi @hirbodk you guys may wanna take a look at this |
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.