Skip to content

Commit f05eac3

Browse files
committed
updates to previous comments
1 parent 02fdb12 commit f05eac3

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Branch-SDK/build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ jacoco {
1313
toolVersion = "0.8.10"
1414
}
1515

16-
//configurations.all {
17-
// resolutionStrategy {
18-
// force("com.android.billingclient:billing:8.0.0")
19-
// }
20-
//}
21-
2216
dependencies {
2317
implementation(fileTree(mapOf("dir" to "libs", "include" to "*.jar")))
2418
implementation(kotlin("stdlib"))

Branch-SDK/src/main/java/io/branch/referral/BillingGooglePlayReflection.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
import java.lang.ClassNotFoundException;
44

5+
import io.branch.referral.util.DependencyUtilsKt;
6+
57
public class BillingGooglePlayReflection {
68
public static BillingGooglePlayInterface getBillingLibraryVersion() {
7-
String billingClient = com.android.billingclient.BuildConfig.VERSION_NAME;
9+
String billingClientVersionString = com.android.billingclient.BuildConfig.VERSION_NAME;
810
BillingGooglePlayInterface billingInterface;
911

1012
try {
11-
int majorIndex = billingClient.indexOf(".");
12-
String majorVersion = billingClient.substring(0, majorIndex);
13-
14-
switch (majorVersion) {
13+
String billingMajorVersion = DependencyUtilsKt.dependencyMajorVersionFinder(billingClientVersionString);
14+
switch (billingMajorVersion) {
1515
case "8":
1616
billingInterface = new BillingGooglePlayV8();
1717
break;
@@ -25,7 +25,7 @@ public static BillingGooglePlayInterface getBillingLibraryVersion() {
2525
}
2626

2727
} catch (Exception e) {
28-
System.err.println("Error parsing billing client version: " + e.getMessage());
28+
BranchLogger.e("Error parsing billing client version: " + e.getMessage());
2929

3030
billingInterface = new BillingGooglePlayDefault();
3131
}

Branch-SDK/src/main/java/io/branch/referral/util/DependencyUtils.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,10 @@ const val xiaomiInstallReferrerClass = "com.miui.referrer.api.GetAppsReferrerCli
2929

3030
const val billingGooglePlayClass = "com.android.billingclient.api.BillingClient"
3131

32-
const val androidBrowserClass = "androidx.browser.customtabs.CustomTabsIntent"
32+
const val androidBrowserClass = "androidx.browser.customtabs.CustomTabsIntent"
33+
34+
fun dependencyMajorVersionFinder(dependencyNameString: String): String {
35+
val majorIndex = dependencyNameString.indexOf(".")
36+
val majorVersion = dependencyNameString.substring(0, majorIndex)
37+
return majorVersion
38+
}

0 commit comments

Comments
 (0)