├── .gitignore
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── privacy-policy.html
│ └── release.json
│ ├── ic_launcher-playstore.png
│ ├── java
│ └── com
│ │ └── nfs
│ │ └── nfsmanager
│ │ ├── MainActivity.java
│ │ ├── StartActivity.java
│ │ ├── activities
│ │ ├── ApplyModeActivity.java
│ │ ├── CPUTimesActivity.java
│ │ ├── ChangeLogActivity.java
│ │ ├── CreditsActivity.java
│ │ ├── DeviceInfoActivity.java
│ │ ├── FlashingActivity.java
│ │ ├── LogsActivity.java
│ │ └── WebViewActivity.java
│ │ ├── adapters
│ │ ├── AboutAdapter.java
│ │ ├── CPUTimesAdapter.java
│ │ ├── CreditsAdapter.java
│ │ ├── DashBoardAdapter.java
│ │ ├── DeviceInfoAdapter.java
│ │ └── NFSAdapter.java
│ │ ├── fragments
│ │ ├── AboutFragment.java
│ │ ├── CPUTimesFragment.java
│ │ ├── DashBoardFragment.java
│ │ ├── DeviceInfoFragment.java
│ │ ├── MagiskLogFragment.java
│ │ ├── NFSFragment.java
│ │ └── NFSLogFragment.java
│ │ ├── receivers
│ │ └── UpdateReceiver.java
│ │ └── utils
│ │ ├── AsyncTasks.java
│ │ ├── CPUTimes.java
│ │ ├── Common.java
│ │ ├── DeviceInfo.java
│ │ ├── Flasher.java
│ │ ├── NFS.java
│ │ ├── PagerAdapter.java
│ │ ├── SerializableItems.java
│ │ ├── UpdateCheck.java
│ │ └── Utils.java
│ └── res
│ ├── drawable
│ ├── ic_active.xml
│ ├── ic_back.xml
│ ├── ic_battery.xml
│ ├── ic_brazil.xml
│ ├── ic_bug.xml
│ ├── ic_contributors.xml
│ ├── ic_dashboard.xml
│ ├── ic_developer.webp
│ ├── ic_device.xml
│ ├── ic_donate.xml
│ ├── ic_france.xml
│ ├── ic_germany.xml
│ ├── ic_github.xml
│ ├── ic_grarak.webp
│ ├── ic_help.xml
│ ├── ic_indonesia.xml
│ ├── ic_info.xml
│ ├── ic_italy.xml
│ ├── ic_licence.xml
│ ├── ic_nfs.webp
│ ├── ic_path.xml
│ ├── ic_playstore.xml
│ ├── ic_portugal.xml
│ ├── ic_privacy.xml
│ ├── ic_russia.xml
│ ├── ic_save.xml
│ ├── ic_settings.xml
│ ├── ic_settings_nfs.xml
│ ├── ic_spain.xml
│ ├── ic_support.xml
│ ├── ic_topjohnwu.webp
│ └── ic_update.xml
│ ├── layout
│ ├── activity_applymode.xml
│ ├── activity_changelog.xml
│ ├── activity_cputimes.xml
│ ├── activity_credits.xml
│ ├── activity_device.xml
│ ├── activity_flashing.xml
│ ├── activity_licence.xml
│ ├── activity_main.xml
│ ├── activity_start.xml
│ ├── activity_tablayout.xml
│ ├── checkbox_layout.xml
│ ├── fragment_about.xml
│ ├── fragment_cputime.xml
│ ├── fragment_dashboard.xml
│ ├── fragment_device.xml
│ ├── fragment_log_view.xml
│ ├── fragment_nfs_settings.xml
│ ├── layout_about.xml
│ ├── layout_module_status.xml
│ ├── layout_support_status.xml
│ ├── progress_view_layout.xml
│ ├── recycle_view_about.xml
│ ├── recycle_view_cputimes.xml
│ ├── recycle_view_credits.xml
│ ├── recycle_view_nfsinfo.xml
│ ├── recycle_view_nfsmode.xml
│ └── recycle_view_nfssettings.xml
│ ├── menu
│ └── bottom_navigation.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── values-de
│ └── strings.xml
│ ├── values-es
│ └── strings.xml
│ ├── values-fr
│ └── strings.xml
│ ├── values-in
│ └── strings.xml
│ ├── values-it
│ └── strings.xml
│ ├── values-pt-rBR
│ └── strings.xml
│ ├── values-pt-rPT
│ └── strings.xml
│ ├── values-ru
│ └── strings.xml
│ ├── values
│ ├── colors.xml
│ ├── ic_launcher_background.xml
│ ├── strings.xml
│ └── styles.xml
│ └── xml
│ └── provider_paths.xml
├── banner.png
├── build.gradle
├── gradle
└── wrapper
│ └── gradle-wrapper.jar
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | *.properties
4 | .DS_Store
5 | /build
6 | /captures
7 | .idea
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | [](https://github.com/sunilpaulmathew/NFSManager/releases/download/v2.7/com.nfs.nfsmanager-v2.7-release.apk)
4 | 
5 | 
6 | 
7 | 
8 |
9 | NFS Manager is a simple application to control NFS Injector, which is a Magisk module aimed to improve kernel/RAM management, by using values between performance and battery savings.
10 |
11 | ## Download
12 | [
](https://github.com/sunilpaulmathew/NFSManager/releases/download/v2.7/com.nfs.nfsmanager-v2.7-release.apk)
15 |
16 | ## Requirements
17 | 1. ROOT Access
18 | 2. NFS Injector installed
19 |
20 | ## Features
21 | NFS Manager will do the following things
22 | * Fully control NFS Injector.
23 | * View, Export and Share log files.
24 | * Turn Off/Reboot your device.
25 | * Many more.
26 |
27 | ## Translations
28 | Please help us to translate this app. The original language string is available at [app/src/main/res/values/strings.xml](app/src/main/res/values/strings.xml).
29 |
30 | ## Donations
31 | If you like to appreciate the developer ([sunilpaulmathew](https://github.com/sunilpaulmathew)) for maintaining this app up-to-date and fully compatible with each new Android & NFS Injector versions, please consider sending a small donation via [PayPal](https://www.paypal.me/menacherry). Thank You!
32 |
33 |
44 |
45 | NFS Manager is a free softwares: you can redistribute it and/or modify
46 | it under the terms of the GNU General Public License as published by the
47 | Free Software Foundation, either version 3 of the License, or (at your
48 | option) any later version.
49 |
50 | NFS Manager is distributed in the hope that it will be useful, but
51 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
52 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
53 | for more details.
54 |
55 | You should have received a copy of the GNU General Public License along
56 | with NFS Manager. If not, see .
57 |
58 | [](https://www.gnu.org/licenses/gpl-3.0.en.html)
59 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /release
3 | /src/main/gen
4 | /release
5 | *.jks
6 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 |
5 | signingConfigs {
6 | release {
7 | storeFile file("sp.jks")
8 | storePassword "smartpack"
9 | keyAlias "sp_key1"
10 | keyPassword "smartpack"
11 | }
12 | }
13 |
14 | namespace 'com.nfs.nfsmanager'
15 | compileSdkVersion 33
16 | buildToolsVersion '30.0.3'
17 |
18 | defaultConfig {
19 | applicationId "com.nfs.nfsmanager"
20 | minSdkVersion 23
21 | targetSdkVersion 33
22 | versionCode 27
23 | versionName = "v2.7"
24 | vectorDrawables.useSupportLibrary = true
25 | archivesBaseName = "$applicationId-$versionName"
26 | testFunctionalTest = false
27 | testHandleProfiling = false
28 | }
29 |
30 | buildTypes {
31 | release {
32 | signingConfig signingConfigs.release
33 | minifyEnabled true
34 | shrinkResources true
35 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
36 | }
37 | }
38 | lint {
39 | abortOnError false
40 | }
41 | }
42 |
43 | dependencies {
44 | implementation 'com.github.sunilpaulmathew:RootFilePicker:802663ee90'
45 | implementation "com.github.topjohnwu.libsu:core:4.0.3"
46 | implementation 'com.google.android.material:material:1.9.0'
47 | }
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
21 |
22 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
33 |
35 |
37 |
39 |
41 |
43 |
45 |
47 |
49 |
50 |
55 |
58 |
59 |
60 |
62 |
63 |
--------------------------------------------------------------------------------
/app/src/main/assets/privacy-policy.html:
--------------------------------------------------------------------------------
1 |
4 |
5 | Privacy Policy
6 |
7 | General
8 |
9 | NFS Manager is developed by one main developer (sunilpaulmathew), with a few people helping from time to time, mostly with translations. This Privacy Policy (Policy) explains how the developer treat the privacy of users.
10 |
11 | Policy
12 |
13 |
The developer of NFS Manager does not collect, store or share any personal information about the users. The identities of the users are completely unknown. If any personal information about a user is ever received, it will not be disclosed or shared with a third-party. However, please be aware that the log files, such as NFS and Magisk logs, exported and shared (with user consent) by NFS Manager might have device-related information. Please treat it responsibly.
14 |
15 | Permissions explained
16 |
17 | NFS Manager shall request/access the following permissions to handle the below-explained situations.
ACCESS_SUPERUSER
Executing module script, changing settings, module flashing, etc.
INTERNET and ACCESS_NETWORK_STATE
Downloading app updates, checking network state before attempting to open web links, etc.
REQUEST_INSTALL_PACKAGES
Installing new versions of NFS Manager.
18 |
19 | Changes
20 |
21 |
If the above-written Policy ever changes, the "Last updated" date provided on the bottom of this page will be updated. The Policy may change from time to time, so please be sure to check back periodically.
22 |
23 | Contact developer
24 |
25 | If you have any questions about this Privacy Policy, please don't hesitate to contact the developer at sunil.kde@gmail.com
26 |
27 | Last updated: January 25, 2021
--------------------------------------------------------------------------------
/app/src/main/assets/release.json:
--------------------------------------------------------------------------------
1 | {
2 | "fullReleaseNotes": "v2.7\n - Implemented KernelSU support.\n - Request POST_NOTIFICATIONS permission on Android 13 and above.\n - Removed ACCESS_NETWORK_STATE permission from app.\n - Faster app launching.\n - Updated build tools and dependencies.\n - Miscellaneous changes.\n\nv2.6\n - Improved back key handling while module flashing.\n - Brand new dashboard page, accent color & app icon.\n - Implemented update checking service.\n - Improved & updated credits page.\n - Reduced splash screen display time.\n - Cleaned, simplifies and reorganized code.\n - Miscellaneous changes.\n\nv2.5\n - Properly support Android 12 (S).\n - Added Ram Level.\n - Renamed some Doze titles.\n - Updated Gradle build tools and dependencies.\n - Removed in-built translator.\n - Miscellaneous changes.\n\nv2.4\n - Replaced depreciated AsyncTask with Executor.\n - Completely Re-write app-update check.\n - App will now show a small bottom banner Ad for non-Pro users.\n - Updated Gradle build tools and dependencies.\n - Updated Portuguese translations (credits to @BrauliX).\n - Miscellaneous changes.\n\nv2.3\n - Overall coding improvements.\n - Updated Gradle build tools.\n - App will now use own file picker for flashing.\n - Miscellaneous changes.\n\nv2.2\n - Updated storage handling for Android 10 and newer.\n - Updated Indonesian translation.\n - Added privacy policy to about page.\n - Updated build tools and dependencies.\n - Miscellaneous changes.\n\nv2.1\n - Added device info, CPU statistics and Licence pages.\n - Added Indonesian translation.\n - Introduced a signature check for app updates.\n - Miscellaneous changes.\n\nv2.0\n - Introduced a new page to display NFS mode changing in real-time.\n - Updated app icon and logo.\n - Flasher will now use in-built file picker (configurable).\n - Added a Credits page (in About) with an in-built translator.\n - Miscellaneous changes.\n\nv1.9\n - Largely improved module flashing.\n - Fixed crashing app on certain situations.\n - Detect and prevent using the app when illegal applications installed.\n - Overall code improvements.\n - Removed Nuked analytics from conflict list.\n - Miscellaneous changes.\n\nv1.8\n - Added a flashing progress screen.\n - Fixed rebooting from app not working after flashing.\n - Use Magisk BusyBox binaries for more tasks.\n - Update check will now work on all devices.\n - Miscellaneous changes.\n\nv1.7\n - Completely removed AdMob ad banner.\n - Added a full screen flashing view.\n - Updated to use BusyBox binaries for several tasks.\n - Added pt-rPT translations.\n - Updated Russian translations.\n - More material style updates.\n - Miscellaneous changes.\n\nv1.6\n - Rebuilt app from (nearly) scratch.\n - Switched app layout to BottomNav view.\n - App will now follow system theme.\n - Removed pro-user check.\n - Miscellaneous changes.\n\nv1.5\n - Removed on-boot service.\n - Updated pro-user check.\n - Updated build tools.\n - Updated DNS options.\n - Miscellaneous changes.\n\nv1.4\n - Implement module flashing from app.\n - Largely re-designed App UI.\n - Brand New About page, Logs view and Change_logs.\n - Implemented On-Boot service to help module to execute at boot.\n - Cleaned a bunch of unused code from app.\n - Improved Root handling.\n - Improved conflicts app detection.\n - Replaced toast messages with snackbar\n - Added Russian, German, Spanish, French and Italian translations.\n - Removed option to input Registration Key.\n - Miscellaneous changes.\n\nv1.3\n - Switched to libsu.\n - Updated pro-user check.\n - Miscellaneous changes.\n\nv1.2\n - Prevent users to access the app, if NFS initialization is not completed.\n - Show warning message to avoid using performance governor.\n - Added super sampling.\n - Moved About dialogue to the settings menu.\n - Updated pro-user checking.\n - Added more apps to conflicting programs list.\n - Updated Analytics/Ads Disabler.\n - Overall code cleaning & improvements.\n - Update build tools.\n - Miscellaneous changes.\n\nv1.1\n - Fixed magisk log not working for basic users.\n - Updated settings UI.\n - Miscellaneous changes.\n\nv1.0\n - Initial Release.",
3 | "releaseNotes": "Change-logs\n - Implemented KernelSU support.\n - Request POST_NOTIFICATIONS permission on Android 13 and above.\n - Removed ACCESS_NETWORK_STATE permission from app.\n - Faster app launching.\n - Updated build tools and dependencies.\n - Miscellaneous changes.",
4 | "downloadUrl": "https://github.com/sunilpaulmathew/NFSManager/releases/download/v2.7/com.nfs.nfsmanager-v2.7-release.apk",
5 | "versionName": "v2.7",
6 | "versionCode": 27,
7 | "sha1": "7fe839e2be10f7a6c92d9f871f894eaf04ea2725"
8 | }
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/StartActivity.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager;
2 |
3 | import android.content.Intent;
4 | import android.graphics.drawable.Drawable;
5 | import android.os.Bundle;
6 | import android.view.View;
7 | import android.widget.LinearLayout;
8 |
9 | import androidx.appcompat.app.AppCompatActivity;
10 | import androidx.appcompat.widget.AppCompatImageView;
11 | import androidx.core.content.ContextCompat;
12 |
13 | import com.google.android.material.dialog.MaterialAlertDialogBuilder;
14 | import com.google.android.material.textview.MaterialTextView;
15 | import com.nfs.nfsmanager.utils.NFS;
16 | import com.nfs.nfsmanager.utils.Utils;
17 |
18 | import java.util.Objects;
19 |
20 | /*
21 | * Created by sunilpaulmathew on November 06, 2020
22 | */
23 |
24 | public class StartActivity extends AppCompatActivity {
25 |
26 | private boolean mSleeping = false;
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | setContentView(R.layout.activity_start);
32 |
33 | AppCompatImageView mSplashScreen = findViewById(R.id.splash_screen);
34 | AppCompatImageView mUnsupportedImage = findViewById(R.id.no_root_Image);
35 | MaterialTextView mUnsupportedText = findViewById(R.id.unsupported_Text);
36 | LinearLayout mUnsupportedLayout = findViewById(R.id.unsupported_layout);
37 |
38 | if (!Utils.rootAccess() || !NFS.magiskSupported() || !NFS.illegalAppsList(this).isEmpty() || NFS.isNFSSleeping()) {
39 | mSplashScreen.setVisibility(View.GONE);
40 | mUnsupportedLayout.setVisibility(View.VISIBLE);
41 | Drawable helpDrawable = ContextCompat.getDrawable(this, R.drawable.ic_help);
42 | Objects.requireNonNull(helpDrawable).setTint(ContextCompat.getColor(this, R.color.ColorBlue));
43 | mUnsupportedImage.setImageDrawable(helpDrawable);
44 | mUnsupportedText.setText(!Utils.rootAccess() ? getString(R.string.no_root) : !NFS.magiskSupported() ?
45 | getString(R.string.no_magisk) : !NFS.illegalAppsList(this).isEmpty() ?
46 | getString(R.string.illegal_apps) : getString(R.string.sleeping));
47 | mUnsupportedImage.setOnClickListener(v -> {
48 | if (!Utils.rootAccess() || !NFS.magiskSupported()) {
49 | Utils.launchUrl("https://www.google.com/search?site=&source=hp&q=android+rooting+magisk", this);
50 | } else {
51 | new MaterialAlertDialogBuilder(this)
52 | .setIcon(R.mipmap.ic_launcher)
53 | .setTitle(R.string.app_name)
54 | .setMessage(mSleeping ? getString(R.string.sleeping_message) : getString (
55 | R.string.illegal_apps_summary, NFS.illegalAppsList(this)))
56 | .setCancelable(false)
57 | .setPositiveButton(getString(R.string.cancel), (dialog1, id1) -> super.onBackPressed())
58 | .show();
59 | }
60 | });
61 | return;
62 | }
63 |
64 | // Launch MainActivity
65 | Intent mainActivity = new Intent(this, MainActivity.class);
66 | startActivity(mainActivity);
67 | finish();
68 | }
69 |
70 | @Override
71 | public void onStart() {
72 | super.onStart();
73 |
74 | if (!Utils.rootAccess()) {
75 | return;
76 | }
77 | if (!NFS.supported()) {
78 | return;
79 | }
80 | if (NFS.isNFSSleeping()) {
81 | mSleeping = true;
82 | }
83 | }
84 |
85 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/activities/ApplyModeActivity.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.activities;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 |
6 | import androidx.annotation.Nullable;
7 | import androidx.appcompat.app.AppCompatActivity;
8 | import androidx.appcompat.widget.AppCompatImageButton;
9 | import androidx.core.widget.NestedScrollView;
10 |
11 | import com.google.android.material.card.MaterialCardView;
12 | import com.google.android.material.textview.MaterialTextView;
13 | import com.nfs.nfsmanager.R;
14 | import com.nfs.nfsmanager.utils.Common;
15 | import com.nfs.nfsmanager.utils.Utils;
16 |
17 | import java.util.ConcurrentModificationException;
18 |
19 | /*
20 | * Created by sunilpaulmathew on December 01, 2020
21 | */
22 |
23 | public class ApplyModeActivity extends AppCompatActivity {
24 |
25 | private MaterialCardView mCancel;
26 | private MaterialTextView mOutput;
27 | private NestedScrollView mScrollView;
28 |
29 | @Override
30 | protected void onCreate(@Nullable Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.activity_applymode);
33 |
34 | AppCompatImageButton mBackButton = findViewById(R.id.back_button);
35 | mCancel = findViewById(R.id.cancel_button);
36 | mOutput = findViewById(R.id.result_text);
37 | mScrollView = findViewById(R.id.scroll_view);
38 |
39 | mBackButton.setOnClickListener(v -> onBackPressed());
40 | mCancel.setOnClickListener(v -> onBackPressed());
41 |
42 | refreshStatus();
43 | }
44 |
45 | public void refreshStatus() {
46 | new Thread() {
47 | @Override
48 | public void run() {
49 | try {
50 | while (!isInterrupted()) {
51 | Thread.sleep(100);
52 | runOnUiThread(() -> {
53 | try {
54 | mOutput.setText(Utils.getOutput(Common.getOutput()));
55 | } catch (ConcurrentModificationException ignored) {}
56 | if (Common.isApplying()) {
57 | mScrollView.fullScroll(NestedScrollView.FOCUS_DOWN);
58 | } else {
59 | mCancel.setVisibility(View.VISIBLE);
60 | }
61 | });
62 | }
63 | } catch (InterruptedException ignored) {}
64 | }
65 | }.start();
66 | }
67 |
68 | @Override
69 | public void onBackPressed() {
70 | if (Common.isApplying()) return;
71 | super.onBackPressed();
72 | }
73 |
74 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/activities/CPUTimesActivity.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.activities;
2 |
3 | import android.os.Bundle;
4 | import android.view.Menu;
5 |
6 | import androidx.annotation.Nullable;
7 | import androidx.appcompat.app.AppCompatActivity;
8 | import androidx.appcompat.widget.AppCompatImageButton;
9 | import androidx.appcompat.widget.PopupMenu;
10 |
11 | import com.google.android.material.textview.MaterialTextView;
12 | import com.nfs.nfsmanager.R;
13 | import com.nfs.nfsmanager.utils.CPUTimes;
14 | import com.nfs.nfsmanager.utils.Common;
15 | import com.nfs.nfsmanager.utils.Utils;
16 | import com.nfs.nfsmanager.fragments.CPUTimesFragment;
17 |
18 | /*
19 | * Created by sunilpaulmathew on December 10, 2020
20 | */
21 |
22 | public class CPUTimesActivity extends AppCompatActivity {
23 |
24 | @Override
25 | protected void onCreate(@Nullable Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | setContentView(R.layout.activity_cputimes);
28 |
29 | AppCompatImageButton mBack = findViewById(R.id.back);
30 | AppCompatImageButton mCoreSelect = findViewById(R.id.core_pick);
31 | MaterialTextView mCoreTitle = findViewById(R.id.core_title);
32 |
33 | Common.initializeRecycleViewAdapter(CPUTimes.getData("/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state"));
34 | mCoreTitle.setText(getString(R.string.cpu_core, "0"));
35 | getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
36 | new CPUTimesFragment()).commit();
37 |
38 | mBack.setOnClickListener(v -> super.onBackPressed());
39 | mCoreSelect.setOnClickListener(v -> {
40 | PopupMenu popupMenu = new PopupMenu(this, mCoreSelect);
41 | Menu menu = popupMenu.getMenu();
42 | for (int i = 0; i < 10; i++) {
43 | if (Utils.exist("/sys/devices/system/cpu/cpu" + i + "/cpufreq/stats/time_in_state")) {
44 | menu.add(Menu.NONE, i, Menu.NONE, getString(R.string.cpu_core, String.valueOf(i)));
45 | }
46 | }
47 | popupMenu.setOnMenuItemClickListener(item -> {
48 | for (int i = 0; i < 10; i++) {
49 | if (item.getItemId() == i) {
50 | mCoreTitle.setText(getString(R.string.cpu_core, String.valueOf(i)));
51 | Common.initializeRecycleViewAdapter(CPUTimes.getData("/sys/devices/system/cpu/cpu" + i + "/cpufreq/stats/time_in_state"));
52 | Common.getRecyclerView().setAdapter(Common.getRecycleViewAdapter());
53 | }
54 | }
55 | return false;
56 | });
57 | popupMenu.show();
58 | });
59 | }
60 |
61 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/activities/ChangeLogActivity.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.activities;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.os.Bundle;
5 |
6 | import androidx.annotation.Nullable;
7 | import androidx.appcompat.app.AppCompatActivity;
8 | import androidx.appcompat.widget.AppCompatImageButton;
9 |
10 | import com.google.android.material.textview.MaterialTextView;
11 | import com.nfs.nfsmanager.BuildConfig;
12 | import com.nfs.nfsmanager.R;
13 | import com.nfs.nfsmanager.utils.Utils;
14 |
15 | import org.json.JSONException;
16 | import org.json.JSONObject;
17 |
18 | import java.util.Objects;
19 |
20 | /*
21 | * Created by sunilpaulmathew on October 11, 2020
22 | */
23 |
24 | public class ChangeLogActivity extends AppCompatActivity {
25 |
26 | @SuppressLint("SetTextI18n")
27 | @Override
28 | protected void onCreate(@Nullable Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.activity_changelog);
31 |
32 | AppCompatImageButton mBack = findViewById(R.id.back);
33 | MaterialTextView mChangeLog = findViewById(R.id.change_log);
34 | MaterialTextView mTitle = findViewById(R.id.app_title);
35 | MaterialTextView mCancel = findViewById(R.id.cancel_button);
36 | mTitle.setText(getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME);
37 | String change_log = null;
38 | try {
39 | change_log = new JSONObject(Objects.requireNonNull(Utils.readAssetFile(
40 | this, "release.json"))).getString("fullReleaseNotes");
41 | } catch (JSONException ignored) {
42 | }
43 | mChangeLog.setText(change_log);
44 | mCancel.setOnClickListener(v -> onBackPressed());
45 | mBack.setOnClickListener(v -> onBackPressed());
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/activities/CreditsActivity.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.activities;
2 |
3 | import android.app.Activity;
4 | import android.content.res.Configuration;
5 | import android.os.Bundle;
6 | import android.view.View;
7 |
8 | import androidx.annotation.Nullable;
9 | import androidx.appcompat.app.AppCompatActivity;
10 | import androidx.appcompat.widget.AppCompatImageButton;
11 | import androidx.core.content.ContextCompat;
12 | import androidx.recyclerview.widget.GridLayoutManager;
13 | import androidx.recyclerview.widget.RecyclerView;
14 |
15 | import com.google.android.material.textview.MaterialTextView;
16 | import com.nfs.nfsmanager.BuildConfig;
17 | import com.nfs.nfsmanager.R;
18 | import com.nfs.nfsmanager.adapters.CreditsAdapter;
19 | import com.nfs.nfsmanager.utils.SerializableItems;
20 | import com.nfs.nfsmanager.utils.Utils;
21 |
22 | import java.util.ArrayList;
23 |
24 | /*
25 | * Created by sunilpaulmathew on December 09, 2020
26 | */
27 | public class CreditsActivity extends AppCompatActivity {
28 |
29 | @Override
30 | protected void onCreate(@Nullable Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.activity_credits);
33 |
34 | AppCompatImageButton mBack = findViewById(R.id.back);
35 | MaterialTextView mVersion = findViewById(R.id.version);
36 | RecyclerView mRecyclerView = findViewById(R.id.recycler_view);
37 |
38 | mVersion.setText(getString(R.string.version, BuildConfig.VERSION_NAME));
39 |
40 | mBack.setOnClickListener(v -> onBackPressed());
41 |
42 | mRecyclerView.setLayoutManager(new GridLayoutManager(this, getSpanCount(this)));
43 | CreditsAdapter mRecycleViewAdapter = new CreditsAdapter(getData());
44 | mRecyclerView.setAdapter(mRecycleViewAdapter);
45 | mRecyclerView.setVisibility(View.VISIBLE);
46 | }
47 |
48 | private int getSpanCount(Activity activity) {
49 | return Utils.isTablet(activity) ? Utils.getOrientation(activity) == Configuration.ORIENTATION_LANDSCAPE ?
50 | 4 : 3 : Utils.getOrientation(activity) == Configuration.ORIENTATION_LANDSCAPE ? 3 : 2;
51 | }
52 |
53 | private ArrayList getData() {
54 | ArrayList mData = new ArrayList<>();
55 | mData.add(new SerializableItems("Kernel Adiutor", "Willi Ye", ContextCompat.getDrawable(this, R.drawable.ic_grarak), "https://github.com/Grarak"));
56 | mData.add(new SerializableItems("libsu", "John Wu", ContextCompat.getDrawable(this, R.drawable.ic_topjohnwu),"https://github.com/topjohnwu"));
57 | mData.add(new SerializableItems("German Translation", "simonk206", ContextCompat.getDrawable(this, R.drawable.ic_germany), null));
58 | mData.add(new SerializableItems("Italian Translation", "andrea", ContextCompat.getDrawable(this, R.drawable.ic_italy),null));
59 | mData.add(new SerializableItems("French Translation", "K1ks", ContextCompat.getDrawable(this, R.drawable.ic_france), null));
60 | mData.add(new SerializableItems("Spanish Translation", "Peter A. Cuevas", ContextCompat.getDrawable(this, R.drawable.ic_spain),null));
61 | mData.add(new SerializableItems("Portuguese (rPt) Translation", "BrauliX", ContextCompat.getDrawable(this, R.drawable.ic_portugal), "https://github.com/BrauliX"));
62 | mData.add(new SerializableItems("Portuguese (rBr) Translation", "BrauliX", ContextCompat.getDrawable(this, R.drawable.ic_brazil),"https://github.com/BrauliX"));
63 | mData.add(new SerializableItems("Russian Translation", "Ramazan Magomedov", ContextCompat.getDrawable(this, R.drawable.ic_russia),"https://github.com/RamazanMagomedov"));
64 | mData.add(new SerializableItems("Indonesian Translation", "Hafitz Setya", ContextCompat.getDrawable(this, R.drawable.ic_indonesia),"https://github.com/breakdowns"));
65 | return mData;
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/activities/DeviceInfoActivity.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.activities;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.appcompat.app.AppCompatActivity;
7 | import androidx.appcompat.widget.AppCompatImageButton;
8 |
9 | import com.nfs.nfsmanager.R;
10 | import com.nfs.nfsmanager.fragments.DeviceInfoFragment;
11 |
12 | /*
13 | * Created by sunilpaulmathew on December 10, 2020
14 | */
15 |
16 | public class DeviceInfoActivity extends AppCompatActivity {
17 |
18 | @Override
19 | protected void onCreate(@Nullable Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_device);
22 |
23 | AppCompatImageButton mBack = findViewById(R.id.back);
24 | getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
25 | new DeviceInfoFragment()).commit();
26 |
27 | mBack.setOnClickListener(v -> super.onBackPressed());
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/activities/FlashingActivity.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.activities;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.os.Bundle;
5 | import android.os.Environment;
6 | import android.view.KeyEvent;
7 | import android.view.View;
8 | import android.widget.LinearLayout;
9 |
10 | import androidx.annotation.Nullable;
11 | import androidx.appcompat.app.AppCompatActivity;
12 | import androidx.appcompat.widget.AppCompatImageButton;
13 | import androidx.core.widget.NestedScrollView;
14 |
15 | import com.google.android.material.card.MaterialCardView;
16 | import com.google.android.material.textview.MaterialTextView;
17 | import com.nfs.nfsmanager.R;
18 | import com.nfs.nfsmanager.utils.Common;
19 | import com.nfs.nfsmanager.utils.Utils;
20 |
21 | import java.io.File;
22 |
23 | /*
24 | * Created by sunilpaulmathew on November 13, 2020
25 | */
26 |
27 | public class FlashingActivity extends AppCompatActivity {
28 |
29 | private AppCompatImageButton mSave;
30 | private LinearLayout mProgressLayout;
31 | private MaterialCardView mReboot;
32 | private MaterialTextView mFlashingOutput;
33 | private MaterialTextView mTitle;
34 | private NestedScrollView mScrollView;
35 |
36 | @SuppressLint("SetTextI18n")
37 | @Override
38 | protected void onCreate(@Nullable Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | setContentView(R.layout.activity_flashing);
41 |
42 | AppCompatImageButton mBack = findViewById(R.id.back);
43 | mSave = findViewById(R.id.save);
44 | mTitle = findViewById(R.id.title);
45 | mFlashingOutput = findViewById(R.id.output);
46 | mReboot = findViewById(R.id.reboot);
47 | mProgressLayout = findViewById(R.id.flashing_progress);
48 | mScrollView = findViewById(R.id.scroll);
49 | MaterialTextView mProgressText = findViewById(R.id.progress_text);
50 | mProgressText.setText(getString(R.string.flashing, "..."));
51 | refreshStatus();
52 | mBack.setOnClickListener(v -> finish());
53 | mSave.setOnClickListener(v -> {
54 | Utils.mkdir(new File(Environment.getExternalStorageDirectory(),"NFSManager").getAbsolutePath());
55 | Utils.create(Common.getFlashingResult().toString(), new File(Environment.getExternalStorageDirectory(),"NFSManager") + "/flasher_log-" +
56 | Common.getZipName().replace(".zip",""));
57 | Utils.longSnackbar(mSave, getString(R.string.flash_log, new File(Environment.getExternalStorageDirectory(),"NFSManager") + "/flasher_log-" +
58 | Common.getZipName().replace(".zip","")));
59 | });
60 | mReboot.setOnClickListener(v -> {
61 | Utils.reboot("", mProgressLayout, mProgressText, this);
62 | finish();
63 | });
64 | }
65 |
66 | public void refreshStatus() {
67 | new Thread() {
68 | @Override
69 | public void run() {
70 | try {
71 | while (!isInterrupted()) {
72 | Thread.sleep(100);
73 | runOnUiThread(() -> {
74 | if (Common.isFlashing()) {
75 | mScrollView.fullScroll(NestedScrollView.FOCUS_DOWN);
76 | } else {
77 | mProgressLayout.setVisibility(View.GONE);
78 | mSave.setVisibility(Common.isFlashing() ? View.GONE: View.VISIBLE);
79 | }
80 | if (Common.isModuleInvalid()) {
81 | mTitle.setText(Common.isFlashing() ? getString(R.string.flashing, "...") :
82 | getString(R.string.flashing, "aborted"));
83 | mFlashingOutput.setText(Common.isFlashing() ? "" : getString(R.string.invalid_module));
84 | } else {
85 | mTitle.setText(Common.isFlashing() ? getString(R.string.flashing,"...") : Utils.getOutput(Common.getFlashingOutput()).endsWith("\nsuccess") ?
86 | getString(R.string.flashing, "finished") : getString(R.string.flashing, "failed"));
87 | mFlashingOutput.setText(!Utils.getOutput(Common.getFlashingOutput()).isEmpty() ? Utils.getOutput(Common.getFlashingOutput())
88 | .replace("\nsuccess","") : Common.isFlashing() ? "" : Common.getFlashingResult());
89 | mReboot.setVisibility(Utils.getOutput(Common.getFlashingOutput()).endsWith("\nsuccess") ? View.VISIBLE: View.GONE);
90 | }
91 | });
92 | }
93 | } catch (InterruptedException ignored) {}
94 | }
95 | }.start();
96 | }
97 |
98 | @Override
99 | public boolean onKeyDown(int keyCode, KeyEvent event) {
100 | if (keyCode == KeyEvent.KEYCODE_BACK && !Common.isFlashing()) {
101 | finish();
102 | }
103 | return true;
104 | }
105 |
106 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/activities/LogsActivity.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.activities;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.appcompat.app.AppCompatActivity;
7 | import androidx.viewpager.widget.ViewPager;
8 |
9 | import com.google.android.material.tabs.TabLayout;
10 | import com.nfs.nfsmanager.R;
11 | import com.nfs.nfsmanager.utils.PagerAdapter;
12 | import com.nfs.nfsmanager.fragments.MagiskLogFragment;
13 | import com.nfs.nfsmanager.fragments.NFSLogFragment;
14 |
15 | /*
16 | * Created by sunilpaulmathew on October 11, 2020
17 | */
18 |
19 | public class LogsActivity extends AppCompatActivity {
20 |
21 | @Override
22 | protected void onCreate(@Nullable Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.activity_tablayout);
25 |
26 | TabLayout mTabLayout = findViewById(R.id.tab_Layout);
27 | ViewPager mViewPager = findViewById(R.id.view_pager);
28 |
29 | PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager());
30 | adapter.AddFragment(new NFSLogFragment(), getString(R.string.nfs_log));
31 | adapter.AddFragment(new MagiskLogFragment(), getString(R.string.magisk_log));
32 |
33 | mViewPager.setAdapter(adapter);
34 | mTabLayout.setupWithViewPager(mViewPager);
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/activities/WebViewActivity.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.activities;
2 |
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.webkit.WebView;
8 | import android.webkit.WebViewClient;
9 |
10 | import androidx.activity.OnBackPressedCallback;
11 | import androidx.annotation.NonNull;
12 | import androidx.annotation.Nullable;
13 | import androidx.appcompat.app.AppCompatActivity;
14 | import androidx.appcompat.widget.AppCompatImageButton;
15 | import androidx.fragment.app.Fragment;
16 |
17 | import com.google.android.material.textview.MaterialTextView;
18 | import com.nfs.nfsmanager.R;
19 | import com.nfs.nfsmanager.utils.Common;
20 |
21 | /*
22 | * Created by sunilpaulmathew on January 01, 2021
23 | */
24 |
25 | public class WebViewActivity extends AppCompatActivity {
26 |
27 | @Override
28 | protected void onCreate(@Nullable Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.activity_licence);
31 |
32 | AppCompatImageButton mBack = findViewById(R.id.back);
33 | MaterialTextView mCancel = findViewById(R.id.cancel_button);
34 | mCancel.setOnClickListener(v -> finish());
35 |
36 | getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
37 | new WebViewFragment()).commit();
38 |
39 | mBack.setOnClickListener(v -> finish());
40 | }
41 |
42 | public static class WebViewFragment extends Fragment {
43 |
44 | @Nullable
45 | @Override
46 | public View onCreateView(@NonNull LayoutInflater inflater,
47 | @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
48 | WebView mWebView = new WebView(requireActivity());
49 | mWebView.loadUrl(Common.getURL());
50 | mWebView.setWebViewClient(new WebViewClient());
51 |
52 | requireActivity().getOnBackPressedDispatcher().addCallback(new OnBackPressedCallback(true) {
53 | @Override
54 | public void handleOnBackPressed() {
55 | if (mWebView.canGoBack()) {
56 | mWebView.goBack();
57 | } else {
58 | requireActivity().finish();
59 | }
60 | }
61 | });
62 |
63 | return mWebView;
64 | }
65 |
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/adapters/AboutAdapter.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.adapters;
2 |
3 | import android.content.Intent;
4 | import android.net.Uri;
5 | import android.provider.Settings;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.LinearLayout;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.appcompat.widget.AppCompatImageButton;
13 | import androidx.appcompat.widget.AppCompatTextView;
14 | import androidx.core.content.ContextCompat;
15 | import androidx.recyclerview.widget.RecyclerView;
16 |
17 | import com.google.android.material.dialog.MaterialAlertDialogBuilder;
18 | import com.nfs.nfsmanager.BuildConfig;
19 | import com.nfs.nfsmanager.R;
20 | import com.nfs.nfsmanager.activities.ChangeLogActivity;
21 | import com.nfs.nfsmanager.activities.CreditsActivity;
22 | import com.nfs.nfsmanager.activities.WebViewActivity;
23 | import com.nfs.nfsmanager.utils.Common;
24 | import com.nfs.nfsmanager.utils.SerializableItems;
25 | import com.nfs.nfsmanager.utils.UpdateCheck;
26 | import com.nfs.nfsmanager.utils.Utils;
27 |
28 | import java.util.ArrayList;
29 |
30 | /*
31 | * Created by sunilpaulmathew on March 24, 2022
32 | */
33 | public class AboutAdapter extends RecyclerView.Adapter {
34 |
35 | private final ArrayList data;
36 |
37 | public AboutAdapter(ArrayList data) {
38 | this.data = data;
39 | }
40 |
41 | @NonNull
42 | @Override
43 | public AboutAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
44 | View rowItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycle_view_about, parent, false);
45 | return new AboutAdapter.ViewHolder(rowItem);
46 | }
47 |
48 | @Override
49 | public void onBindViewHolder(@NonNull AboutAdapter.ViewHolder holder, int position) {
50 | holder.mTitle.setText(this.data.get(position).getTitle());
51 | if (Utils.isDarkTheme(holder.mTitle.getContext())) {
52 | holder.mTitle.setTextColor(ContextCompat.getColor(holder.mTitle.getContext(), R.color.ColorBlue));
53 | }
54 | holder.mDescription.setText(this.data.get(position).getDescription());
55 | holder.mIcon.setImageDrawable(this.data.get(position).getIcon());
56 | holder.mRVLayout.setOnClickListener(v -> {
57 | if (position == 0) {
58 | Intent settings = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
59 | settings.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
60 | Uri uri = Uri.fromParts("package", BuildConfig.APPLICATION_ID, null);
61 | settings.setData(uri);
62 | holder.mRVLayout.getContext().startActivity(settings);
63 | } else if (position == 5) {
64 | Intent changeLogs = new Intent(holder.mRVLayout.getContext(), ChangeLogActivity.class);
65 | holder.mRVLayout.getContext().startActivity(changeLogs);
66 | } else if (position == 7) {
67 | Common.setURL("file:///android_asset/privacy-policy.html");
68 | Intent privacyPolicy = new Intent(holder.mRVLayout.getContext(), WebViewActivity.class);
69 | holder.mRVLayout.getContext().startActivity(privacyPolicy);
70 | } else if (position == 8) {
71 | Common.setURL("https://www.gnu.org/licenses/gpl-3.0-standalone.html");
72 | Intent licence = new Intent(holder.mRVLayout.getContext(), WebViewActivity.class);
73 | holder.mRVLayout.getContext().startActivity(licence);
74 | } else if (position == 9) {
75 | Intent credits = new Intent(holder.mRVLayout.getContext(), CreditsActivity.class);
76 | holder.mRVLayout.getContext().startActivity(credits);
77 | } else if (position == 10) {
78 | LayoutInflater mLayoutInflator = LayoutInflater.from(v.getContext());
79 | View aboutLayout = mLayoutInflator.inflate(R.layout.layout_about, null);
80 |
81 | new MaterialAlertDialogBuilder(v.getContext())
82 | .setIcon(R.mipmap.ic_launcher)
83 | .setView(aboutLayout)
84 | .setNegativeButton(R.string.cancel, (dialogInterface, ii) -> {
85 | })
86 | .setPositiveButton(R.string.donate, (dialogInterface, ii) ->
87 | Utils.launchUrl("https://www.paypal.me/menacherry", holder.mRVLayout.getContext()))
88 | .show();
89 | } else if (position == 11) {
90 | UpdateCheck.initialize(0, false, holder.mRVLayout.getContext());
91 | } else if (this.data.get(position).getURL() != null) {
92 | Utils.launchUrl(this.data.get(position).getURL(), holder.mRVLayout.getContext());
93 | }
94 | });
95 | }
96 |
97 | @Override
98 | public int getItemCount() {
99 | return this.data.size();
100 | }
101 |
102 | public static class ViewHolder extends RecyclerView.ViewHolder {
103 | private final AppCompatImageButton mIcon;
104 | private final AppCompatTextView mTitle;
105 | private final AppCompatTextView mDescription;
106 | private final LinearLayout mRVLayout;
107 |
108 | public ViewHolder(View view) {
109 | super(view);
110 | this.mIcon = view.findViewById(R.id.icon);
111 | this.mTitle = view.findViewById(R.id.title);
112 | this.mDescription = view.findViewById(R.id.description);
113 | this.mRVLayout = view.findViewById(R.id.rv_about);
114 | }
115 | }
116 |
117 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/adapters/CPUTimesAdapter.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.adapters;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.os.SystemClock;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ProgressBar;
9 |
10 | import androidx.annotation.NonNull;
11 | import androidx.recyclerview.widget.RecyclerView;
12 |
13 | import com.google.android.material.textview.MaterialTextView;
14 | import com.nfs.nfsmanager.R;
15 | import com.nfs.nfsmanager.utils.CPUTimes;
16 |
17 | import java.util.List;
18 |
19 | /*
20 | * Created by sunilpaulmathew on March 24, 2022
21 | */
22 | public class CPUTimesAdapter extends RecyclerView.Adapter {
23 |
24 | private final List data;
25 |
26 | public CPUTimesAdapter(List data) {
27 | this.data = data;
28 | }
29 |
30 | @NonNull
31 | @Override
32 | public CPUTimesAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
33 | View rowItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycle_view_cputimes, parent, false);
34 | return new CPUTimesAdapter.ViewHolder(rowItem);
35 | }
36 |
37 | @SuppressLint("SetTextI18n")
38 | @Override
39 | public void onBindViewHolder(@NonNull CPUTimesAdapter.ViewHolder holder, int position) {
40 | String[] finalLine = this.data.get(position).split(" ");
41 | try {
42 | if (this.data.get(position).equals("Deep sleep")) {
43 | holder.mFreq.setText("Deep sleep");
44 | holder.mPercent.setText(Math.round((float) ((SystemClock.elapsedRealtime() - SystemClock.uptimeMillis()) * 100) / SystemClock.elapsedRealtime()) + "%");
45 | holder.mTime.setText(CPUTimes.sToString((SystemClock.elapsedRealtime() - SystemClock.uptimeMillis()) / 1000));
46 | holder.mProgress.setProgress(Math.round((float) ((SystemClock.elapsedRealtime() - SystemClock.uptimeMillis()) * 100) / SystemClock.elapsedRealtime()));
47 | } else {
48 | holder.mFreq.setText(Integer.parseInt(finalLine[0]) / 1000 + " MHz");
49 | holder.mPercent.setText(Math.round((float) Integer.parseInt(finalLine[1]) * 1000 / SystemClock.elapsedRealtime()) + "%");
50 | holder.mTime.setText(CPUTimes.sToString(Integer.parseInt(finalLine[1]) / 100));
51 | holder.mProgress.setProgress(Math.round((float) Integer.parseInt(finalLine[1]) * 1000 / SystemClock.elapsedRealtime()));
52 | }
53 | } catch (ArrayIndexOutOfBoundsException | NumberFormatException ignored) {
54 | }
55 | }
56 |
57 | @Override
58 | public int getItemCount() {
59 | return this.data.size();
60 | }
61 |
62 | public static class ViewHolder extends RecyclerView.ViewHolder {
63 | private final MaterialTextView mFreq, mPercent, mTime;
64 | private final ProgressBar mProgress;
65 |
66 | public ViewHolder(View view) {
67 | super(view);
68 | this.mFreq = view.findViewById(R.id.freq);
69 | this.mPercent = view.findViewById(R.id.percentage);
70 | this.mTime = view.findViewById(R.id.time);
71 | this.mProgress = view.findViewById(R.id.progress);
72 | }
73 | }
74 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/adapters/CreditsAdapter.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.adapters;
2 |
3 | import android.view.LayoutInflater;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 | import android.widget.LinearLayout;
7 |
8 | import androidx.annotation.NonNull;
9 | import androidx.appcompat.widget.AppCompatImageView;
10 | import androidx.appcompat.widget.AppCompatTextView;
11 | import androidx.core.content.ContextCompat;
12 | import androidx.recyclerview.widget.RecyclerView;
13 |
14 | import com.nfs.nfsmanager.R;
15 | import com.nfs.nfsmanager.utils.SerializableItems;
16 | import com.nfs.nfsmanager.utils.Utils;
17 |
18 | import java.util.ArrayList;
19 |
20 | /*
21 | * Created by sunilpaulmathew on March 24, 2022
22 | */
23 | public class CreditsAdapter extends RecyclerView.Adapter {
24 |
25 | private final ArrayList data;
26 |
27 | public CreditsAdapter(ArrayList data) {
28 | this.data = data;
29 | }
30 |
31 | @NonNull
32 | @Override
33 | public CreditsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
34 | View rowItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycle_view_credits, parent, false);
35 | return new CreditsAdapter.ViewHolder(rowItem);
36 | }
37 |
38 | @Override
39 | public void onBindViewHolder(@NonNull CreditsAdapter.ViewHolder holder, int position) {
40 | holder.mTitle.setText(this.data.get(position).getTitle());
41 | if (Utils.isDarkTheme(holder.mTitle.getContext())) {
42 | holder.mTitle.setTextColor(ContextCompat.getColor(holder.mTitle.getContext(), R.color.ColorBlue));
43 | }
44 | holder.mDescription.setText(this.data.get(position).getDescription());
45 | holder.mIcon.setImageDrawable(this.data.get(position).getIcon());
46 | holder.mRVLayout.setOnClickListener(v -> {
47 | if (this.data.get(position).getURL() != null) {
48 | Utils.launchUrl(this.data.get(position).getURL(), holder.mRVLayout.getContext());
49 | }
50 | });
51 | }
52 |
53 | @Override
54 | public int getItemCount() {
55 | return this.data.size();
56 | }
57 |
58 | public static class ViewHolder extends RecyclerView.ViewHolder {
59 | private final AppCompatImageView mIcon;
60 | private final AppCompatTextView mTitle;
61 | private final AppCompatTextView mDescription;
62 | private final LinearLayout mRVLayout;
63 |
64 | public ViewHolder(View view) {
65 | super(view);
66 | this.mIcon = view.findViewById(R.id.icon);
67 | this.mTitle = view.findViewById(R.id.title);
68 | this.mDescription = view.findViewById(R.id.description);
69 | this.mRVLayout = view.findViewById(R.id.rv_credits);
70 | }
71 | }
72 |
73 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/adapters/DashBoardAdapter.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.adapters;
2 |
3 | import android.view.LayoutInflater;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 |
7 | import androidx.annotation.NonNull;
8 | import androidx.core.content.ContextCompat;
9 | import androidx.recyclerview.widget.RecyclerView;
10 |
11 | import com.google.android.material.card.MaterialCardView;
12 | import com.google.android.material.textview.MaterialTextView;
13 | import com.nfs.nfsmanager.R;
14 | import com.nfs.nfsmanager.utils.NFS;
15 | import com.nfs.nfsmanager.utils.SerializableItems;
16 |
17 | import java.util.ArrayList;
18 |
19 | /*
20 | * Created by sunilpaulmathew on March 24, 2022
21 | */
22 | public class DashBoardAdapter extends RecyclerView.Adapter {
23 |
24 | private final ArrayList data;
25 |
26 | private static ClickListener clickListener;
27 |
28 | public DashBoardAdapter(ArrayList data) {
29 | this.data = data;
30 | }
31 |
32 | @NonNull
33 | @Override
34 | public DashBoardAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
35 | View rowItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycle_view_nfsmode, parent, false);
36 | return new ViewHolder(rowItem);
37 | }
38 |
39 | @Override
40 | public void onBindViewHolder(@NonNull DashBoardAdapter.ViewHolder holder, int position) {
41 | try {
42 | holder.mTitle.setText(this.data.get(position).getTitle());
43 | if (NFS.getNFSMode() == 0) {
44 | if (position == 0) {
45 | holder.mLayoutCard.setCardBackgroundColor(ContextCompat.getColor(holder.mLayoutCard.getContext(), R.color.ColorBlue));
46 | } else {
47 | holder.mLayoutCard.setCardBackgroundColor(ContextCompat.getColor(holder.mLayoutCard.getContext(), R.color.ColorTeal));
48 | }
49 | } else if (NFS.getNFSMode() == 1) {
50 | if (position == 1) {
51 | holder.mLayoutCard.setCardBackgroundColor(ContextCompat.getColor(holder.mLayoutCard.getContext(), R.color.ColorBlue));
52 | } else {
53 | holder.mLayoutCard.setCardBackgroundColor(ContextCompat.getColor(holder.mLayoutCard.getContext(), R.color.ColorTeal));
54 | }
55 | } else if (NFS.getNFSMode() == 2) {
56 | if (position == 2) {
57 | holder.mLayoutCard.setCardBackgroundColor(ContextCompat.getColor(holder.mLayoutCard.getContext(), R.color.ColorBlue));
58 | } else {
59 | holder.mLayoutCard.setCardBackgroundColor(ContextCompat.getColor(holder.mLayoutCard.getContext(), R.color.ColorTeal));
60 | }
61 | } else {
62 | if (position == 3) {
63 | holder.mLayoutCard.setCardBackgroundColor(ContextCompat.getColor(holder.mLayoutCard.getContext(), R.color.ColorBlue));
64 | } else {
65 | holder.mLayoutCard.setCardBackgroundColor(ContextCompat.getColor(holder.mLayoutCard.getContext(), R.color.ColorTeal));
66 | }
67 | }
68 | } catch (NullPointerException ignored) {}
69 | }
70 |
71 | @Override
72 | public int getItemCount() {
73 | return this.data.size();
74 | }
75 |
76 | public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
77 | private final MaterialCardView mLayoutCard;
78 | private final MaterialTextView mTitle;
79 |
80 | public ViewHolder(View view) {
81 | super(view);
82 | view.setOnClickListener(this);
83 | this.mLayoutCard = view.findViewById(R.id.main_card);
84 | this.mTitle = view.findViewById(R.id.title);
85 | }
86 |
87 | @Override
88 | public void onClick(View view) {
89 | clickListener.onItemClick(getAdapterPosition(), view);
90 | }
91 | }
92 |
93 | public void setOnItemClickListener(ClickListener clickListener) {
94 | DashBoardAdapter.clickListener = clickListener;
95 | }
96 |
97 | public interface ClickListener {
98 | void onItemClick(int position, View v);
99 | }
100 |
101 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/adapters/DeviceInfoAdapter.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.adapters;
2 |
3 | import android.view.LayoutInflater;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 |
7 | import androidx.annotation.NonNull;
8 | import androidx.recyclerview.widget.RecyclerView;
9 |
10 | import com.google.android.material.textview.MaterialTextView;
11 | import com.nfs.nfsmanager.R;
12 |
13 | import java.util.List;
14 |
15 | /*
16 | * Created by sunilpaulmathew on March 24, 2022
17 | */
18 | public class DeviceInfoAdapter extends RecyclerView.Adapter {
19 |
20 | private final List data;
21 |
22 | public DeviceInfoAdapter(List data) {
23 | this.data = data;
24 | }
25 |
26 | @NonNull
27 | @Override
28 | public DeviceInfoAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
29 | View rowItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycle_view_nfsinfo, parent, false);
30 | return new DeviceInfoAdapter.ViewHolder(rowItem);
31 | }
32 |
33 | @Override
34 | public void onBindViewHolder(@NonNull DeviceInfoAdapter.ViewHolder holder, int position) {
35 | holder.mCoreStatus.setText(this.data.get(position));
36 | }
37 |
38 | @Override
39 | public int getItemCount() {
40 | return this.data.size();
41 | }
42 |
43 | public static class ViewHolder extends RecyclerView.ViewHolder {
44 | private final MaterialTextView mCoreStatus;
45 |
46 | public ViewHolder(View view) {
47 | super(view);
48 | this.mCoreStatus = view.findViewById(R.id.core_status);
49 | }
50 | }
51 |
52 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/adapters/NFSAdapter.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.adapters;
2 |
3 | import android.view.LayoutInflater;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 |
7 | import androidx.annotation.NonNull;
8 | import androidx.recyclerview.widget.RecyclerView;
9 |
10 | import com.google.android.material.textview.MaterialTextView;
11 | import com.nfs.nfsmanager.R;
12 | import com.nfs.nfsmanager.utils.SerializableItems;
13 | import com.nfs.nfsmanager.utils.NFS;
14 |
15 | import java.util.ArrayList;
16 |
17 | /*
18 | * Created by sunilpaulmathew on March 24, 2022
19 | */
20 | public class NFSAdapter extends RecyclerView.Adapter {
21 |
22 | private final ArrayList data;
23 |
24 | public NFSAdapter(ArrayList data) {
25 | this.data = data;
26 | }
27 |
28 | @NonNull
29 | @Override
30 | public NFSAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
31 | View rowItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycle_view_nfssettings, parent, false);
32 | return new ViewHolder(rowItem);
33 | }
34 |
35 | @Override
36 | public void onBindViewHolder(@NonNull NFSAdapter.ViewHolder holder, int position) {
37 | try {
38 | holder.mTitle.setText(this.data.get(position).getTitle());
39 | holder.mValue.setText(this.data.get(position).getDescription());
40 | } catch (ArrayIndexOutOfBoundsException ignored) {
41 | }
42 | }
43 |
44 | @Override
45 | public int getItemCount() {
46 | return this.data.size();
47 | }
48 |
49 | public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
50 | private final MaterialTextView mTitle, mValue;
51 |
52 | public ViewHolder(View view) {
53 | super(view);
54 | view.setOnClickListener(this);
55 | this.mTitle = view.findViewById(R.id.title);
56 | this.mValue = view.findViewById(R.id.value);
57 | }
58 |
59 | @Override
60 | public void onClick(View view) {
61 | CharSequence mItem = this.mTitle.getText();
62 | if (mItem.equals(view.getContext().getString(R.string.governor))) {
63 | NFS.setGOV(this.mValue, mValue, view.getContext());
64 | } else if (mItem.equals(view.getContext().getString(R.string.scheduler))) {
65 | NFS.setScheduler(this.mValue, mValue);
66 | } else if (mItem.equals(view.getContext().getString(R.string.tcp))) {
67 | NFS.setTCP(this.mValue, mValue);
68 | } else if (mItem.equals(view.getContext().getString(R.string.doze))) {
69 | NFS.setDozeMode(this.mValue, mValue, view.getContext());
70 | } else if (mItem.equals(view.getContext().getString(R.string.ram_level))) {
71 | NFS.setLMKMenu(this.mValue, mValue, view.getContext());
72 | } else if (mItem.equals(view.getContext().getString(R.string.shield))) {
73 | NFS.setShield(this.mValue, mValue, view.getContext());
74 | } else if (mItem.equals(view.getContext().getString(R.string.add_disabler))) {
75 | NFS.setAds(this.mValue, mValue, view.getContext());
76 | } else if (mItem.equals(view.getContext().getString(R.string.dns))) {
77 | NFS.setDNSMode(this.mValue, mValue, view.getContext());
78 | } else if (mItem.equals(view.getContext().getString(R.string.selinux))) {
79 | NFS.setSELinuxMode(this.mValue, mValue, view.getContext());
80 | } else if (mItem.equals(view.getContext().getString(R.string.overwatch_engine)) || mItem.equals(view.getContext().getString(R.string.zygote))) {
81 | NFS.setEnableDisableMenu(this.mValue, mItem.toString(), mValue, view.getContext());
82 | } else if (mItem.equals(view.getContext().getString(R.string.thermal_throttle)) || mItem.equals(view.getContext().getString(R.string.sync))
83 | || mItem.equals(view.getContext().getString(R.string.super_sampling))) {
84 | NFS.setOnOffMenu(this.mValue, mItem.toString(), mValue, view.getContext());
85 | }
86 | }
87 | }
88 |
89 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/fragments/AboutFragment.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.fragments;
2 |
3 | import android.app.Activity;
4 | import android.content.res.Configuration;
5 | import android.os.Bundle;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import androidx.annotation.Nullable;
11 | import androidx.core.content.ContextCompat;
12 | import androidx.fragment.app.Fragment;
13 | import androidx.recyclerview.widget.GridLayoutManager;
14 | import androidx.recyclerview.widget.RecyclerView;
15 |
16 | import com.nfs.nfsmanager.BuildConfig;
17 | import com.nfs.nfsmanager.R;
18 | import com.nfs.nfsmanager.adapters.AboutAdapter;
19 | import com.nfs.nfsmanager.utils.SerializableItems;
20 | import com.nfs.nfsmanager.utils.NFS;
21 | import com.nfs.nfsmanager.utils.UpdateCheck;
22 | import com.nfs.nfsmanager.utils.Utils;
23 |
24 | import java.util.ArrayList;
25 |
26 | /*
27 | * Created by sunilpaulmathew on November 05, 2020
28 | */
29 |
30 | public class AboutFragment extends Fragment {
31 |
32 | @Nullable
33 | @Override
34 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
35 | View mRootView = inflater.inflate(R.layout.fragment_about, container, false);
36 |
37 | RecyclerView mRecyclerView = mRootView.findViewById(R.id.recycler_view);
38 | mRecyclerView.setLayoutManager(new GridLayoutManager(requireActivity(), getSpanCount(requireActivity())));
39 | AboutAdapter mRecycleViewAdapter = new AboutAdapter(getData());
40 | mRecyclerView.setAdapter(mRecycleViewAdapter);
41 | mRecyclerView.setVisibility(View.VISIBLE);
42 |
43 | return mRootView;
44 | }
45 |
46 | private ArrayList getData() {
47 | ArrayList mData = new ArrayList<>();
48 | mData.add(new SerializableItems(getString(R.string.app_name), BuildConfig.VERSION_NAME, ContextCompat.getDrawable(requireActivity(), R.mipmap.ic_launcher_round), null));
49 | mData.add(new SerializableItems(getString(R.string.nfs_injector), NFS.getReleaseStatus(), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_info), null));
50 | mData.add(new SerializableItems(getString(R.string.support), getString(R.string.support_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_support), "https://t.me/nfsinjector"));
51 | mData.add(new SerializableItems(getString(R.string.source_code), getString(R.string.source_code_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_github), "https://github.com/sunilpaulmathew/NFSManager"));
52 | mData.add(new SerializableItems(getString(R.string.report_issue), getString(R.string.report_issue_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_bug), "https://github.com/sunilpaulmathew/NFSManager/issues/new"));
53 | mData.add(new SerializableItems(getString(R.string.change_logs), getString(R.string.change_logs_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_active), null));
54 | mData.add(new SerializableItems(getString(R.string.more_apps), getString(R.string.more_apps_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_playstore), "https://play.google.com/store/apps/dev?id=5836199813143882901"));
55 | mData.add(new SerializableItems(getString(R.string.privacy_policy), getString(R.string.privacy_policy_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_privacy), null));
56 | mData.add(new SerializableItems(getString(R.string.licence), getString(R.string.licence_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_licence), null));
57 | mData.add(new SerializableItems(getString(R.string.credits), getString(R.string.credits_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_contributors), null));
58 | mData.add(new SerializableItems(getString(R.string.donations), getString(R.string.donations_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_donate), null));
59 | if (UpdateCheck.isSignatureMatched(requireActivity())) {
60 | mData.add(new SerializableItems(getString(R.string.update_check), getString(R.string.update_check_summary), ContextCompat.getDrawable(requireActivity(), R.drawable.ic_update), null));
61 | }
62 | return mData;
63 | }
64 |
65 | private int getSpanCount(Activity activity) {
66 | return Utils.isTablet(activity) ? Utils.getOrientation(activity) == Configuration.ORIENTATION_LANDSCAPE ?
67 | 4 : 3 : Utils.getOrientation(activity) == Configuration.ORIENTATION_LANDSCAPE ? 3 : 2;
68 | }
69 |
70 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/fragments/CPUTimesFragment.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.fragments;
2 |
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 | import androidx.annotation.Nullable;
9 | import androidx.fragment.app.Fragment;
10 | import androidx.recyclerview.widget.LinearLayoutManager;
11 |
12 | import com.nfs.nfsmanager.R;
13 | import com.nfs.nfsmanager.utils.Common;
14 |
15 | /*
16 | * Created by sunilpaulmathew on December 10, 2020
17 | */
18 |
19 | public class CPUTimesFragment extends Fragment {
20 | @Nullable
21 | @Override
22 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
23 | View mRootView = inflater.inflate(R.layout.fragment_cputime, container, false);
24 |
25 | Common.initializeRecyclerView(mRootView, R.id.recycler_view);
26 | Common.getRecyclerView().setLayoutManager(new LinearLayoutManager(requireActivity()));
27 | Common.getRecyclerView().setAdapter(Common.getRecycleViewAdapter());
28 |
29 | return mRootView;
30 | }
31 |
32 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/fragments/DashBoardFragment.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.fragments;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.app.Activity;
5 | import android.content.Intent;
6 | import android.content.pm.ActivityInfo;
7 | import android.content.res.Configuration;
8 | import android.os.Bundle;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 |
13 | import androidx.annotation.Nullable;
14 | import androidx.fragment.app.Fragment;
15 | import androidx.recyclerview.widget.GridLayoutManager;
16 | import androidx.recyclerview.widget.RecyclerView;
17 |
18 | import com.google.android.material.dialog.MaterialAlertDialogBuilder;
19 | import com.nfs.nfsmanager.R;
20 | import com.nfs.nfsmanager.activities.ApplyModeActivity;
21 | import com.nfs.nfsmanager.adapters.DashBoardAdapter;
22 | import com.nfs.nfsmanager.utils.AsyncTasks;
23 | import com.nfs.nfsmanager.utils.Common;
24 | import com.nfs.nfsmanager.utils.NFS;
25 | import com.nfs.nfsmanager.utils.SerializableItems;
26 | import com.nfs.nfsmanager.utils.Utils;
27 |
28 | import java.util.ArrayList;
29 |
30 | /*
31 | * Created by sunilpaulmathew on November 05, 2020
32 | */
33 | public class DashBoardFragment extends Fragment {
34 |
35 | private RecyclerView mRecyclerView;
36 |
37 | @SuppressLint("UseCompatLoadingForDrawables")
38 | @Nullable
39 | @Override
40 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
41 | View mRootView = inflater.inflate(R.layout.fragment_dashboard, container, false);
42 |
43 | mRecyclerView = mRootView.findViewById(R.id.recycler_view);
44 | mRecyclerView.setLayoutManager(new GridLayoutManager(requireActivity(), getSpanCount(requireActivity())));
45 | DashBoardAdapter mRecycleViewAdapter = new DashBoardAdapter(getData());
46 | mRecyclerView.setAdapter(mRecycleViewAdapter);
47 | mRecyclerView.setVisibility(View.VISIBLE);
48 |
49 | mRecycleViewAdapter.setOnItemClickListener((position, v) -> {
50 | if (position != NFS.getNFSMode()) {
51 | if (position == 0) {
52 | showUpdateModeDialog(0, getString(R.string.battery));
53 | } else if (position == 1) {
54 | showUpdateModeDialog(1, getString(R.string.balanced));
55 | } else if (position == 2) {
56 | showUpdateModeDialog(2, getString(R.string.ultra));
57 | } else if (position == 3) {
58 | showUpdateModeDialog(3, getString(R.string.gaming));
59 | } else if (position == 4) {
60 | Utils.launchUrl("https://github.com/k1ks/NFS-INJECTOR/wiki", requireActivity());
61 | }
62 | }
63 | });
64 |
65 | return mRootView;
66 | }
67 |
68 | private ArrayList getData() {
69 | ArrayList mData = new ArrayList<>();
70 | mData.add(new SerializableItems(getString(R.string.battery), null, null, null));
71 | mData.add(new SerializableItems(getString(R.string.balanced), null, null, null));
72 | mData.add(new SerializableItems(getString(R.string.ultra), null, null, null));
73 | mData.add(new SerializableItems(getString(R.string.gaming), null, null, null));
74 | mData.add(new SerializableItems(getString(R.string.user_guide), null,
75 | null, "https://github.com/k1ks/NFS-INJECTOR/wiki"));
76 | return mData;
77 | }
78 |
79 | @SuppressLint("StaticFieldLeak")
80 | private void updateNFSMode(int value, String message) {
81 | new AsyncTasks() {
82 |
83 | @Override
84 | public void onPreExecute() {
85 | requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
86 | Common.isApplying(true);
87 | Common.getOutput().clear();
88 | Common.getOutput().add(getString(R.string.mode_message, message));
89 | Common.getOutput().add("================================================");
90 | Intent applyMode = new Intent(requireActivity(), ApplyModeActivity.class);
91 | startActivity(applyMode);
92 | }
93 |
94 | @Override
95 | public void doInBackground() {
96 | NFS.setNFSMode(value);
97 | Utils.runAndGetLiveOutput("sh /data/adb/modules/injector/service.sh", Common.getOutput());
98 | }
99 |
100 | @Override
101 | public void onPostExecute() {
102 | Common.getOutput().add("================================================");
103 | Common.getOutput().add(getString(R.string.mode_applied, message));
104 | Common.isApplying(false);
105 | requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER);
106 | mRecyclerView.setAdapter(new DashBoardAdapter(getData()));
107 | }
108 | }.execute();
109 | }
110 |
111 | private void showUpdateModeDialog(int value, String message) {
112 | new MaterialAlertDialogBuilder(requireActivity())
113 | .setIcon(R.mipmap.ic_launcher)
114 | .setTitle(R.string.app_name)
115 | .setMessage(getString(R.string.mode_change_question, message))
116 | .setNegativeButton(R.string.cancel, (dialog, which) -> {
117 | })
118 | .setPositiveButton(R.string.apply, (dialog, which) -> updateNFSMode(value, message)).show();
119 | }
120 |
121 | private int getSpanCount(Activity activity) {
122 | return Utils.getOrientation(activity) == Configuration.ORIENTATION_LANDSCAPE ? 2 : 1;
123 | }
124 |
125 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/fragments/MagiskLogFragment.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.fragments;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.net.Uri;
7 | import android.os.Bundle;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.LinearLayout;
12 |
13 | import androidx.annotation.Nullable;
14 | import androidx.core.content.FileProvider;
15 | import androidx.fragment.app.Fragment;
16 |
17 | import com.google.android.material.dialog.MaterialAlertDialogBuilder;
18 | import com.google.android.material.floatingactionbutton.FloatingActionButton;
19 | import com.google.android.material.textview.MaterialTextView;
20 | import com.nfs.nfsmanager.BuildConfig;
21 | import com.nfs.nfsmanager.R;
22 | import com.nfs.nfsmanager.utils.AsyncTasks;
23 | import com.nfs.nfsmanager.utils.NFS;
24 | import com.nfs.nfsmanager.utils.Utils;
25 |
26 | import java.io.File;
27 |
28 | /*
29 | * Created by sunilpaulmathew on November 05, 2020
30 | */
31 |
32 | public class MagiskLogFragment extends Fragment {
33 |
34 | private LinearLayout mProgressLayout;
35 | private MaterialTextView mProgressMessage;
36 |
37 | @Nullable
38 | @Override
39 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
40 | View mRootView = inflater.inflate(R.layout.fragment_log_view, container, false);
41 |
42 | mProgressLayout = mRootView.findViewById(R.id.progress_layout);
43 | mProgressMessage = mRootView.findViewById(R.id.progress_text);
44 | MaterialTextView mLogText = mRootView.findViewById(R.id.log_text);
45 | FloatingActionButton mSave = mRootView.findViewById(R.id.save_button);
46 |
47 | mLogText.setText(NFS.readMagiskLog());
48 | mSave.setOnClickListener(v -> exportMagiskLog(requireActivity()));
49 | return mRootView;
50 | }
51 |
52 | @SuppressLint("StaticFieldLeak")
53 | public void exportMagiskLog(Context context) {
54 | new AsyncTasks() {
55 |
56 | @SuppressLint("SetTextI18n")
57 | @Override
58 | public void onPreExecute() {
59 | mProgressLayout.setVisibility(View.VISIBLE);
60 | mProgressMessage.setText(context.getString(R.string.exporting, new File(context.getExternalFilesDir("logs"),"magisk.log")) + "...");
61 | }
62 |
63 | @Override
64 | public void doInBackground() {
65 | Utils.runCommand("sleep 2");
66 | Utils.copy("/cache/magisk.log", new File(context.getExternalFilesDir("logs"),"magisk.log").getAbsolutePath());
67 | }
68 |
69 | @Override
70 | public void onPostExecute() {
71 | mProgressLayout.setVisibility(View.GONE);
72 | if (Utils.exist(new File(context.getExternalFilesDir("logs"),"magisk.log").getAbsolutePath())) {
73 | new MaterialAlertDialogBuilder(context)
74 | .setIcon(R.mipmap.ic_launcher)
75 | .setTitle(R.string.app_name)
76 | .setMessage(context.getString(R.string.export_completed, context.getExternalFilesDir("logs")))
77 | .setCancelable(false)
78 | .setNegativeButton(context.getString(R.string.cancel), (dialog, id) -> {
79 | })
80 | .setPositiveButton(context.getString(R.string.share), (dialog, id) -> {
81 | Uri uriFile = FileProvider.getUriForFile(context,
82 | BuildConfig.APPLICATION_ID + ".provider", new File(context.getExternalFilesDir("logs"),"magisk.log"));
83 | Intent shareScript = new Intent(Intent.ACTION_SEND);
84 | shareScript.setType("text/x-log");
85 | shareScript.putExtra(Intent.EXTRA_TEXT, context.getString(R.string.share_by, context.getString(R.string.magisk_log)));
86 | shareScript.putExtra(Intent.EXTRA_STREAM, uriFile);
87 | shareScript.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
88 | context.startActivity(Intent.createChooser(shareScript, context.getString(R.string.share_with)));
89 | })
90 | .show();
91 | }
92 | }
93 | }.execute();
94 | }
95 |
96 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/fragments/NFSFragment.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.fragments;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.res.Configuration;
6 | import android.os.Bundle;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 |
11 | import androidx.annotation.Nullable;
12 | import androidx.fragment.app.Fragment;
13 | import androidx.recyclerview.widget.GridLayoutManager;
14 | import androidx.recyclerview.widget.RecyclerView;
15 |
16 | import com.nfs.nfsmanager.R;
17 | import com.nfs.nfsmanager.adapters.NFSAdapter;
18 | import com.nfs.nfsmanager.utils.SerializableItems;
19 | import com.nfs.nfsmanager.utils.NFS;
20 | import com.nfs.nfsmanager.utils.Utils;
21 |
22 | import java.util.ArrayList;
23 |
24 | /*
25 | * Created by sunilpaulmathew on November 05, 2020
26 | */
27 | public class NFSFragment extends Fragment {
28 |
29 | @Nullable
30 | @Override
31 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
32 | View mRootView = inflater.inflate(R.layout.fragment_nfs_settings, container, false);
33 |
34 | RecyclerView mRecyclerView = mRootView.findViewById(R.id.recycler_view);
35 |
36 | if (NFS.supported()) {
37 | mRecyclerView.setLayoutManager(new GridLayoutManager(requireContext(), getSpanCount(requireActivity())));
38 | mRecyclerView.setAdapter(new NFSAdapter(getData(requireContext())));
39 | }
40 |
41 | return mRootView;
42 | }
43 |
44 | private int getSpanCount(Activity activity) {
45 | return Utils.getOrientation(activity) == Configuration.ORIENTATION_LANDSCAPE ? 2 : 1;
46 | }
47 |
48 | private static ArrayList getData(Context context) {
49 | ArrayList mData = new ArrayList<>();
50 | if (NFS.supported()) {
51 | if (NFS.getGOVs() != null) {
52 | mData.add(new SerializableItems(context.getString(R.string.governor), NFS.getGOV(), null, null));
53 | }
54 | if (NFS.getSchedulers() != null) {
55 | mData.add(new SerializableItems(context.getString(R.string.scheduler), NFS.getSched(), null, null));
56 | }
57 | if (NFS.hasDNSMode()) {
58 | mData.add(new SerializableItems(context.getString(R.string.dns), NFS.getDNSMode(context), null, null));
59 | }
60 | if (NFS.hasSELinux()) {
61 | mData.add(new SerializableItems(context.getString(R.string.selinux), NFS.getSELinuxMode(context), null, null));
62 | }
63 | if (NFS.hasSync()) {
64 | mData.add(new SerializableItems(context.getString(R.string.sync), NFS.getOnOff(context.getString(R.string.sync), context), null, null));
65 | }
66 | if (NFS.hasTT()) {
67 | mData.add(new SerializableItems(context.getString(R.string.thermal_throttle), NFS.getOnOff(context.getString(R.string.thermal_throttle), context), null, null));
68 | }
69 | if (NFS.availableTCPs() != null) {
70 | mData.add(new SerializableItems(context.getString(R.string.tcp), NFS.getTCP(), null, null));
71 | }
72 | if (NFS.hasDozeMode()) {
73 | mData.add(new SerializableItems(context.getString(R.string.doze), NFS.getDozeMode(context), null, null));
74 | }
75 | if (NFS.hasLMK()) {
76 | mData.add(new SerializableItems(context.getString(R.string.ram_level), NFS.getLMK(context), null, null));
77 | }
78 | if (NFS.hasShield()) {
79 | mData.add(new SerializableItems(context.getString(R.string.shield), NFS.getShield(context), null, null));
80 | }
81 | if (NFS.hasAds()) {
82 | mData.add(new SerializableItems(context.getString(R.string.add_disabler), NFS.getAds(context), null, null));
83 | }
84 | if (NFS.hasOW()) {
85 | mData.add(new SerializableItems(context.getString(R.string.overwatch_engine), NFS.getEnableDisable(context.getString(R.string.overwatch_engine), context), null, null));
86 | }
87 | if (NFS.hasSF()) {
88 | mData.add(new SerializableItems(context.getString(R.string.super_sampling), NFS.getOnOff(context.getString(R.string.super_sampling), context), null, null));
89 | }
90 | if (NFS.hasZygote()) {
91 | mData.add(new SerializableItems(context.getString(R.string.zygote), NFS.getEnableDisable(context.getString(R.string.zygote), context), null, null));
92 | }
93 | }
94 | return mData;
95 | }
96 |
97 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/fragments/NFSLogFragment.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.fragments;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.net.Uri;
7 | import android.os.Bundle;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.LinearLayout;
12 |
13 | import androidx.annotation.Nullable;
14 | import androidx.core.content.FileProvider;
15 | import androidx.fragment.app.Fragment;
16 |
17 | import com.google.android.material.dialog.MaterialAlertDialogBuilder;
18 | import com.google.android.material.floatingactionbutton.FloatingActionButton;
19 | import com.google.android.material.textview.MaterialTextView;
20 | import com.nfs.nfsmanager.BuildConfig;
21 | import com.nfs.nfsmanager.R;
22 | import com.nfs.nfsmanager.utils.AsyncTasks;
23 | import com.nfs.nfsmanager.utils.NFS;
24 | import com.nfs.nfsmanager.utils.Utils;
25 |
26 | import java.io.File;
27 |
28 | /*
29 | * Created by sunilpaulmathew on November 05, 2020
30 | */
31 |
32 | public class NFSLogFragment extends Fragment {
33 |
34 | private LinearLayout mProgressLayout;
35 | private MaterialTextView mProgressMessage;
36 |
37 | @Nullable
38 | @Override
39 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
40 | View mRootView = inflater.inflate(R.layout.fragment_log_view, container, false);
41 |
42 | mProgressLayout = mRootView.findViewById(R.id.progress_layout);
43 | mProgressMessage = mRootView.findViewById(R.id.progress_text);
44 | MaterialTextView mLogText = mRootView.findViewById(R.id.log_text);
45 | FloatingActionButton mSave = mRootView.findViewById(R.id.save_button);
46 |
47 | mLogText.setText(NFS.readNFSLog());
48 | mSave.setOnClickListener(v -> exportNFSLog(requireActivity()));
49 | return mRootView;
50 | }
51 |
52 | @SuppressLint("StaticFieldLeak")
53 | public void exportNFSLog(Context context) {
54 | new AsyncTasks() {
55 |
56 | @SuppressLint("SetTextI18n")
57 | @Override
58 | public void onPreExecute() {
59 | mProgressLayout.setVisibility(View.VISIBLE);
60 | mProgressMessage.setText(context.getString(R.string.exporting, new File(context.getExternalFilesDir("logs"),"nfs.log")) + "...");
61 | }
62 |
63 | @Override
64 | public void doInBackground() {
65 | Utils.runCommand("sleep 2");
66 | Utils.copy("/data/NFS/nfs.log", new File(context.getExternalFilesDir("logs"),"nfs.log").getAbsolutePath());
67 | }
68 |
69 | @Override
70 | public void onPostExecute() {
71 | mProgressLayout.setVisibility(View.GONE);
72 | if (Utils.exist(new File(context.getExternalFilesDir("logs"),"nfs.log").getAbsolutePath())) {
73 | new MaterialAlertDialogBuilder(context)
74 | .setIcon(R.mipmap.ic_launcher)
75 | .setTitle(R.string.app_name)
76 | .setMessage(context.getString(R.string.export_completed, context.getExternalFilesDir("logs")))
77 | .setCancelable(false)
78 | .setNegativeButton(context.getString(R.string.cancel), (dialog, id) -> {
79 | })
80 | .setPositiveButton(context.getString(R.string.share), (dialog, id) -> {
81 | Uri uriFile = FileProvider.getUriForFile(context,
82 | BuildConfig.APPLICATION_ID + ".provider", new File(context.getExternalFilesDir("logs"),"nfs.log"));
83 | Intent shareScript = new Intent(Intent.ACTION_SEND);
84 | shareScript.setType("text/x-log");
85 | shareScript.putExtra(Intent.EXTRA_TEXT, context.getString(R.string.share_by, context.getString(R.string.nfs_log)));
86 | shareScript.putExtra(Intent.EXTRA_STREAM, uriFile);
87 | shareScript.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
88 | context.startActivity(Intent.createChooser(shareScript, context.getString(R.string.share_with)));
89 | })
90 | .show();
91 | }
92 | }
93 | }.execute();
94 | }
95 |
96 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/receivers/UpdateReceiver.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.receivers;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 |
7 | import com.nfs.nfsmanager.utils.UpdateCheck;
8 | import com.nfs.nfsmanager.utils.Utils;
9 |
10 | /*
11 | * Created by sunilpaulmathew on June 19, 2022
12 | */
13 |
14 | public class UpdateReceiver extends BroadcastReceiver {
15 |
16 | @Override
17 | public void onReceive(Context context, Intent intent) {
18 |
19 | if (Utils.getBoolean("update_check_auto", true, context) && UpdateCheck
20 | .isSignatureMatched(context)) {
21 | UpdateCheck.initialize(1, true, context);
22 | }
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/utils/AsyncTasks.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.utils;
2 |
3 | import android.os.Handler;
4 | import android.os.Looper;
5 |
6 | import java.util.concurrent.ExecutorService;
7 | import java.util.concurrent.Executors;
8 |
9 | /*
10 | * Created by sunilpaulmathew on September 25, 2021
11 | * Ref: https://stackoverflow.com/questions/58767733/android-asynctask-api-deprecating-in-android-11-what-are-the-alternatives
12 | */
13 | public abstract class AsyncTasks {
14 | private final ExecutorService executors;
15 |
16 | public AsyncTasks() {
17 | this.executors = Executors.newSingleThreadExecutor();
18 | }
19 |
20 | private void startBackground() {
21 | onPreExecute();
22 | executors.execute(() -> {
23 | doInBackground();
24 | new Handler(Looper.getMainLooper()).post(() -> {
25 | onPostExecute();
26 | if (!executors.isShutdown()) executors.shutdown();
27 | });
28 | });
29 | }
30 |
31 | public void execute() {
32 | startBackground();
33 | }
34 |
35 | public abstract void onPreExecute();
36 |
37 | public abstract void doInBackground();
38 |
39 | public abstract void onPostExecute();
40 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/utils/CPUTimes.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.utils;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Collections;
5 | import java.util.List;
6 | import java.util.Objects;
7 |
8 | /*
9 | * Created by sunilpaulmathew on December 10, 2020
10 | */
11 |
12 | public class CPUTimes {
13 |
14 | private static final List mData = new ArrayList<>();
15 |
16 | public static List getData(String path) {
17 | mData.clear();
18 | Collections.addAll(mData, Objects.requireNonNull(Utils.read(path)).split("\\r?\\n"));
19 | mData.add("Deep sleep");
20 | return mData;
21 | }
22 |
23 | public static String sToString(long tSec) {
24 | int h = (int) tSec / 60 / 60;
25 | int m = (int) tSec / 60 % 60;
26 | int s = (int) tSec % 60;
27 | String sDur;
28 | sDur = h + ":";
29 | if (m < 10) sDur += "0";
30 | sDur += m + ":";
31 | if (s < 10) sDur += "0";
32 | sDur += s;
33 |
34 | return sDur;
35 | }
36 |
37 | public static boolean supported(String path) {
38 | return getData(path).size() > 2;
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/utils/Common.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.utils;
2 |
3 | /*
4 | * Created by sunilpaulmathew on June 15, 2020
5 | */
6 |
7 | import android.view.View;
8 |
9 | import androidx.recyclerview.widget.RecyclerView;
10 |
11 | import com.nfs.nfsmanager.adapters.CPUTimesAdapter;
12 |
13 | import java.util.ArrayList;
14 | import java.util.List;
15 |
16 | public class Common {
17 |
18 | private static boolean mApplying, mFlashing = false, mModuleInvalid = false;
19 | private static CPUTimesAdapter mRecycleViewAdapter;
20 | private static final List mFlashingOutput = new ArrayList<>(), mOutput = new ArrayList<>();
21 | private static RecyclerView mRecyclerView;
22 | private static String mURL = null, mZipName;
23 | private static final StringBuilder mFlashingResult = new StringBuilder();
24 |
25 | public static boolean isApplying() {
26 | return mApplying;
27 | }
28 |
29 | public static boolean isFlashing() {
30 | return mFlashing;
31 | }
32 |
33 | public static boolean isModuleInvalid() {
34 | return mModuleInvalid;
35 | }
36 |
37 | public static CPUTimesAdapter getRecycleViewAdapter() {
38 | return mRecycleViewAdapter;
39 | }
40 |
41 | public static List getFlashingOutput() {
42 | return mFlashingOutput;
43 | }
44 |
45 | public static List getOutput() {
46 | return mOutput;
47 | }
48 |
49 | public static RecyclerView getRecyclerView() {
50 | return mRecyclerView;
51 | }
52 |
53 | public static String getURL() {
54 | return mURL;
55 | }
56 |
57 | public static String getZipName() {
58 | return mZipName;
59 | }
60 |
61 | public static StringBuilder getFlashingResult() {
62 | return mFlashingResult;
63 | }
64 |
65 | public static void initializeRecycleViewAdapter(List data) {
66 | mRecycleViewAdapter = new CPUTimesAdapter(data);
67 | }
68 |
69 | public static void initializeRecyclerView(View view, int id) {
70 | mRecyclerView = view.findViewById(id);
71 | }
72 |
73 | public static void isApplying(boolean b) {
74 | mApplying = b;
75 | }
76 |
77 | public static void isFlashing(boolean b) {
78 | mFlashing = b;
79 | }
80 |
81 | public static void isModuleInvalid(boolean b) {
82 | mModuleInvalid = b;
83 | }
84 |
85 | public static void setURL(String url) {
86 | mURL = url;
87 | }
88 |
89 | public static void setZipName(String zipName) {
90 | mZipName = zipName;
91 | }
92 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/utils/DeviceInfo.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.utils;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.os.Build;
5 | import android.os.SystemClock;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 | import java.util.Objects;
10 | import java.util.concurrent.TimeUnit;
11 |
12 | /*
13 | * Created by sunilpaulmathew on December 10, 2020
14 | */
15 |
16 | public class DeviceInfo {
17 |
18 | private static final String BATTERY = "/sys/class/power_supply/battery";
19 | private static final String LEVEL = BATTERY + "/capacity";
20 | private static final String VOLTAGE = BATTERY + "/voltage_now";
21 | private static final String CHARGE_RATE = BATTERY + "/current_now";
22 |
23 | public static String getModel() {
24 | return Build.MODEL;
25 | }
26 |
27 | public static String getBatteryVoltage() {
28 | int voltage = parseInt(VOLTAGE);
29 | return String.valueOf(voltage / 1000);
30 | }
31 |
32 | public static String getChargingStatus() {
33 | int chargingrate = parseInt(CHARGE_RATE);
34 | if (chargingrate > 10000) {
35 | return String.valueOf(chargingrate / 1000);
36 | } else if (chargingrate < -10000) {
37 | return String.valueOf(chargingrate / -1000);
38 | } else if (chargingrate < 0 && chargingrate > -1000) {
39 | return String.valueOf(chargingrate * -1);
40 | } else {
41 | return String.valueOf(chargingrate);
42 | }
43 | }
44 |
45 | public static String getTotalUpTime() {
46 | return getDurationBreakdown(SystemClock.elapsedRealtime());
47 | }
48 |
49 | public static String getAwakeTime() {
50 | return DeviceInfo.getDurationBreakdown(SystemClock.uptimeMillis());
51 | }
52 |
53 | public static String getDeepSleepTime() {
54 | return DeviceInfo.getDurationBreakdown(SystemClock.elapsedRealtime() - SystemClock.uptimeMillis());
55 | }
56 |
57 | public static int getBatteryLevel() {
58 | return parseInt(LEVEL);
59 | }
60 |
61 | public static long getItemMb(String prefix) {
62 | try {
63 | return Long.parseLong(getItem(prefix).replaceAll("[^\\d]", "")) / 1024L;
64 | } catch (NumberFormatException ignored) {
65 | return 0;
66 | }
67 | }
68 |
69 | private static String getItem(String prefix) {
70 | try {
71 | for (String line : Objects.requireNonNull(Utils.read("/proc/meminfo")).split("\\r?\\n")) {
72 | if (line.startsWith(prefix)) {
73 | return line.split(":")[1].trim();
74 | }
75 | }
76 | } catch (Exception ignored) {
77 | }
78 | return "";
79 | }
80 |
81 | @SuppressLint("DefaultLocale")
82 | public static String getDurationBreakdown(long millis) {
83 | StringBuilder sb = new StringBuilder(64);
84 | if(millis <= 0)
85 | {
86 | sb.append("00 min 00 s");
87 | return sb.toString();
88 | }
89 |
90 | long days = TimeUnit.MILLISECONDS.toDays(millis);
91 | millis -= TimeUnit.DAYS.toMillis(days);
92 | long hours = TimeUnit.MILLISECONDS.toHours(millis);
93 | millis -= TimeUnit.HOURS.toMillis(hours);
94 | long minutes = TimeUnit.MILLISECONDS.toMinutes(millis);
95 | millis -= TimeUnit.MINUTES.toMillis(minutes);
96 | long seconds = TimeUnit.MILLISECONDS.toSeconds(millis);
97 |
98 | if (days > 0) {
99 | sb.append(days);
100 | sb.append(" day ");
101 | }
102 | if (hours > 0) {
103 | sb.append(hours);
104 | sb.append(" hr ");
105 | }
106 | sb.append(String.format("%02d", minutes));
107 | sb.append(" min ");
108 | sb.append(String.format("%02d", seconds));
109 | sb.append(" s");
110 | return sb.toString();
111 | }
112 |
113 | private static int parseInt(String path) {
114 | return Utils.strToInt(Utils.read(path));
115 | }
116 |
117 | public static List getData() {
118 | List mData = new ArrayList<>();
119 | if (getDeviceInfo("** ID NFS : ") != null) {
120 | mData.add("NFS ID: " + getDeviceInfo("** ID NFS : "));
121 | }
122 | if (getDeviceInfo("** ID Phone : ") != null) {
123 | mData.add("Phone ID: " + getDeviceInfo("** ID Phone : "));
124 | }
125 | if (getDeviceInfo("** Rom : ") != null) {
126 | mData.add("ROM: " + getDeviceInfo("** Rom : "));
127 | }
128 | if (getDeviceInfo("** Kernel : ") != null) {
129 | mData.add("Kernel: " + getDeviceInfo("** Kernel : "));
130 | }
131 | if (getDeviceInfo("** Busybox Environment : ") != null) {
132 | mData.add("BusyBox: " + getDeviceInfo("** Busybox Environment : "));
133 | }
134 | if (getDeviceInfo("** Aarch : ") != null) {
135 | mData.add("ARCH: " + getDeviceInfo("** Aarch : "));
136 | }
137 | if (getDeviceInfo("** Android : ") != null) {
138 | mData.add("Android: " + getDeviceInfo("** Android : "));
139 | }
140 | if (getDeviceInfo("** Sdk : ") != null) {
141 | mData.add("SDK: " + getDeviceInfo("** Sdk : "));
142 | }
143 | return mData;
144 | }
145 |
146 | private static String getDeviceInfo(String string) {
147 | try {
148 | for (String line : Objects.requireNonNull(Utils.read("/data/NFS/nfs.log")).split("\\r?\\n")) {
149 | if (line.startsWith(string)) {
150 | return line.replace(string, "").replace(" *","");
151 | }
152 | }
153 | } catch (Exception ignored) {
154 | }
155 | return null;
156 | }
157 |
158 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/utils/Flasher.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.utils;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.Intent;
6 |
7 | import com.nfs.nfsmanager.activities.FlashingActivity;
8 |
9 | import java.io.File;
10 | import java.util.Objects;
11 |
12 | /*
13 | * Created by sunilpaulmathew on May 05, 2020
14 | */
15 |
16 | public class Flasher {
17 |
18 | private static void prepareFolder(String path) {
19 | File file = new File(path);
20 | if (file.exists() && file.isFile()) {
21 | file.delete();
22 | }
23 | file.mkdirs();
24 | }
25 |
26 | private static void flashModule(Context context) {
27 | /*
28 | * Flashing recovery zip without rebooting to custom recovery (Credits to osm0sis @ xda-developers.com)
29 | * Also include code from https://github.com/topjohnwu/Magisk/
30 | * Ref: https://github.com/topjohnwu/Magisk/blob/a848f10bba4f840248ecf314f7c9d55511d05a0f/app/src/main/java/com/topjohnwu/magisk/core/tasks/FlashZip.kt#L47
31 | */
32 | String FLASH_FOLDER = Utils.getInternalDataStorage(context) + "/flash";
33 | String CLEANING_COMMAND = "rm -r '" + FLASH_FOLDER + "'";
34 | String mScriptPath = Utils.getInternalDataStorage(context) + "/flash/META-INF/com/google/android/update-binary";
35 | String mZipPath = context.getCacheDir() + "/flash.zip";
36 | String flashingCommand = "BOOTMODE=true sh " + mScriptPath + " dummy 1 " + mZipPath + " && echo success";
37 | if (Utils.exist(FLASH_FOLDER)) {
38 | Utils.runCommand(CLEANING_COMMAND);
39 | } else {
40 | prepareFolder(FLASH_FOLDER);
41 | }
42 | Common.getFlashingResult().append("** Extracting ").append(Common.getZipName()).append(" into working folder: ");
43 | Utils.runAndGetError(Utils.magiskBusyBox() + " unzip " + mZipPath + " -d '" + FLASH_FOLDER + "'");
44 | if (Utils.exist(mScriptPath)) {
45 | Common.getFlashingResult().append(" Done *\n\n");
46 | Common.getFlashingResult().append("** Checking Module: ");
47 | if (Objects.requireNonNull(Utils.read(FLASH_FOLDER + "/module.prop")).contains("name=NFS INJECTOR @nfsinjector")) {
48 | Common.isModuleInvalid(false);
49 | Common.getFlashingResult().append(" Done *\n\n");
50 | Utils.runCommand("cd '" + FLASH_FOLDER + "'");
51 | Common.getFlashingResult().append("** Flashing ").append(Common.getZipName()).append(" ...\n\n");
52 | Utils.runAndGetLiveOutput(flashingCommand, Common.getFlashingOutput());
53 | Common.getFlashingResult().append(Utils.getOutput(Common.getFlashingOutput()).endsWith("\nsuccess") ? Utils.getOutput(Common.getFlashingOutput())
54 | .replace("\nsuccess","") : "** Flashing Failed *");
55 | } else {
56 | Common.isModuleInvalid(true);
57 | Common.getFlashingOutput().clear();
58 | Common.getFlashingResult().append(" Invalid *\n\n");
59 | }
60 | } else {
61 | Common.getFlashingResult().append(" Failed *\n\n");
62 | Common.getFlashingResult().append("** Flashing Failed *");
63 | }
64 | Utils.runCommand(CLEANING_COMMAND);
65 | }
66 |
67 | public static void flashModule(File file, Activity activity) {
68 | new AsyncTasks() {
69 |
70 | @Override
71 | public void onPreExecute() {
72 | Common.setZipName(file.getName());
73 | Common.getFlashingResult().setLength(0);
74 | Common.getFlashingOutput().clear();
75 | Common.isFlashing(true);
76 | Intent flashing = new Intent(activity, FlashingActivity.class);
77 | activity.startActivity(flashing);
78 | }
79 |
80 | @Override
81 | public void doInBackground() {
82 | Common.getFlashingResult().append("** Preparing to flash ").append(file.getName()).append("...\n\n");
83 | Common.getFlashingResult().append("** Path: '").append(file).append("'\n\n");
84 | // Delete if an old zip file exists
85 | Utils.delete(activity.getCacheDir() + "/flash.zip");
86 | Common.getFlashingResult().append("** Copying '").append(file.getName()).append("' into temporary folder: ");
87 | Common.getFlashingResult().append(Utils.runAndGetError("cp '" + file + "' " + activity.getCacheDir() + "/flash.zip"));
88 | Common.getFlashingResult().append(Utils.exist(activity.getCacheDir() + "/flash.zip") ? "Done *\n\n" : "\n\n");
89 | flashModule(activity);
90 | }
91 |
92 | @Override
93 | public void onPostExecute() {
94 | Utils.delete(activity.getCacheDir() + "/flash.zip");
95 | Common.isFlashing(false);
96 | }
97 | }.execute();
98 | }
99 |
100 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/utils/PagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.utils;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.fragment.app.Fragment;
5 | import androidx.fragment.app.FragmentManager;
6 | import androidx.fragment.app.FragmentPagerAdapter;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /*
12 | * Created by sunilpaulmathew on October 11, 2020
13 | */
14 |
15 | public class PagerAdapter extends FragmentPagerAdapter {
16 |
17 | private final List fragmentList = new ArrayList<>();
18 | private final List fragmentListTitles = new ArrayList<>();
19 |
20 | public PagerAdapter(FragmentManager fm) {
21 | super(fm);
22 | }
23 |
24 | @NonNull
25 | @Override
26 | public Fragment getItem(int position) {
27 | return fragmentList.get(position);
28 | }
29 |
30 | @Override
31 | public int getCount() {
32 | return fragmentListTitles.size();
33 | }
34 |
35 | @Override
36 | public CharSequence getPageTitle(int position) {
37 | return fragmentListTitles.get(position);
38 | }
39 | public void AddFragment(Fragment fragment, String title) {
40 | fragmentList.add(fragment);
41 | fragmentListTitles.add(title);
42 | }
43 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nfs/nfsmanager/utils/SerializableItems.java:
--------------------------------------------------------------------------------
1 | package com.nfs.nfsmanager.utils;
2 |
3 | import android.graphics.drawable.Drawable;
4 |
5 | import java.io.Serializable;
6 |
7 | /*
8 | * Created by sunilpaulmathew on March 24, 2022
9 | */
10 | public class SerializableItems implements Serializable {
11 |
12 | private final Drawable mIcon;
13 | private final String mTitle;
14 | private final String mDescription;
15 | private final String mURL;
16 |
17 | public SerializableItems(String title, String description, Drawable icon, String url) {
18 | this.mTitle = title;
19 | this.mDescription = description;
20 | this.mIcon = icon;
21 | this.mURL = url;
22 | }
23 |
24 | public String getTitle() {
25 | return mTitle;
26 | }
27 |
28 | public String getDescription() {
29 | return mDescription;
30 | }
31 |
32 | public Drawable getIcon() {
33 | return mIcon;
34 | }
35 |
36 | public String getURL() {
37 | return mURL;
38 | }
39 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_active.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_back.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_battery.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_brazil.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bug.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_contributors.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_dashboard.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_developer.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/drawable/ic_developer.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_device.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_donate.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_france.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_germany.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_github.xml:
--------------------------------------------------------------------------------
1 |
4 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_grarak.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/drawable/ic_grarak.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_help.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_indonesia.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_info.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_italy.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_licence.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_nfs.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/drawable/ic_nfs.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_path.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_playstore.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_privacy.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_russia.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_save.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings_nfs.xml:
--------------------------------------------------------------------------------
1 |
4 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_support.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_topjohnwu.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/drawable/ic_topjohnwu.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_update.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_applymode.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
21 |
22 |
32 |
33 |
43 |
44 |
45 |
49 |
50 |
57 |
58 |
59 |
60 |
73 |
74 |
84 |
85 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_changelog.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
25 |
26 |
36 |
37 |
38 |
46 |
47 |
53 |
54 |
63 |
64 |
69 |
70 |
75 |
76 |
80 |
81 |
90 |
91 |
92 |
93 |
94 |
95 |
107 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_cputimes.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
14 |
15 |
24 |
25 |
36 |
37 |
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_credits.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
18 |
19 |
28 |
29 |
39 |
40 |
41 |
46 |
47 |
51 |
52 |
58 |
59 |
64 |
65 |
73 |
74 |
82 |
83 |
90 |
91 |
92 |
93 |
103 |
104 |
105 |
106 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_device.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
23 |
24 |
34 |
35 |
36 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_flashing.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
17 |
18 |
26 |
27 |
38 |
39 |
49 |
50 |
51 |
57 |
58 |
65 |
66 |
67 |
68 |
77 |
78 |
85 |
86 |
95 |
96 |
97 |
98 |
109 |
110 |
119 |
120 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_licence.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
26 |
27 |
37 |
38 |
39 |
47 |
48 |
52 |
53 |
54 |
66 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
17 |
18 |
25 |
26 |
27 |
28 |
29 |
34 |
35 |
36 |
37 |
42 |
43 |
53 |
54 |
62 |
63 |
72 |
73 |
74 |
80 |
81 |
93 |
94 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_start.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_tablayout.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
19 |
20 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/checkbox_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_cputime.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_dashboard.xml:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_log_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
19 |
20 |
29 |
30 |
31 |
32 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_nfs_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_about.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
17 |
25 |
26 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_module_status.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
19 |
20 |
26 |
27 |
35 |
36 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_support_status.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
17 |
18 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/progress_view_layout.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
17 |
18 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycle_view_about.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
18 |
19 |
28 |
29 |
37 |
38 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycle_view_cputimes.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
23 |
24 |
35 |
36 |
47 |
48 |
49 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycle_view_credits.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
16 |
17 |
26 |
27 |
35 |
36 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycle_view_nfsinfo.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycle_view_nfsmode.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycle_view_nfssettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
20 |
21 |
26 |
27 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/bottom_navigation.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values-de/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Über
4 | Analytik/Werbung blockieren
5 | Immer sichtbar
6 | Ausgeglichen
7 | Bootloader
8 | Abbrechen
9 | ©NFS-Team
10 | Benutzerdefiniert
11 | Der NFS-Datenordner wurde entfernt! Die Funktionen der Anwendung sind nach einem Neustart wieder verfügbar.
12 | Löschen
13 | Bitte beachten Sie:: Der NFS-Manager funktioniert nach dem Löschen des Datenordners bis zum nächsten Neustart nicht ordnungsgemäß!
14 | Möchten Sie den NFS-Datenordner wirklich löschen?
15 | Gerätestandard
16 | Deaktivieren
17 | Deaktiviert
18 | DNS-Modus
19 | DNS Cloudflare
20 | DNS Google
21 | Der Download ist fehlgeschlagen oder die heruntergeladene Datei ist beschädigt! Abbruch.
22 | %s wird heruntergeladen
23 | Dösen
24 | Benutzerdefiniert
25 | Standard
26 | Erzwingen
27 | Aktivieren
28 | Enforcing
29 | Standard
30 | Blockieren
31 | Nicht blockieren
32 | Die Logdatei wurde erfolgreich nach \'%s\' exportiert. Möchten Sie die Datei teilen?
33 | Exportieren der Logdatei als \'%s\'
34 | Installieren
35 | installiere %s
36 | NFS installieren
37 | Gaming
38 | Verstehe
39 | Verstanden
40 | CPU-Governor
41 | Sie haben eine ungültige Moduldatei ausgewählt! Abbruch.
42 | Magisk-Logdatei
43 | Mehr vom Entwickler
44 | Moduleinstellungen
45 | Der NFS-Injector ist %s!
46 | NFS-Injector %s
47 | Möglicherweise in Konflikt stehende Programme gefunden!
48 | Es wird empfohlen, die folgenden Anwendungen / Module nicht zusammen mit dem NFS Injector zu verwenden, um Konflikte zu vermeiden!\n\n
49 | Datenordner löschen
50 | NFS-Injector deaktivieren
51 | NFS-Logdatei
52 | NFS-Injector entfernen
53 | Logdatei anzeigen
54 | OverWatch-Engine
55 | Bitte überprüfen Sie Ihre Internetverbindung!
56 | Magisk nicht installiert
57 | Normal
58 | Keine Root-Rechte
59 | Auf Ihrem Gerät scheint NFS nicht installiert zu sein. Diese Anwendung funktioniert nur auf Ihrem Gerät, wenn Sie das NFS Injector-Modul installieren.
60 | Der CPU Governor "Performance" wird von NFS-Injector nicht unterstützt!\nVerwendung auf eigenes Risiko!
61 | Zulässig
62 | Zum Beenden erneut drücken
63 | Neustart
64 | Ein Neustart ist erforderlich, um die vorgenommenen Änderungen anzuwenden. Möchten Sie jetzt neu starten?
65 | Neustart erforderlich!
66 | Neustart
67 | Recovery
68 | gelöscht
69 | I/O-Scheduler
70 | SELinux
71 | Teilen
72 | %s Geteilt von NFS Manager
73 | Teilen mit
74 | NFS nicht gestartet!
75 | NFS wurde noch nicht gestartet! Bitte öffnen Sie diese App nach einigen Sekunden erneut!
76 | Supersampling
77 | Bist du sicher?
78 | FSync
79 | TCP-Algorithmus
80 | Wärmeregulierung
81 | Aus
82 | Ok
83 | An
84 | Netzwerkschutz
85 | %s installieren?
86 | Ultra
87 | NFS Manager %s verfügbar!
88 | Update suchen
89 | Glückwunsch! Sie sind auf dem neuesten Stand!
90 | Warnung
91 |
--------------------------------------------------------------------------------
/app/src/main/res/values-fr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | À propos de
5 | Désactivateur Analytics /Ads
6 | Montre toujours
7 | Équilibré
8 | Bootloader
9 | Annuler
10 | ©Équipe NFS
11 | NFS personnalisé
12 | Le dossier de données NFS est supprimé! Les fonctionnalités de cette application seront de retour après un redémarrage.
13 | Supprimer
14 | Notez s\'il vous plaît : NFS Manager ne fonctionnera pas correctement après la suppression du dossier de données jusqu\'au prochain redémarrage!
15 | Voulez-vous vraiment supprimer le dossier de données NFS?
16 | Dispositif par défaut
17 | Désactiver
18 | désactivée
19 | DNS Mode
20 | DNS Cloudflare
21 | DNS Google
22 | Il semble que le téléchargement ait échoué ou qu\'un fichier corrompu soit téléchargé! Abandon.
23 | Téléchargement de %s
24 | Doze
25 | Doze personnalisé
26 | Doze Stock
27 | Doze Forcé
28 | Activer
29 | enforcing
30 | Exécuter - Par défaut
31 | Exécuter - Désactiver
32 | Ne pas exécuter
33 | Le fichier log a été correctement exporté dans \'%s\'. Voulez-vous le partager?
34 | Exportation du log en tant que \'%s\'
35 | Flash
36 | flashage%s
37 | Flash NFS
38 | Gaming
39 | Tu piges
40 | Je l\'ai
41 | Gouverneur CPU
42 | Vous avez sélectionné un fichier de module non valide! Abandon.
43 | log de magisk
44 | à propos du développeur
45 | Paramètres du module
46 | NFS Injector est %s!
47 | NFS Injector %s
48 | Programmes potentiellement conflictuels trouvés!
49 | Il est fortement recommandé d\'éviter d\'utiliser les applications modules suivants avec NFS Injector pour éviter les conflits!\n\n
50 | Supprimer le dossier de données
51 | Désactiver NFS Injector
52 | log NFS
53 | Supprimer NFS Injector
54 | Regardes les logs
55 | Moteur OverWatch
56 | S\'il vous plait, vérifiez votre connexion internet!
57 | Magisk non installé
58 | Ordinaire
59 | Pas de root
60 | Votre appareil ne semble pas avoir NFS installé. Par conséquent, cette application ne fonctionne pas sur votre appareil, sauf si vous installez le module NFS.
61 | L\'utilisation du gouverneur \'performance\' est fortement déconseillée lorsque vous utilisez NFS Injector! Veuillez l\'utiliser à vos propres risques et aucune assistance ne sera fournie par l\'équipe NFS.
62 | Permissif
63 | Appuyez à nouveau pour quitter
64 | Redémarrer
65 | Un redémarrage est nécessaire pour que les modifications que vous avez apportées soient appliquées. Voulez-vous redémarrer maintenant?
66 | Redémarrage nécessaire!
67 | Redémarrage
68 | Récupération
69 | supprimé
70 | Planificateur d\'E /S
71 | SELinux
72 | Partager
73 | %s partagé par le gestionnaire NFS
74 | Partager avec
75 | NFS dort!
76 | NFS dort actuellement! Veuillez rouvrir cette application après une minute!
77 | Super Sampling
78 | Êtes-vous sûr?
79 | FSync
80 | Algorithme de congestion TCP
81 | Accélérateur thermique
82 | Désactiver
83 | D\'accord
84 | Activer
85 | Réseau de bouclier
86 | Flash %s?
87 | Ultra
88 | Mise ajour NFS Manager %s disponible!
89 | Vérification de mise à jour manuelle
90 | Félicitations! Vous êtes à jour!
91 | Attention
92 |
--------------------------------------------------------------------------------
/app/src/main/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Informazioni
4 | Analitiche/Pubblicità Disabilitate
5 | Mostra sempre
6 | Bilanciato
7 | Bootloader
8 | Annulla
9 | ©NFS Team
10 | Personalizzato da NFS
11 | La cartella NFS è stata rimossa! Le funzionalità di quest\'app torneranno dopo il riavvio.
12 | Elimina
13 | Nota: NFS Manager non funzionerà correttamente dopo aver eliminato la cartella dei dati fino al prossimo riavvio!
14 | Sei sicuro di voler eliminare la cartella NFS?
15 | Dispositivo predefinito
16 | Disabilita
17 | disabilitato
18 | Modalità del DNS
19 | DNS Cloudflare
20 | DNS Google
21 | Sembra che il download sia fallito, o che sia stato scaricato un file danneggiato! Interruzione.
22 | Scaricamento di %s
23 | Doze
24 | Doze personalizzato da NFS
25 | Doze predefinito
26 | Doze forzato
27 | Abilita
28 | Rafforzato
29 | Esegui - Predefinito
30 | Esegui - Disabilita
31 | Non eseguire
32 | Il file Log è stato esportato con successo in \'%s\'. Vuoi condividerlo?
33 | Il file Log è stato esportato in \'%s\'
34 | Installa
35 | Installazione di %s
36 | Installa NFS
37 | Gaming
38 | Ottieni
39 | Fatto
40 | CPU Governor
41 | Hai selezionato un modulo non valido! Interruzione.
42 | Log di Magisk
43 | Altro dagli sviluppatori
44 | Impostazioni del modulo
45 | NFS Injector è %s!
46 | NFS Injector %s
47 | Sono stati trovati dei programmi potenzialmente in conflitto!
48 | È altamente sconsigliato usare le seguenti app/moduli insieme a NFS Injector, potrebbero creare dei conflitti!\n\n
49 | Elimina la cartella dei dati
50 | Disabilita NFS Injector
51 | Log di NFS
52 | Rimuovi NFS Injector
53 | Guarda i log
54 | OverWatch Engine
55 | Per favore controlla la tua connessione ad internet!
56 | Magisk non è installato
57 | Normale
58 | Non hai i root
59 | Il tuo dispositivo non ha NFS installato. Di conseguenza quest\'app non funzionerà sul tuo dispositivo finché non installerai il modulo NFS injector.
60 | L\'uso di \'performance\' governor è altamente sconsigliato quando si utilizza NFS Injector!\nSi prega di utilizzarlo a proprio rischio e nessun supporto verrà fornito dal team NFS.
61 | Permissivo
62 | Premi di nuovo indietro per uscire
63 | Riavvia
64 | È richiesto un riavvio per applicare i cambiamenti effettuati. Vuoi riavviare adesso?
65 | Riavvio Richiesto!
66 | Riavvio
67 | Ripristino
68 | rimosso
69 | I/O Scheduler
70 | SELinux
71 | Condividi
72 | %s condiviso da NFS Manager
73 | Condividi con
74 | NFS sta dormendo!
75 | NFS sta dormendo! Per favore riapri quest\'app tra un minuto!
76 | Super Campionamento
77 | Sei sicuro?
78 | FSync
79 | TCP Algoritmo di Congestione
80 | Thermal Throttle
81 | Disattiva
82 | OK
83 | Attiva
84 | Rete protetta
85 | Installare %s?
86 | Ultra
87 | NFS Manager %s disponibile!
88 | Controllo manuale degli aggiornamenti
89 | Congratulazioni! Hai l\'ultimo aggiornamento!
90 | Avvertimento
91 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000000
4 | #52AAFF
5 | #26a69a
6 | #FFFFFF
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000000
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/provider_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/banner.png
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | google()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:7.3.1'
8 | }
9 | }
10 |
11 | allprojects {
12 | repositories {
13 | google()
14 | maven {
15 | url 'https://maven.wortise.com/artifactory/public'
16 | }
17 | maven {
18 | url "https://jitpack.io"
19 | }
20 | mavenCentral()
21 | }
22 | }
23 |
24 | task clean(type: Delete) {
25 | delete rootProject.buildDir
26 | }
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunilpaulmathew/NFSManager/b8cec6c1d26413b748c703350083da40183ed63f/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "NFS Manager"
--------------------------------------------------------------------------------