Skip to content

Commit

Permalink
[antifeature] crippleware
Browse files Browse the repository at this point in the history
  • Loading branch information
thermatk committed Jun 20, 2018
1 parent b1d88ea commit c160a0a
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 580 deletions.
8 changes: 0 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
android:theme="@style/SplashTheme"
tools:replace="android:allowBackup"
tools:targetApi="n">
<activity
android:name=".ui.modules.main.donation.CheckPurchaseActivity"
android:configChanges="keyboard|orientation|screenSize"
android:theme="@style/ThemeTranslucent"/>
<activity
android:name=".ui.modules.main.MainActivity"
android:launchMode="singleTask"
Expand Down Expand Up @@ -201,10 +197,6 @@
<activity
android:name=".ui.modules.theme.code.ThemeCodeActivity"
android:label="@string/theme_title"/>
<activity
android:name=".ui.modules.main.donation.DonateActivity"
android:configChanges="keyboard|orientation|screenSize"
android:theme="@style/ThemeTranslucent"/>
<activity
android:name=".ui.modules.repos.wiki.WikiActivity"
android:label="@string/gollum"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import com.fastaccess.helper.ViewHelper
import com.fastaccess.ui.base.BaseActivity
import com.fastaccess.ui.modules.login.LoginActivity
import com.fastaccess.ui.modules.login.chooser.LoginChooserActivity
import com.fastaccess.ui.modules.main.donation.DonateActivity

/**
* Created by Kosh on 07 Jun 2017, 6:52 PM
Expand Down Expand Up @@ -265,6 +264,5 @@ object ThemeEngine {
BitmapFactory.decodeResource(activity.resources, R.mipmap.ic_launcher), ViewHelper.getPrimaryColor(activity)))
}

private fun hasTheme(activity: BaseActivity<*, *>) = (activity is LoginChooserActivity || activity is LoginActivity ||
activity is DonateActivity)
private fun hasTheme(activity: BaseActivity<*, *>) = (activity is LoginChooserActivity || activity is LoginActivity)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.fastaccess.provider.tasks.version.CheckVersionService;
import com.fastaccess.provider.theme.ThemeEngine;
import com.fastaccess.ui.modules.changelog.ChangelogBottomSheetDialog;
import com.fastaccess.ui.modules.main.donation.DonationActivity;
import com.fastaccess.ui.modules.repos.RepoPagerActivity;
import com.fastaccess.ui.modules.repos.issues.create.CreateIssueActivity;
import com.fastaccess.ui.modules.user.UserPagerActivity;
Expand Down Expand Up @@ -86,6 +87,14 @@ private void buildLibre(Context context, MaterialAboutCard.Builder libreCardBuil
.subText("by thermatk")
.icon(ContextCompat.getDrawable(context, R.drawable.ic_github))
.setOnClickAction(() -> startActivity(RepoPagerActivity.createIntent(this, "FastHub-Libre", "thermatk")))
.build())
.addItem(new MaterialAboutActionItem.Builder()
.text("Unlock all features")
.subText("but don't forget to support developers!")
.icon(ContextCompat.getDrawable(context, R.drawable.ic_lock))
.setOnClickAction(() -> {
startActivity(new Intent(context, DonationActivity.class));
})
.build());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TextInputEditText;
Expand All @@ -14,23 +13,17 @@

import com.evernote.android.state.State;
import com.fastaccess.App;
import com.fastaccess.BuildConfig;
import com.fastaccess.R;
import com.fastaccess.helper.ActivityHelper;
import com.fastaccess.helper.AnimHelper;
import com.fastaccess.helper.AppHelper;
import com.fastaccess.helper.BundleConstant;
import com.fastaccess.helper.Bundler;
import com.fastaccess.helper.InputHelper;
import com.fastaccess.helper.Logger;
import com.fastaccess.ui.base.BaseActivity;
import com.fastaccess.ui.modules.login.chooser.LoginChooserActivity;
import com.fastaccess.ui.modules.main.donation.DonateActivity;
import com.fastaccess.ui.widgets.FontCheckbox;
import com.fastaccess.ui.widgets.dialog.MessageDialogView;
import com.miguelbcr.io.rx_billing_service.RxBillingService;
import com.miguelbcr.io.rx_billing_service.entities.ProductType;
import com.miguelbcr.io.rx_billing_service.entities.Purchase;

import butterknife.BindView;
import butterknife.OnCheckedChanged;
Expand Down Expand Up @@ -163,10 +156,8 @@ public static void start(@NonNull Activity activity, boolean isBasicAuth, boolea
}

@Override public void onSuccessfullyLoggedIn(boolean extraLogin) {
checkPurchases(() -> {
hideProgress();
onRestartApp();
});
hideProgress();
onRestartApp();
}

@Override protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -228,29 +219,6 @@ public static void start(@NonNull Activity activity, boolean isBasicAuth, boolea
login.show();
}

protected void checkPurchases(@Nullable Action action) {
getPresenter().manageViewDisposable(RxBillingService.getInstance(this, BuildConfig.DEBUG)
.getPurchases(ProductType.IN_APP)
.doOnSubscribe(disposable -> showProgress(0))
.subscribe((purchases, throwable) -> {
hideProgress();
if (throwable == null) {
Logger.e(purchases);
if (purchases != null && !purchases.isEmpty()) {
for (Purchase purchase : purchases) {
String sku = purchase.sku();
if (!InputHelper.isEmpty(sku)) {
DonateActivity.Companion.enableProduct(sku, App.getInstance());
}
}
}
} else {
throwable.printStackTrace();
}
if (action != null) action.run();
}));
}

private void doLogin() {
if (progress.getVisibility() == View.GONE) {
getPresenter().login(InputHelper.toString(username),
Expand Down

This file was deleted.

This file was deleted.

Loading

1 comment on commit c160a0a

@HitaloM
Copy link

@HitaloM HitaloM commented on c160a0a Dec 25, 2019

Choose a reason for hiding this comment

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

FastHub v4.6.9 has been released, you want to update FastHub-Libre?

Please sign in to comment.