Skip to content

Commit

Permalink
Misc: Convert play to pro flavour
Browse files Browse the repository at this point in the history
Signed-off-by: sunilpaulmathew <sunil.kde@gmail.com>
  • Loading branch information
sunilpaulmathew committed Jul 10, 2022
1 parent 431ce7a commit 5999943
Show file tree
Hide file tree
Showing 26 changed files with 49 additions and 712 deletions.
13 changes: 6 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ android {

flavorDimensions "release"
productFlavors {
play {
pro {
dimension "release"
applicationIdSuffix '.release'
applicationIdSuffix '.pro'
}
fdroid {
dimension "release"
Expand All @@ -54,14 +54,13 @@ android {
dependencies {
implementation 'androidx.biometric:biometric:1.1.0'
implementation 'androidx.preference:preference:1.2.0'
playImplementation 'com.android.billingclient:billing:4.1.0'
implementation 'com.github.ozodrukh:CircularReveal:1.3.1'
implementation 'com.github.sunilpaulmathew:sCommon:8d845e6de5'
implementation 'com.github.sunilpaulmathew:RootFilePicker:792443f0d8'
implementation 'com.github.topjohnwu.libsu:core:3.2.1'
implementation 'com.github.sunilpaulmathew:sCommon:f741dad243'
implementation 'com.github.sunilpaulmathew:RootFilePicker:15245677c6'
implementation 'com.github.topjohnwu.libsu:core:4.0.3'
implementation "com.github.topjohnwu.libsu:io:3.1.2"
implementation 'com.google.android.apps.dashclock:dashclock-api:2.0.0'
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'org.cyanogenmod:platform.sdk:6.0'
implementation project (':seekbar')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private void aboutInit(List<RecyclerViewItem> items) {
DescriptionView versioninfo = new DescriptionView();
versioninfo.setDrawable(getResources().getDrawable(R.drawable.ic_on_boot_notification));
versioninfo.setTitle(getString(R.string.version,"").replace(": ", ""));
versioninfo.setSummary((Utils.isDonated(requireActivity()) ? " Pro " : " ") + BuildConfig.VERSION_NAME);
versioninfo.setSummary(((Utils.isDonated(requireActivity()) || !Utils.isFDroidFlavor(requireActivity())) ? " Pro " : " ") + BuildConfig.VERSION_NAME);
versioninfo.setOnItemClickListener(item -> {
Intent settings = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
settings.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Expand Down Expand Up @@ -127,7 +127,7 @@ private void aboutInit(List<RecyclerViewItem> items) {
appStore.setTitle(getString(Utils.isFDroidFlavor(requireActivity()) ? R.string.fdroid : R.string.playstore));
appStore.setSummary(getString(Utils.isFDroidFlavor(requireActivity()) ? R.string.fdroid_summary : R.string.playstore_summary));
appStore.setOnItemClickListener(item -> Utils.launchUrl(Utils.isFDroidFlavor(requireActivity()) ? "https://f-droid.org/packages/com.smartpack.kernelmanager" :
"https://play.google.com/store/apps/details?id=com.smartpack.kernelmanager.release", requireActivity()));
"https://play.google.com/store/apps/details?id=com.smartpack.kernelmanager.pro", requireActivity()));

DescriptionView donatetome = new DescriptionView();
donatetome.setDrawable(getResources().getDrawable(R.drawable.ic_donate));
Expand All @@ -145,7 +145,7 @@ private void aboutInit(List<RecyclerViewItem> items) {
shareapp.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name));
shareapp.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_app_message,BuildConfig.VERSION_NAME)
+ (Utils.isFDroidFlavor(requireActivity()) ? " F-Droid: https://f-droid.org/packages/com.smartpack.kernelmanager"
: " Google Play: https://play.google.com/store/apps/details?id=com.smartpack.kernelmanager.release"));
: " Google Play: https://play.google.com/store/apps/details?id=com.smartpack.kernelmanager.pro"));
shareapp.setType("text/plain");
Intent shareIntent = Intent.createChooser(shareapp, null);
startActivity(shareIntent);
Expand All @@ -157,7 +157,9 @@ private void aboutInit(List<RecyclerViewItem> items) {
items.add(support);
items.add(changelogs);
items.add(sourcecode);
items.add(donatetome);
if (Utils.isFDroidFlavor(requireActivity())) {
items.add(donatetome);
}
items.add(share);
items.add(appStore);
}
Expand Down Expand Up @@ -202,7 +204,7 @@ private void librariesInit(List<RecyclerViewItem> items) {
sUtils.getDrawable(R.mipmap.ic_launcher, requireActivity()),
sUtils.getDrawable(R.drawable.ic_back, requireActivity()),
ViewUtils.getThemeAccentColor(requireActivity()),
18, getString(R.string.app_name), "2021-2022, sunilpaulmathew",
18, getString(R.string.app_name), "2022-2023, sunilpaulmathew",
BuildConfig.VERSION_NAME).launchCredits(requireActivity()));
credits.addItem(creditsSummary);
items.add(credits);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import in.sunilpaulmathew.rootfilepicker.activities.FilePickerActivity;
import in.sunilpaulmathew.rootfilepicker.utils.FilePicker;
import in.sunilpaulmathew.sCommon.Utils.sExecutor;
import in.sunilpaulmathew.sCommon.Utils.sPackageUtils;

/**
* Created by sunilpaulmathew <sunil.kde@gmail.com> on December 18, 2019
Expand Down Expand Up @@ -240,17 +239,6 @@ private void load(List<RecyclerViewItem> items) {
items.add(descriptionView);
}
}
if (items.size() == 0) {
if (!sPackageUtils.isPackageInstalled("com.smartpack.scriptmanager", requireActivity())) {
// Advertise Own App
DescriptionView sm = new DescriptionView();
sm.setDrawable(getResources().getDrawable(R.drawable.ic_playstore));
sm.setSummary(getString(R.string.scripts_manager_message));
sm.setFullSpan(true);
sm.setOnItemClickListener(item -> Utils.launchUrl("https://play.google.com/store/apps/details?id=com.smartpack.scriptmanager", getActivity()));
items.add(sm);
}
}
}

@SuppressLint("StaticFieldLeak")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,8 @@ public class Utils {

private static final String TAG = Utils.class.getSimpleName();

public static boolean isSPDonated(Context context) {
return sPackageUtils.isPackageInstalled("com.smartpack.donate", context);
}

public static boolean isDonated(Context context) {
return isSPDonated(context) || Prefs.getBoolean("support_received", false, context);
return sPackageUtils.isPackageInstalled("com.smartpack.donate", context);
}

public static boolean isFDroidFlavor(Context context) {
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/res/drawable/ic_coffee.xml

This file was deleted.

18 changes: 0 additions & 18 deletions app/src/main/res/drawable/ic_dinner.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_heart.xml

This file was deleted.

Loading

0 comments on commit 5999943

Please sign in to comment.