diff --git a/app/src/main/java/com/smartpack/kernelprofiler/MainActivity.java b/app/src/main/java/com/smartpack/kernelprofiler/MainActivity.java index a75635b..fdd2cf1 100644 --- a/app/src/main/java/com/smartpack/kernelprofiler/MainActivity.java +++ b/app/src/main/java/com/smartpack/kernelprofiler/MainActivity.java @@ -96,7 +96,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { helpIcon.setImageDrawable(Utils.getColoredIcon(R.drawable.ic_help, this)); Utils.snackbarIndenite(mViewPager, getString(R.string.unsupported_message)); helpIcon.setOnClickListener(v -> { - Utils.snackbarIndenite(mViewPager, "Soon"); + new AlertDialog.Builder(this) + .setIcon(R.mipmap.ic_launcher) + .setTitle(getString(R.string.unsupported)) + .setMessage(getString(R.string.unsupported_summary) + " " + getString(R.string.unsupported_message) + + "\n\n" + getString(R.string.unsupported_help_message)) + .setPositiveButton(getString(R.string.cancel), (dialog1, id1) -> { + }) + .show(); }); return; } diff --git a/app/src/main/java/com/smartpack/kernelprofiler/fragments/KPFragment.java b/app/src/main/java/com/smartpack/kernelprofiler/fragments/KPFragment.java index 4ca5795..6169a10 100644 --- a/app/src/main/java/com/smartpack/kernelprofiler/fragments/KPFragment.java +++ b/app/src/main/java/com/smartpack/kernelprofiler/fragments/KPFragment.java @@ -83,7 +83,11 @@ private void load(List items) { if (KP.KPFile().length() > 0 && KP.isKPProfile(kpProfiles.toString())) { DescriptionView kpProfile = new DescriptionView(); kpProfile.setTitle(kpProfiles.getName().replace(".sh", "")); - kpProfile.setSummary(KP.getProfileDescription(kpProfiles.toString())); + String description = KP.getProfileDescription(kpProfiles.toString()); + if (description == null) { + description = getString(R.string.description_unknown); + } + kpProfile.setSummary(description); kpProfile.setFullSpan(true); kpProfile.setChecked(kpProfiles.getName().equals(KP.getDefaultProfile())); kpProfile.setOnCheckBoxListener((descriptionView, isChecked) -> { diff --git a/app/src/main/java/com/smartpack/kernelprofiler/utils/CreateConfigActivity.java b/app/src/main/java/com/smartpack/kernelprofiler/utils/CreateConfigActivity.java index 25ed674..e4a7873 100644 --- a/app/src/main/java/com/smartpack/kernelprofiler/utils/CreateConfigActivity.java +++ b/app/src/main/java/com/smartpack/kernelprofiler/utils/CreateConfigActivity.java @@ -95,26 +95,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { }); } - private void closeForeground() { - mProfileTitleHint.setVisibility(View.GONE); - mDescriptionHint.setVisibility(View.GONE); - mDefaultHint.setVisibility(View.GONE); - mDeveloperHint.setVisibility(View.GONE); - mSupportHint.setVisibility(View.GONE); - mDonationsHint.setVisibility(View.GONE); - mTitle.setVisibility(View.GONE); - mProfileTitle.setVisibility(View.GONE); - mDescription.setVisibility(View.GONE); - mDefault.setVisibility(View.GONE); - mDeveloper.setVisibility(View.GONE); - mSupport.setVisibility(View.GONE); - mDonation.setVisibility(View.GONE); - super.onBackPressed(); - } - @Override public void onBackPressed() { - closeForeground(); + super.onBackPressed(); } } \ No newline at end of file diff --git a/app/src/main/java/com/smartpack/kernelprofiler/utils/CreateProfileActivity.java b/app/src/main/java/com/smartpack/kernelprofiler/utils/CreateProfileActivity.java index d4ad7f4..b9c73cd 100644 --- a/app/src/main/java/com/smartpack/kernelprofiler/utils/CreateProfileActivity.java +++ b/app/src/main/java/com/smartpack/kernelprofiler/utils/CreateProfileActivity.java @@ -58,7 +58,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { mProfileDetails = findViewById(R.id.profile_details); mTestButton = findViewById(R.id.test_button); mTestOutput = findViewById(R.id.test_output); - mTitle.setText(getString(R.string.create_config)); mProfileDescriptionHint.setVisibility(View.VISIBLE); mProfileDetailsHint.setVisibility(View.VISIBLE); mTitle.setVisibility(View.VISIBLE); @@ -156,21 +155,10 @@ public void run() { }.start(); } - private void closeForeground() { - mProfileDescriptionHint.setVisibility(View.GONE); - mProfileDetailsHint.setVisibility(View.GONE); - mTitle.setVisibility(View.GONE); - mProfileDescription.setVisibility(View.GONE); - mProfileDetails.setVisibility(View.GONE); - mTestButton.setVisibility(View.GONE); - mTestOutput.setVisibility(View.GONE); - super.onBackPressed(); - } - @Override public void onBackPressed() { if (KP.mTestingProfile) return; - closeForeground(); + super.onBackPressed(); } } \ No newline at end of file diff --git a/app/src/main/java/com/smartpack/kernelprofiler/utils/KP.java b/app/src/main/java/com/smartpack/kernelprofiler/utils/KP.java index 88244f2..9e0ce29 100644 --- a/app/src/main/java/com/smartpack/kernelprofiler/utils/KP.java +++ b/app/src/main/java/com/smartpack/kernelprofiler/utils/KP.java @@ -128,8 +128,7 @@ private static String readProfile(String file) { } public static boolean isKPProfile(String file) { - return getProfileDescription(file) != null && Utils.getExtension(file).equals("sh") && - readProfile(file).startsWith("#!/system/bin/sh"); + return Utils.getExtension(file).equals("sh") && readProfile(file).startsWith("#!/system/bin/sh"); } public static boolean supported() { diff --git a/app/src/main/res/layout/rv_foreground_view.xml b/app/src/main/res/layout/rv_foreground_view.xml index 0dfe343..5cac281 100644 --- a/app/src/main/res/layout/rv_foreground_view.xml +++ b/app/src/main/res/layout/rv_foreground_view.xml @@ -105,6 +105,30 @@ android:textIsSelectable="true" android:textSize="15sp" /> + + + + Credits Grarak: KernelAdiutor (Code base)\ntopjohnwu: libsu\nLennoard Silva: Code Contributions/App Icon Dark Theme - Description (Mandatory) + Description Add a short description about your kernel here (single line)! + Description for this profile is not provided by the developer. Default Profile (Mandatory) Specify default profile name (including \'.sh\' extension) here! Developer Credits @@ -26,6 +27,8 @@ Buy Donation App Add donation link here! About Kernel + How to add support in kernel + Kernel Profiler expects a configuration file (kernelprofiler.json) and one or more \'profiles\' (basically shell scripts) in certain specific structure placed inside \'/data/kernel_profiler\'. Please check \'Settings -> Developer Tools\' for more information. More Profile name shouldn\'t be empty! Aborting. Please check your internet connection! @@ -39,7 +42,7 @@ Options Press back again to exit %s applied successfully! - Profile Description (Mandatory) + Profile Description Add description here! Profile Details Add details (only commands) here! @@ -57,7 +60,9 @@ Add your title here! (Important: Title should contain a matching word from \'uname\') Developer Tools No Kernel Support + Please Note: This app is also equipped with necessity tools to create its support files. Please check \'Settings -> Developer Tools\' for more information. Please ask your favourite kernel developer to add support to this app! + It seems like you\'re kernel doesn\'t have necessary configuration file/profiles to support this app. %s is not a proper profile file! Aborting. Yes \ No newline at end of file