Skip to content

Move amazon module into purchases#1112

Merged
vegaro merged 4 commits into
mainfrom
cesar/sdk-3211-move-featureamazon-files-into-common-module
Jun 30, 2023
Merged

Move amazon module into purchases#1112
vegaro merged 4 commits into
mainfrom
cesar/sdk-3211-move-featureamazon-files-into-common-module

Conversation

@vegaro

@vegaro vegaro commented Jun 29, 2023

Copy link
Copy Markdown
Member

Kept the :feature:amazon module with the dependency on the Amazon SDK, and the Android manifest permission, but moved its classes into the purchases module

// https://github.com/robolectric/robolectric-gradle-plugin/issues/144#issuecomment-265899560
tasks.withType(Test) { jvmArgs += "-noverify" }

task getAmazonLibrary {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't been used anymore


// Not running with this flag causes verification issues due to the way the Amazon jar is compiled
// https://github.com/robolectric/robolectric-gradle-plugin/issues/144#issuecomment-265899560
tasks.withType(Test) { jvmArgs += "-noverify" }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this and saw no errors, so removed it

<activity
android:name=".purchasing.ProxyAmazonBillingActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also moved this Activity into the purchases module and kept it internal

Comment thread purchases/build.gradle
testImplementation libs.bundles.test
testImplementation libs.billing
testImplementation libs.coroutines.test
testImplementation libs.amazon.appstore.sdk

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testCompileOnly doesn't make the classes available at runtime.

import androidx.annotation.VisibleForTesting
import com.revenuecat.purchases.amazon.PurchasingServiceProvider
import com.revenuecat.purchases.amazon.R
import com.revenuecat.purchases.api.R

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved the resources into the purchases module, so R will be under that namespace

@vegaro vegaro marked this pull request as ready for review June 29, 2023 18:04
@vegaro vegaro requested a review from a team June 29, 2023 18:04
@codecov

codecov Bot commented Jun 30, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1112 (308bfcf) into main (5a5c66d) will decrease coverage by 0.01%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##             main    #1112      +/-   ##
==========================================
- Coverage   85.12%   85.11%   -0.01%     
==========================================
  Files         183      183              
  Lines        6493     6490       -3     
  Branches      917      917              
==========================================
- Hits         5527     5524       -3     
  Misses        601      601              
  Partials      365      365              
Impacted Files Coverage Δ
...a/com/revenuecat/purchases/amazon/AmazonBackend.kt 85.71% <ø> (ø)
...a/com/revenuecat/purchases/amazon/AmazonBilling.kt 63.25% <ø> (ø)
...ava/com/revenuecat/purchases/amazon/AmazonCache.kt 85.71% <ø> (ø)
...evenuecat/purchases/amazon/AmazonOfferingParser.kt 100.00% <ø> (ø)
...evenuecat/purchases/amazon/AmazonPurchasingData.kt 100.00% <ø> (ø)
.../revenuecat/purchases/amazon/AmazonStoreProduct.kt 92.85% <ø> (ø)
...a/com/revenuecat/purchases/amazon/AmazonStrings.kt 0.00% <ø> (ø)
...rchases/amazon/DefaultPurchasingServiceProvider.kt 14.28% <ø> (ø)
...rchases/amazon/ISO3166Alpha2ToISO42170Converter.kt 99.59% <ø> (ø)
...azon/attribution/AmazonDeviceIdentifiersFetcher.kt 100.00% <ø> (ø)
... and 16 more

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment... I'm not sure if that's going to be a blocker for this project... Lmk what you think.


/** @suppress */
typealias PostAmazonReceiptCallback = Pair<(response: JSONObject) -> Unit, (PurchasesError) -> Unit>
internal typealias PostAmazonReceiptCallback = Pair<(response: JSONObject) -> Unit, (PurchasesError) -> Unit>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do all these internal changes make this a breaking change? Since that we were overexposing things in the Amazon module 😬

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, that's actually a good point, I didn't think people are directly depending on amazon. I will revert this visibility changes then

@vegaro vegaro requested a review from tonidero June 30, 2023 07:26

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@vegaro vegaro merged commit 6f336b1 into main Jun 30, 2023
@vegaro vegaro deleted the cesar/sdk-3211-move-featureamazon-files-into-common-module branch June 30, 2023 07:38
tonidero added a commit that referenced this pull request Jul 12, 2023
**This is an automatic release.**

### New Features
* `Trusted Entitlements`: made API stable (#1105) via NachoSoto
(@NachoSoto)

This new feature prevents MitM attacks between the SDK and the
RevenueCat server.
With verification enabled, the SDK ensures that the response created by
the server was not modified by a third-party, and the entitlements
received are exactly what was sent.
This is 100% opt-in. `EntitlementInfos` have a new `VerificationResult`
property, which will indicate the validity of the responses when this
feature is enabled.

```kotlin
fun configureRevenueCat() {
    val configuration = PurchasesConfiguration.Builder(context, apiKey)
        .entitlementVerificationMode(EntitlementVerificationMode.INFORMATIONAL)
        .build()
    Purchases.configure(configuration)
}
```
### Experimental features
* Add await offerings (#1096) via Cesar de la Vega (@vegaro)
### Bugfixes
* Fix issue updating customer info on app open (#1128) via Toni Rico
(@tonidero)
### Dependency Updates
* Bump fastlane-plugin-revenuecat_internal from `13773d2` to `b2108fb`
(#1095) via dependabot[bot] (@dependabot[bot])
### Other Changes
* [PurchaseTester] Add option to purchase an arbitrary product id
(#1099) via Mark Villacampa (@MarkVillacampa)
* Fix release path after module refactor (#1129) via Toni Rico
(@tonidero)
* Fix load shedder integration tests (#1125) via Toni Rico (@tonidero)
* Trusted entitlements: New trusted entitlements signature format
(#1117) via Toni Rico (@tonidero)
* Fix integration tests and change to a different project (#1123) via
Toni Rico (@tonidero)
* Move files into src/main/kotlin (#1122) via Cesar de la Vega (@vegaro)
* Remove public module (#1113) via Cesar de la Vega (@vegaro)
* Remove common module (#1106) via Cesar de la Vega (@vegaro)
* Fix flaky integration tests: Wait for coroutines to finish before
continuing (#1120) via Toni Rico (@tonidero)
* Move amazon module into purchases (#1112) via Cesar de la Vega
(@vegaro)
* Trusted entitlements: Add IntermediateSignatureHelper to handle
intermediate signature verification process (#1110) via Toni Rico
(@tonidero)
* Trusted entitlements: Add Signature type to process new signature
response format (#1109) via Toni Rico (@tonidero)
* [EXTERNAL] Add `awaitCustomerInfo` / coroutines tests to
`TrustedEntitlementsInformationalModeIntegrationTest` (#1077) via
@pablo-guardiola (#1107) via Toni Rico (@tonidero)
* Remove feature:google module (#1104) via Cesar de la Vega (@vegaro)
* Remove identity module (#1103) via Cesar de la Vega (@vegaro)
* Remove subscriber attributes module (#1102) via Cesar de la Vega
(@vegaro)
* Delete utils module (#1098) via Cesar de la Vega (@vegaro)
* Remove strings module (#1097) via Cesar de la Vega (@vegaro)
* Update CHANGELOG.md to include external contribution (#1100) via Cesar
de la Vega (@vegaro)
* [EXTERNAL] Add missing `fetchPolicy` parameter to `awaitCustomerInfo`
API (#1086) via @pablo-guardiola (#1090) via Toni Rico (@tonidero)

---------

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants