This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
2,130 additions
and
88 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ allprojects { | |
} | ||
|
||
ext { | ||
compileSdkVersion = 21 | ||
compileSdkVersion = 22 | ||
buildToolsVersion = "22.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2012-2015 One Platform Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
apply plugin: 'idea' | ||
apply plugin: 'com.android.library' | ||
apply from: urlCache.get('https://raw.githubusercontent.com/onepf/OPF-mvn-repo/gradle-commons/opf-commons.gradle') | ||
|
||
android { | ||
defaultConfig { | ||
minSdkVersion 15 | ||
targetSdkVersion 22 | ||
versionCode 1 | ||
versionName "0.3.0-SNAPSHOT" | ||
} | ||
} | ||
|
||
dependencies { | ||
// compile('org.onepf:opfiab:0.3.+@aar') { | ||
// changing = true | ||
// } | ||
compile project(':opfiab') | ||
//noinspection GradleDynamicVersion | ||
provided('org.onepf:opfutils:0.1.+') { | ||
changing = true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# | ||
# Copyright 2012-2015 One Platform Foundation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
POM_ARTIFACT_ID = opfiab-google | ||
POM_NAME = OPFIab Google module | ||
POM_DESCRIPTION = Adds Google billing provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /usr/local/Cellar/android-sdk/24.2/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- | ||
~ Copyright 2012-2015 One Platform Foundation | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="org.onepf.opfiab.openstore"> | ||
|
||
</manifest> |
62 changes: 62 additions & 0 deletions
62
opfiab-providers/openstore/src/main/aidl/org/onepf/oms/IOpenAppstore.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/******************************************************************************* | ||
* Copyright 2013 One Platform Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
******************************************************************************/ | ||
package org.onepf.oms; | ||
|
||
import android.content.Intent; | ||
|
||
/** | ||
* Service interface to implement by OpenStore implementation | ||
* | ||
* @author Boris Minaev, Oleg Orlov | ||
* @since 29.04.2013 | ||
*/ | ||
interface IOpenAppstore { | ||
|
||
/** | ||
* Every OpenStore implementation must provide their name. It's required for core OpenIAB functions | ||
*/ | ||
String getAppstoreName(); | ||
|
||
/** | ||
* OpenStores must provide information about packages it installed. If OpenStore is installer | ||
* and supports In-App billing it will be used for purchases | ||
*/ | ||
boolean isPackageInstaller(String packageName); | ||
|
||
/** | ||
* If <b>true</b> OpenIAB assumes In-App items (SKU) for app are published and ready to use | ||
*/ | ||
boolean isBillingAvailable(String packageName); | ||
|
||
/** | ||
* Provides android:versionCode of .apk published in OpenStore | ||
* @return -1 if UNDEFINED | ||
*/ | ||
int getPackageVersion(String packageName); | ||
|
||
/** | ||
* Should provide Intent to be used for binding IOpenInAppBillingService | ||
*/ | ||
Intent getBillingServiceIntent(); | ||
|
||
Intent getProductPageIntent(String packageName); | ||
|
||
Intent getRateItPageIntent(String packageName); | ||
|
||
Intent getSameDeveloperPageIntent(String packageName); | ||
|
||
boolean areOutsideLinksAllowed(); | ||
} |
50 changes: 50 additions & 0 deletions
50
opfiab-providers/openstore/src/main/aidl/org/onepf/oms/IOpenInAppBillingService.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/******************************************************************************* | ||
* Copyright 2013 One Platform Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
******************************************************************************/ | ||
|
||
package org.onepf.oms; | ||
|
||
/** | ||
* IOpenInAppBillingService is the service that provides in-app billing. | ||
* It's based on com.android.vending.billing.IInAppBillingService provided by Google Play In-App API v3 | ||
* This service provides the following features: | ||
* 1. Provides a new API to get details of in-app items published for the app including | ||
* price, type, title and description. | ||
* 2. The purchase flow is synchronous and purchase information is available immediately | ||
* after it completes. | ||
* 3. Purchase information of in-app purchases is maintained within the Google Play system | ||
* till the purchase is consumed. | ||
* 4. An API to consume a purchase of an inapp item. All purchases of one-time | ||
* in-app items are consumable and thereafter can be purchased again. | ||
* 5. An API to get current purchases of the user immediately. This will not contain any | ||
* consumed purchases. | ||
* | ||
* All calls will give a response code with the following possible values | ||
* RESULT_OK = 0 - success | ||
* RESULT_USER_CANCELED = 1 - user pressed back or canceled a dialog | ||
* RESULT_BILLING_UNAVAILABLE = 3 - this billing API version is not supported for the type requested | ||
* RESULT_ITEM_UNAVAILABLE = 4 - requested SKU is not available for purchase | ||
* RESULT_DEVELOPER_ERROR = 5 - invalid arguments provided to the API | ||
* RESULT_ERROR = 6 - Fatal error during the API action | ||
* RESULT_ITEM_ALREADY_OWNED = 7 - Failure to purchase since item is already owned | ||
* RESULT_ITEM_NOT_OWNED = 8 - Failure to consume since item is not owned | ||
*/ | ||
interface IOpenInAppBillingService { | ||
int isBillingSupported(int apiVersion, String packageName, String type); | ||
Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle); | ||
Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type, String developerPayload); | ||
Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken); | ||
int consumePurchase(int apiVersion, String packageName, String purchaseToken); | ||
} |
57 changes: 57 additions & 0 deletions
57
...-providers/openstore/src/main/java/org/onepf/opfiab/openstore/ApplandBillingProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright 2012-2015 One Platform Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.onepf.opfiab.openstore; | ||
|
||
import android.content.Context; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
|
||
import org.onepf.opfiab.billing.BaseBillingProvider; | ||
import org.onepf.opfiab.sku.TypedSkuResolver; | ||
import org.onepf.opfiab.verification.PurchaseVerifier; | ||
|
||
public class ApplandBillingProvider extends OpenStoreBillingProvider { | ||
|
||
public static final String NAME = "APPLAND"; | ||
protected static final String[] PACKAGES = new String[]{"se.appland.market.android"}; | ||
|
||
|
||
public ApplandBillingProvider(@NonNull final Context context, | ||
@NonNull final TypedSkuResolver skuResolver, | ||
@NonNull final PurchaseVerifier purchaseVerifier, | ||
@Nullable final OpenStoreIntentMaker intentMaker) { | ||
super(context, skuResolver, purchaseVerifier, intentMaker); | ||
} | ||
|
||
public static class Builder extends OpenStoreBuilder<Builder> { | ||
|
||
public Builder(@NonNull final Context context) { | ||
super(context); | ||
setIntentMaker(OpenStoreUtils.getIntentMaker(NAME, PACKAGES)); | ||
} | ||
|
||
@Override | ||
public BaseBillingProvider build() { | ||
if (skuResolver == null) { | ||
throw new IllegalStateException(); | ||
} | ||
return new ApplandBillingProvider(context, skuResolver, | ||
purchaseVerifier == null ? PurchaseVerifier.DEFAULT : purchaseVerifier, | ||
intentMaker); | ||
} | ||
} | ||
} |
Oops, something went wrong.