Skip to content

Commit 450b46d

Browse files
Jin Wooram Seoserggl
authored andcommitted
Update deprecated api (#411)
* - update gradle version 3.1.0 - remove Warning:Configuration 'compile' replaced with 'implementation' - update targetSdkVersion 26 (Google Play requires that apps target API level 26 or higher) - remove IInAppBillingService.aidl file and Use the Google Play Billing Library - update deprecated API * sample project use annotations version 26.0.1 * revert compileSdkVersion and buildToolsVersion * revert gradle version
1 parent d749cd3 commit 450b46d

File tree

5 files changed

+14
-285
lines changed

5 files changed

+14
-285
lines changed

build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ buildscript {
33
repositories {
44
mavenCentral()
55
jcenter()
6+
maven {
7+
url 'https://maven.google.com/'
8+
name 'Google'
9+
}
610
}
711
dependencies {
812
classpath 'com.android.tools.build:gradle:2.3.3'
@@ -15,6 +19,11 @@ allprojects {
1519

1620
repositories {
1721
mavenCentral()
22+
jcenter()
23+
maven {
24+
url 'https://maven.google.com/'
25+
name 'Google'
26+
}
1827
}
1928

2029
sourceSets {

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Wed Mar 15 08:51:52 MSK 2017
1+
#Wed Jul 03 11:27:59 KST 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME

library/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies {
3636
androidTestCompile 'com.android.support.test:runner:0.5'
3737
androidTestCompile 'com.android.support.test:rules:0.5'
3838
compile 'com.android.support:support-annotations:25.3.1'
39+
compile 'com.android.billingclient:billing:2.0.1'
3940
}
4041

4142
configurations.archives.extendsFrom configurations.default

library/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl

Lines changed: 0 additions & 281 deletions
This file was deleted.

library/src/main/java/com/anjlab/android/iab/v3/BillingProcessor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,11 +782,11 @@ public boolean consumePurchase(String productId)
782782
try
783783
{
784784
TransactionDetails transaction = getPurchaseTransactionDetails(productId, cachedProducts);
785-
if (transaction != null && !TextUtils.isEmpty(transaction.purchaseToken))
785+
if (transaction != null && !TextUtils.isEmpty(transaction.purchaseInfo.purchaseData.purchaseToken))
786786
{
787787
int response = billingService.consumePurchase(Constants.GOOGLE_API_VERSION,
788788
contextPackageName,
789-
transaction.purchaseToken);
789+
transaction.purchaseInfo.purchaseData.purchaseToken);
790790
if (response == Constants.BILLING_RESPONSE_RESULT_OK)
791791
{
792792
cachedProducts.remove(productId);
@@ -988,7 +988,7 @@ private boolean verifyPurchaseSignature(String productId, String purchaseData, S
988988

989989
public boolean isValidTransactionDetails(TransactionDetails transactionDetails)
990990
{
991-
return verifyPurchaseSignature(transactionDetails.productId,
991+
return verifyPurchaseSignature(transactionDetails.purchaseInfo.purchaseData.productId,
992992
transactionDetails.purchaseInfo.responseData,
993993
transactionDetails.purchaseInfo.signature) &&
994994
checkMerchant(transactionDetails);

0 commit comments

Comments
 (0)