mirror of https://github.com/tasks/tasks
Remove Amazon build flavor
parent
29d1b54ca7
commit
b40fadd02c
Binary file not shown.
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.tasks">
|
||||
|
||||
<application tools:ignore="GoogleAppIndexingWarning">
|
||||
<receiver
|
||||
android:name="com.amazon.device.iap.ResponseReceiver"
|
||||
android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY">
|
||||
<intent-filter>
|
||||
<action android:name="com.amazon.inapp.purchasing.NOTIFY"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -1,34 +0,0 @@
|
||||
package org.tasks.analytics;
|
||||
|
||||
import android.content.Context;
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import io.fabric.sdk.android.Fabric;
|
||||
import javax.inject.Inject;
|
||||
import org.tasks.injection.ApplicationScope;
|
||||
import org.tasks.injection.ForApplication;
|
||||
import org.tasks.preferences.Preferences;
|
||||
import timber.log.Timber;
|
||||
|
||||
@ApplicationScope
|
||||
public class Tracker {
|
||||
|
||||
private static boolean enabled;
|
||||
|
||||
@Inject
|
||||
public Tracker(@ForApplication Context context, Preferences preferences) {
|
||||
enabled = preferences.isTrackingEnabled();
|
||||
if (enabled) {
|
||||
FirebaseAnalytics analytics = FirebaseAnalytics.getInstance(context);
|
||||
analytics.setAnalyticsCollectionEnabled(true);
|
||||
Fabric.with(context, new Crashlytics());
|
||||
}
|
||||
}
|
||||
|
||||
public void reportException(Throwable t) {
|
||||
Timber.e(t);
|
||||
if (enabled) {
|
||||
Crashlytics.logException(t);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
package org.tasks.billing;
|
||||
|
||||
import static com.google.common.collect.Iterables.transform;
|
||||
import static com.google.common.collect.Lists.newArrayList;
|
||||
import static com.google.common.collect.Lists.transform;
|
||||
import static com.google.common.collect.Sets.newHashSet;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.Observer;
|
||||
import com.amazon.device.iap.PurchasingListener;
|
||||
import com.amazon.device.iap.PurchasingService;
|
||||
import com.amazon.device.iap.model.FulfillmentResult;
|
||||
import com.amazon.device.iap.model.ProductDataResponse;
|
||||
import com.amazon.device.iap.model.PurchaseResponse;
|
||||
import com.amazon.device.iap.model.PurchaseUpdatesResponse;
|
||||
import com.amazon.device.iap.model.PurchaseUpdatesResponse.RequestStatus;
|
||||
import com.amazon.device.iap.model.UserDataResponse;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import org.tasks.analytics.Tracker;
|
||||
import org.tasks.injection.ForApplication;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class BillingClientImpl implements BillingClient, PurchasingListener {
|
||||
|
||||
private final MutableLiveData<List<SkuDetails>> skuDetails = new MutableLiveData<>();
|
||||
private final Inventory inventory;
|
||||
|
||||
@Inject
|
||||
public BillingClientImpl(@ForApplication Context context, Inventory inventory, Tracker tracker) {
|
||||
this.inventory = inventory;
|
||||
PurchasingService.registerListener(context, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void observeSkuDetails(
|
||||
LifecycleOwner owner,
|
||||
Observer<List<SkuDetails>> subscriptionObserver,
|
||||
Observer<List<SkuDetails>> iapObserver) {
|
||||
skuDetails.observe(owner, subscriptionObserver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void queryPurchases() {
|
||||
PurchasingService.getPurchaseUpdates(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void querySkuDetails() {
|
||||
PurchasingService.getProductData(newHashSet(SkuDetails.SKU_PRO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void consume(String sku) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiatePurchaseFlow(
|
||||
Activity activity, String sku, String skuType, @Nullable String oldSku) {
|
||||
PurchasingService.purchase(sku);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPurchaseCallback(OnPurchasesUpdated onPurchasesUpdated) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getErrorMessage() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserDataResponse(UserDataResponse userDataResponse) {
|
||||
Timber.d("onUserDataResponse(%s)", userDataResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProductDataResponse(ProductDataResponse productDataResponse) {
|
||||
Timber.d("onProductDataResponse(%s)", productDataResponse);
|
||||
if (productDataResponse.getRequestStatus() == ProductDataResponse.RequestStatus.SUCCESSFUL) {
|
||||
skuDetails.setValue(
|
||||
newArrayList(transform(productDataResponse.getProductData().values(), SkuDetails::new)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPurchaseResponse(PurchaseResponse purchaseResponse) {
|
||||
Timber.d("onPurchaseResponse(%s)", purchaseResponse);
|
||||
if (purchaseResponse.getRequestStatus() == PurchaseResponse.RequestStatus.SUCCESSFUL) {
|
||||
inventory.add(new Purchase(purchaseResponse.getReceipt()));
|
||||
PurchasingService.notifyFulfillment(
|
||||
purchaseResponse.getReceipt().getReceiptId(), FulfillmentResult.FULFILLED);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPurchaseUpdatesResponse(PurchaseUpdatesResponse purchaseUpdatesResponse) {
|
||||
Timber.d("onPurchaseUpdatesResponse(%s)", purchaseUpdatesResponse);
|
||||
if (purchaseUpdatesResponse.getRequestStatus() == RequestStatus.SUCCESSFUL) {
|
||||
inventory.clear();
|
||||
inventory.add(transform(purchaseUpdatesResponse.getReceipts(), Purchase::new));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
package org.tasks.billing;
|
||||
|
||||
import com.amazon.device.iap.model.Receipt;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
public class Purchase {
|
||||
|
||||
private final Receipt receipt;
|
||||
|
||||
public Purchase(String json) {
|
||||
this(new GsonBuilder().create().fromJson(json, Receipt.class));
|
||||
}
|
||||
|
||||
public Purchase(Receipt receipt) {
|
||||
this.receipt = receipt;
|
||||
}
|
||||
|
||||
public String getSku() {
|
||||
return receipt.getSku();
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
return new GsonBuilder().create().toJson(receipt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Purchase{" + "receipt=" + receipt + '}';
|
||||
}
|
||||
|
||||
public boolean isCanceled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getSubscriptionPrice() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean isMonthly() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isProSubscription() {
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package org.tasks.billing;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class SignatureVerifier {
|
||||
@Inject
|
||||
public SignatureVerifier() {}
|
||||
|
||||
public boolean verifySignature(Purchase purchase) {
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package org.tasks.billing;
|
||||
|
||||
import com.amazon.device.iap.model.Product;
|
||||
import com.amazon.device.iap.model.ProductType;
|
||||
|
||||
public class SkuDetails {
|
||||
|
||||
static final String SKU_PRO = "tasks_pro";
|
||||
|
||||
static final String TYPE_INAPP = ProductType.CONSUMABLE.name();
|
||||
static final String TYPE_SUBS = ProductType.SUBSCRIPTION.name();
|
||||
|
||||
private final Product product;
|
||||
|
||||
public SkuDetails(Product product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public String getSku() {
|
||||
return product.getSku();
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return product.getTitle();
|
||||
}
|
||||
|
||||
public String getPrice() {
|
||||
return product.getPrice();
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return product.getDescription();
|
||||
}
|
||||
|
||||
public String getSkuType() {
|
||||
return product.getProductType().name();
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package org.tasks.gtasks;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import com.todoroo.astrid.activity.MainActivity;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.disposables.Disposables;
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class PlayServices {
|
||||
|
||||
@Inject
|
||||
public PlayServices() {}
|
||||
|
||||
public boolean isPlayServicesAvailable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean refreshAndCheck() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void resolve(Activity activity) {}
|
||||
|
||||
public String getStatus() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Disposable check(MainActivity mainActivity) {
|
||||
return Disposables.empty();
|
||||
}
|
||||
|
||||
public void updateSecurityProvider(Context context) {}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package org.tasks.injection;
|
||||
|
||||
import android.content.Context;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import org.tasks.location.MapFragment;
|
||||
import org.tasks.location.MapboxMapFragment;
|
||||
import org.tasks.location.MapboxSearchProvider;
|
||||
import org.tasks.location.PlaceSearchProvider;
|
||||
|
||||
@Module
|
||||
public class LocationModule {
|
||||
@Provides
|
||||
@ActivityScope
|
||||
public PlaceSearchProvider getPlaceSearchProvider(@ForApplication Context context) {
|
||||
return new MapboxSearchProvider(context);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ActivityScope
|
||||
public MapFragment getMapFragment(@ForApplication Context context) {
|
||||
return new MapboxMapFragment(context);
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package org.tasks.location;
|
||||
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import org.tasks.data.Location;
|
||||
|
||||
@SuppressWarnings("EmptyMethod")
|
||||
public class GeofenceApi {
|
||||
|
||||
@Inject
|
||||
public GeofenceApi() {}
|
||||
|
||||
public void register(List<Location> activeGeofences) {}
|
||||
|
||||
public void cancel(Location geofence) {}
|
||||
|
||||
public void cancel(List<Location> geofences) {}
|
||||
|
||||
public void cancel(long taskId) {}
|
||||
|
||||
public void register(long taskId) {}
|
||||
|
||||
public void registerAll() {}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package org.tasks.location;
|
||||
|
||||
import android.app.IntentService;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class GeofenceTransitionsIntentService extends IntentService {
|
||||
|
||||
public GeofenceTransitionsIntentService() {
|
||||
super("GeofenceTransitionsIntentService");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onHandleIntent(@Nullable Intent intent) {}
|
||||
|
||||
public static class Broadcast extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {}
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<bool name="support_geofences">false</bool>
|
||||
</resources>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="common_google_play_services_notification_ticker">Google Play services error</string>
|
||||
<string name="market_url">amzn://apps/android?p=org.tasks</string>
|
||||
<string name="p_purchases">purchases_amazon</string>
|
||||
<string name="manage_subscription_url">https://www.amazon.com/gp/mas/your-account/myapps/yoursubscriptions/ref=d2_ss_app_sb_myas</string>
|
||||
<string name="support_email">amazon-support@tasks.org</string>
|
||||
</resources>
|
Loading…
Reference in New Issue