-
Notifications
You must be signed in to change notification settings - Fork 160
Emt 2431 - Draft PR #1323
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?
Emt 2431 - Draft PR #1323
Conversation
Updating with newest version of the master repo.# the commit.
ReferenceSDK-2431 -- Emt 2431 - Draft PR. DescriptionSummary By MatterAI
🔄 What ChangedThis pull request upgrades the Google Play Billing Library dependency from version 6.0.1 to 8.0.0. It introduces a new 🔍 Impact of the ChangeThis upgrade modernizes the Branch SDK's integration with Google Play Billing, enabling compatibility with the latest features and improvements in Billing Library v8. However, the current implementation contains critical functional bugs, such as an empty 📁 Total Files Changed
🧪 Test AddedN/A 🔒Security VulnerabilitiesN/A Testing InstructionsN/A Risk Assessment [
|
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use MatterAICommand List
|
| @@ -0,0 +1,40 @@ | |||
| plugins { | |||
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.
Are these gradle files necessary to get the library version?
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.
You should be able to do this with
String billingClientVersion = com.android.billingclient.BuildConfig.VERSION_NAME;
in Java (or Kotlin) instead
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.
You mean having that line in the main gradle file instead? So I'll remove the product flavors.
Doe that replace this? :compileOnly("com.android.billingclient:billing:6.0.1")
Branch-SDK/build.gradle.kts
Outdated
| isRequired = isReleaseBuild() | ||
| } | ||
|
|
||
| flavorDimensions.add("billing") |
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.
Let's keep things simple and just check the buildconfig version string and conditionally execute the right library implementation.
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.
Got it. Removing flavor dimensions
settings.gradle.kts
Outdated
| @@ -1,5 +1,7 @@ | |||
| include(":Branch-SDK") | |||
| include(":Branch-SDK-TestBed") | |||
| include (":BillingGooglePlayModules:BillingV6V7", ":BillingGooglePlayModules:BillingV8") | |||
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.
Same as above, revert this
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.
Removed this as well
| public class BillingGooglePlayReflection { | ||
| public static BillingGooglePlayInterface getBillingLibraryVersion() { | ||
| try { | ||
| // Check for a class added in version 8.0 or higher |
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 can be hopefully be simplified with my suggestion. Just parse the major version
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.
There isn't a specific method to grab the version so the checks look for what's available in the version that is being used.
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.
Just realizing that was for the reflection section. Replacing it!
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use MatterAICommand List
|
|
|
||
| public class BillingGooglePlayReflection { | ||
| public static BillingGooglePlayInterface getBillingLibraryVersion() { | ||
| String billingClient = com.android.billingclient.BuildConfig.VERSION_NAME; |
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.
Make the variable name a bit more relevant like billingClientVersion
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.
Renamed to billingClientVersionString
|
|
||
| try { | ||
| int majorIndex = billingClient.indexOf("."); | ||
| String majorVersion = billingClient.substring(0, majorIndex); |
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.
Might be worth making this version extraction bit into a utility function since this could be used in other places as well.
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.
Created function called dependencyMajorVersionFinder and added it to DependencyUtils.kt
Function takes in a string with the depenency name and pulls out the major version number.
Kept the Version Name extract itself in the BillingGooglePlayReflection class so that the function can take in any method of calling the version name depending on what the class offers.
| } | ||
|
|
||
| } catch (Exception e) { | ||
| System.err.println("Error parsing billing client version: " + e.getMessage()); |
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.
Use BranchLogger.e instead of System.err.println
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.
Changed to BranchLogger.e
Branch-SDK/build.gradle.kts
Outdated
| toolVersion = "0.8.10" | ||
| } | ||
|
|
||
| //configurations.all { |
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.
Delete this
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.
Deleted
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use MatterAICommand List
|
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use MatterAICommand List
|
|
Hey @gdeluna-branch I updated all of your comments and also added the V8 logic. Is there a better way to reference them in the BillingGooglePlayReflection.java file? Also, I'm hesitant to delete the BillingGooglePlay.kt file until everything is done and working. Also still need to build the gradle to reference each version properly. |
Reference
EMT 2431 -- <TITLE>.
Description
Added in the main structure of the potential update for Android Billing Library using Reflection
Testing Instructions
Download and run test app. Currently errors.
Risk Assessment [
HIGH||MEDIUM||LOW]High Risk as this may break android billing entirely if not done correctly.
Reviewer Checklist (To be checked off by the reviewer only)
cc @BranchMetrics/saas-sdk-devs for visibility.