From d43689ba028fdcbd54ea75b3eec9a97dc43d3c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?AraafRoyall=20=E2=9D=82?= Date: Sun, 15 Oct 2023 23:35:58 +0530 Subject: [PATCH] Add files via upload --- .../lite/pro/CustomCleanerActivity.java | 1804 +++++++++ .../cleaner/lite/pro/CustomDirActivity.java | 1019 +++++ .../main/java/cleaner/lite/pro/FileUtil.java | 595 +++ .../java/cleaner/lite/pro/MainActivity.java | 3406 +++++++++++++++++ .../java/cleaner/lite/pro/OnetapActivity.java | 1319 +++++++ .../cleaner/lite/pro/PremiumActivity.java | 561 +++ .../cleaner/lite/pro/SettingsActivity.java | 559 +++ .../java/cleaner/lite/pro/SketchwareUtil.java | 207 + .../lite/pro/StorageusageActivity.java | 1091 ++++++ 9 files changed, 10561 insertions(+) create mode 100644 app/src/main/java/cleaner/lite/pro/CustomCleanerActivity.java create mode 100644 app/src/main/java/cleaner/lite/pro/CustomDirActivity.java create mode 100644 app/src/main/java/cleaner/lite/pro/FileUtil.java create mode 100644 app/src/main/java/cleaner/lite/pro/MainActivity.java create mode 100644 app/src/main/java/cleaner/lite/pro/OnetapActivity.java create mode 100644 app/src/main/java/cleaner/lite/pro/PremiumActivity.java create mode 100644 app/src/main/java/cleaner/lite/pro/SettingsActivity.java create mode 100644 app/src/main/java/cleaner/lite/pro/SketchwareUtil.java create mode 100644 app/src/main/java/cleaner/lite/pro/StorageusageActivity.java diff --git a/app/src/main/java/cleaner/lite/pro/CustomCleanerActivity.java b/app/src/main/java/cleaner/lite/pro/CustomCleanerActivity.java new file mode 100644 index 0000000..bbcc693 --- /dev/null +++ b/app/src/main/java/cleaner/lite/pro/CustomCleanerActivity.java @@ -0,0 +1,1804 @@ +package cleaner.lite.pro; + +import android.animation.*; +import android.app.*; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.app.Fragment; +import android.app.FragmentManager; +import android.content.*; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.*; +import android.graphics.*; +import android.graphics.drawable.*; +import android.media.*; +import android.net.*; +import android.net.Uri; +import android.os.*; +import android.os.Bundle; +import android.text.*; +import android.text.style.*; +import android.util.*; +import android.view.*; +import android.view.View; +import android.view.View.*; +import android.view.animation.*; +import android.webkit.*; +import android.widget.*; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.TextView; +import java.io.*; +import java.io.InputStream; +import java.text.*; +import java.util.*; +import java.util.regex.*; +import org.json.*; + +public class CustomCleanerActivity extends Activity { + + private String checkPrmemiumm = ""; + private String sspnd = ""; + private String PremiumCheck = ""; + private String variable = ""; + private String cmd = ""; + private String counter = ""; + + private ScrollView vscroll1; + private LinearLayout linear1; + private TextView textview4; + private LinearLayout linear5; + private LinearLayout linear6; + private LinearLayout linear13; + private TextView nouse; + private LinearLayout linear8; + private TextView textview5; + private LinearLayout linear9; + private LinearLayout linear10; + private LinearLayout linear12; + private LinearLayout layooo; + private TextView result; + private TextView cleardata; + private TextView cleanstatus; + private TextView sharedcleaner; + private TextView WhatsAppcleannnn; + private TextView splitclean; + private TextView textview7; + private TextView custompatch; + private TextView modifiedapp; + private TextView fix_tmp; + private TextView mount; + private TextView browser; + private TextView lostdircleaner; + private TextView selinux; + private TextView nomedia; + + private AlertDialog.Builder two; + private AlertDialog.Builder wac; + private AlertDialog.Builder n; + private AlertDialog.Builder soon; + private SharedPreferences set; + private AlertDialog.Builder enablefirst; + private SharedPreferences premium; + private AlertDialog.Builder prm; + private Intent i = new Intent(); + private AlertDialog.Builder d2; + private AlertDialog.Builder info; + private AlertDialog.Builder d1; + private AlertDialog.Builder error; + private AlertDialog.Builder Nomedia; + + @Override + protected void onCreate(Bundle _savedInstanceState) { + super.onCreate(_savedInstanceState); + setContentView(R.layout.custom_cleaner); + initialize(_savedInstanceState); + initializeLogic(); + } + + private void initialize(Bundle _savedInstanceState) { + vscroll1 = findViewById(R.id.vscroll1); + linear1 = findViewById(R.id.linear1); + textview4 = findViewById(R.id.textview4); + linear5 = findViewById(R.id.linear5); + linear6 = findViewById(R.id.linear6); + linear13 = findViewById(R.id.linear13); + nouse = findViewById(R.id.nouse); + linear8 = findViewById(R.id.linear8); + textview5 = findViewById(R.id.textview5); + linear9 = findViewById(R.id.linear9); + linear10 = findViewById(R.id.linear10); + linear12 = findViewById(R.id.linear12); + layooo = findViewById(R.id.layooo); + result = findViewById(R.id.result); + cleardata = findViewById(R.id.cleardata); + cleanstatus = findViewById(R.id.cleanstatus); + sharedcleaner = findViewById(R.id.sharedcleaner); + WhatsAppcleannnn = findViewById(R.id.WhatsAppcleannnn); + splitclean = findViewById(R.id.splitclean); + textview7 = findViewById(R.id.textview7); + custompatch = findViewById(R.id.custompatch); + modifiedapp = findViewById(R.id.modifiedapp); + fix_tmp = findViewById(R.id.fix_tmp); + mount = findViewById(R.id.mount); + browser = findViewById(R.id.browser); + lostdircleaner = findViewById(R.id.lostdircleaner); + selinux = findViewById(R.id.selinux); + nomedia = findViewById(R.id.nomedia); + two = new AlertDialog.Builder(this); + wac = new AlertDialog.Builder(this); + n = new AlertDialog.Builder(this); + soon = new AlertDialog.Builder(this); + set = getSharedPreferences("set", Activity.MODE_PRIVATE); + enablefirst = new AlertDialog.Builder(this); + premium = getSharedPreferences("premium", Activity.MODE_PRIVATE); + prm = new AlertDialog.Builder(this); + d2 = new AlertDialog.Builder(this); + info = new AlertDialog.Builder(this); + d1 = new AlertDialog.Builder(this); + error = new AlertDialog.Builder(this); + Nomedia = new AlertDialog.Builder(this); + + linear1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + linear8.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + cleardata.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if (set.getString("enable5", "").contains("whatsapp")) { + _whatsApp_clear_Data(); + } + else { + _enable_first(); + } + } + }); + + cleanstatus.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + two.setTitle("šŸ“ø š—Ŗš—µš—®š˜š˜€š—”š—½š—½ š—¦š˜š—®š˜š˜‚š˜€ š—–š—¹š—²š—®š—»š—²š—æ"); + two.setMessage("This will Clear all Viewed WhatsApp Status\n[ š‘°š’• š’˜š’Šš’š’ š’š’š’• š‘Øš’‡š’‡š’†š’„š’• š‘µš’†š’˜ š’š’“ š‘¼š’š’˜š’‚š’•š’„š’‰š’†š’… š‘ŗš’•š’‚š’•š’–š’” ]"); + two.setPositiveButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "# clear whatsapp status"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  š–š”ššš­š¬ššš©š© š’š­ššš­š®š¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(CustomCleanerActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + two.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + two.create().show(); + } + }); + + sharedcleaner.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + wac.setTitle("šŸ“³ š—Ŗš—µš—®š˜š˜€š—”š—½š—½ .š—¦š—µš—®š—暝—²š—± š—°š—¹š—²š—®š—»š—²š—æ"); + wac.setMessage("It will Delete All downloaded Media available in Whatsapp chats or groups and can't be undo.\n\n[ š‘»š’‰š’Šš’” š’˜š’Šš’š’ š’š’š’• š’…š’†š’š’†š’•š’† : š’Žš’†š’”š’”š’‚š’ˆš’†š’” & š‘³š’š’ˆš’Šš’ š’…š’‚š’•š’‚ ]"); + wac.setPositiveButton("ā© Next", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + two.setTitle("āš ļø š—Ŗš—®š—暝—»š—¶š—»š—“"); + two.setMessage("Are You shure to clear .shared folder in WhatsApp"); + two.setPositiveButton("šŸŒ€ CLEAR", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (premium.getString("purchased", "").equals("1")) { + try { + final String command = "# clear shared folder of whatsapp"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš”š‚š„šžššš§š¢š§š  š–š”ššš­š¬ššš©š© .š’š”ššš«šžš") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(CustomCleanerActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied or Premium Not Purchased or Not Verified") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + _require_premium(); + } + } + }); + two.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + two.create().show(); + } + }); + wac.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + wac.create().show(); + } + }); + + WhatsAppcleannnn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + n.setTitle("šŸŖ€ š™’š™š™–š™Øš™©š˜¼š™„š™„ š™’š™–š™Øš™©š™š Cleaner"); + n.setMessage("This Will clears Unwanted files in whatsapp.\n\n[ š‘µš’ š‘«š’‚š’•š’‚ š‘¾š’Šš’š’ š’ƒš’† š‘«š’†š’š’†š’•š’†š’… ]"); + n.setPositiveButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "# clean whatsapp unwanted files "; + + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  š–š”ššš­š¬š€š©š©") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(CustomCleanerActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + n.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + n.create().show(); + } + }); + + splitclean.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + two.setTitle("šŸ’« š’š©š„š¢š­ š’š­ššš­š®š¬ š‚š„šžššš§šžš«"); + two.setMessage("It cleans the large number of Split status created by WhatsApp Mods"); + two.setPositiveButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + + final String command = "# clean whatsapp mods splits"; + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  š’š©š„š¢š­ š’š­ššš­š®š¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Cleared Sucessfully"); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + if (result.getText().toString().contains("such")) { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Cleared Sucessfully"); + } + else { + _Error(); + } + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(CustomCleanerActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + two.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + two.create().show(); + } + }); + + custompatch.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸ§© š‚š®š¬š­šØš¦ šššš­šœš”šžš¬ Cleaner"); + d2.setMessage("It Will Clear All Custom Patches Downloaded in Lucky Patcher App"); + d2.setPositiveButton("šŸš€ Clean", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (premium.getString("purchased", "").equals("1")) { + try { + final String command = "# clean lucky patcher patches"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš”š‚š„šžššš§š¢š§š  š‚š®š¬š­šØš¦ šššš­šœš”") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(CustomCleanerActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + _require_premium(); + } + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + + modifiedapp.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("ā›“ļø š— š—¼š—±š—¶š—³š—¶š—²š—± š—”š—½š—½š˜€ Cleaner"); + d2.setMessage("It Will Clear All Modified,Patched apps by lucky patcher"); + d2.setPositiveButton("šŸš€ Clean", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (premium.getString("purchased", "").equals("1")) { + try { + final String command = "# clean whatsapp modified apps"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  šŒšØšš¢šŸš¢šžš š€š©š©š¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(CustomCleanerActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + _require_premium(); + } + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + + fix_tmp.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸ“ š…š¢š± /šššš­šš/š„šØšœššš„/š­š¦š©"); + d2.setMessage("This folder Used by many App/ADB For temporary work"); + d2.setPositiveButton("ā„ļø š—™š—¶š˜…", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + + final String command = "\ndir_path=\"/data/local/tmp\"\n\nif [ -d \"$dir_path\" ]; then\n echo \"The directory already exists.\"\n rm -rf /data/local/tmp/*\nelse\n mkdir -p \"$dir_path\"\n echo \"Directory created successfully.\"\nfi"; + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š…š¢š±š¢š§š  /šššš­šš/š„šØšœššš„/š­š¦š©") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (result.getText().toString().contains("The directory already exists")) { + d1.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + d1.setMessage("The Directory is Already Fixed"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + if (result.getText().toString().contains("Directory created successfully")) { + d1.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + d1.setMessage("Fixed /data/local/tmp"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("Something went wrong or Root permission Denied"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(CustomCleanerActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + + mount.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸ“‚ šŒšØš®š§š­ /šššš­šš"); + d2.setMessage("If you think some features not working than you may use this"); + d2.setPositiveButton("šŸ§© š‘“š’š’–š’š’•", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "mount -o rw,remount /data"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š— š—¼š˜‚š—»š˜š—¶š—»š—“ /š—±š—®š˜š—®") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(CustomCleanerActivity.this, "āœ… Mounted /data Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + + browser.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸŒŽ šš«šØš°š¬šžš« šŒšžš­š«š¢šœš¬ š‚š„šžššš§"); + d2.setMessage("It seems a 4MB file in almost every App found in /data/data/PKG/app_webview/BrowserMetrics-spare.pma\nIt Related to something Called Webview Cache or File \nYou can clean if you know this"); + d2.setPositiveButton("šŸš€ Clean", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + + final String command = "# clean browser matrics data"; + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” šš«šØš°š¬šžš« šŒšžš­š«š¢šœš¬ š‚š„šžššš§") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + SketchwareUtil.showMessage(getApplicationContext(), "āœ… Sucessfully Deleted"); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + _Error(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(CustomCleanerActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + + lostdircleaner.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸ“« š‹šŽš’š“.šƒšˆš‘ š‚š„šžššš§šžš«"); + d2.setMessage("Clears All LOST.DIR Files and Folder from Device including SD Card"); + d2.setPositiveButton("šŸ›ø Clean", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "# lostdir clean"; + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š‹šŽš’š“.šƒšˆš‘ š‚š„šžššš§š¢š§š ") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Cleared Sucessfully"); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(CustomCleanerActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + + selinux.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + try { + + final String command = "getenforce"; + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š—¦š—˜ š—Ÿš—¶š—»š˜‚š˜…") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + d2.setTitle("šŸ”© š—¦š—˜ š—Ÿš—¶š—»š˜‚š˜…"); + d2.setMessage("Current Mode : ".concat(result.getText().toString())); + d2.setPositiveButton("ā­• š’šžš­ ššžš«š¦š¢š¬š¬š¢šÆšž", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "setenforce 0"; + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š’š°š¢š­šœš”š¢š§š  š’š„š‹š¢š§š®š± šŒšØššž") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“ƒ Changed to Permissive Mode"); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(CustomCleanerActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.setNegativeButton("ā­• š’šžš­ š„š§šŸšØš«šœšž", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "setenforce 1"; + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š’š°š¢š­šœš”š¢š§š  š’š„š‹š¢š§š®š± šŒšØššž") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“ƒ Changed to Enforcing Mode"); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(CustomCleanerActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.create().show(); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + _Error(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(CustomCleanerActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + nomedia.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + Nomedia.setTitle("šŸŽ›ļø .ššØš¦šžšš¢šš š‚š„šžššš§šžš«"); + Nomedia.setMessage("Clears All .Nomedia Files From Internal Storage"); + final CheckBox nomed = new CheckBox(CustomCleanerActivity.this); + nomed.setText("Clean Globally From '/data'"); + LinearLayout.LayoutParams lpar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); + nomed.setLayoutParams(lpar); + Nomedia.setView(nomed); + Nomedia.setPositiveButton("šŸ›ø Clean", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if + ((nomed.isChecked())){ + + cmd = "# clean . nomedia"; + } + else + { + cmd = "# clean . nomedia globally"; + + } + _NoMediaClean(); + } + }); + Nomedia.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + Nomedia.create().show(); + } + }); + } + + private void initializeLogic() { + setTitle("šŸ§© š—–š—¹š—²š—®š—»š—²š—æ š—§š—¼š—¼š—¹š—Æš—¼š˜…"); + if (set.getString("theme", "").equals("1")) { + _color1(); + } + else { + _color2(); + } + } + + @Override + public void onBackPressed() { + finish(); + } + + @Override + protected void onPostCreate(Bundle _savedInstanceState) { + super.onPostCreate(_savedInstanceState); + PremiumCheck = "# check premium version"; + if (premium.getString("#", "").equals("1")) { + sspnd = "# check root acess"; + } + else { + sspnd = "# check app functioning"; + } + } + public void _whatsappclean() { + + } + + + public void _color1() { + cleardata.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + cleanstatus.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + sharedcleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + WhatsAppcleannnn.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + custompatch.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + modifiedapp.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + fix_tmp.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + lostdircleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + selinux.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + splitclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + nomedia.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + browser.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + mount.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + } + + + public void _comingsoon() { + soon.setTitle("šŸ‘Øā€šŸ’» š—–š—¼š—ŗš—¶š—»š—“ š—¦š—¼š—¼š—» ..."); + soon.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + soon.create().show(); + } + + + public void _whatsApp_clear_Data() { + n.setTitle("šŸŖ€ š—Ŗš—µš—®š˜š˜€š—”š—½š—½ : š—–š—¹š—²š—®š—æ š——š—®š˜š—®"); + n.setMessage("This Will Clear All WhatsApp Data\n\n[ š‘·š’“š’š’„š’†š’†š’… š‘¾š’Šš’•š’‰ š‘Ŗš’‚š’–š’•š’Šš’š’ ]"); + n.setPositiveButton("ā© Next", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + wac.setTitle("āš ļø š—Ŗš—®š—暝—»š—¶š—»š—“"); + wac.setMessage("This Will Clear All WhatsApp Data"); + wac.setPositiveButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "pm clear com.whatsapp"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  š–š”ššš­š¬ššš©š© šššš­šš") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(CustomCleanerActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + wac.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + wac.create().show(); + } + }); + n.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + n.create().show(); + } + + + public void _enable_first() { + enablefirst.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + enablefirst.setMessage(" š‘¬š’š’‚š’ƒš’š’† š’•š’‰š’Šš’” š’š’‘š’•š’Šš’š’ š’‡š’“š’š’Ž š’”š’†š’•š’•š’Šš’š’ˆš’”"); + enablefirst.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + enablefirst.create().show(); + } + + + public void _require_premium() { + prm.setTitle("šŸ§© š—„š—²š—¾š˜‚š—¶š—暝—² š—£š—暝—²š—ŗš—¶š˜‚š—ŗ"); + prm.setMessage("This is a premium feature \nPurchase premium to use "); + prm.setPositiveButton("šŸ›ø š†šžš­ šš«šžš¦š¢š®š¦", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + i.setAction(Intent.ACTION_VIEW); + i.setClass(getApplicationContext(), PremiumActivity.class); + startActivity(i); + } + }); + prm.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + prm.create().show(); + } + + + public void _Error() { + error.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + error.setMessage("Something went Wrong OR\n Root permission Denied"); + error.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + error.create().show(); + } + + + public void _color2() { + if (set.getString("stroke", "").equals("1")) { + _Themer(cleardata); + _Themer(cleanstatus); + _Themer(sharedcleaner); + _Themer(WhatsAppcleannnn); + _Themer(splitclean); + _Themer(custompatch); + _Themer(modifiedapp); + _Themer(fix_tmp); + _Themer(lostdircleaner); + _Themer(selinux); + _Themer(nomedia); + _Themer(browser); + _Themer(mount); + } + else { + cleardata.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + cleanstatus.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + sharedcleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + WhatsAppcleannnn.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + splitclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + custompatch.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + modifiedapp.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + fix_tmp.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + lostdircleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + selinux.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + nomedia.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + browser.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + mount.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + } + } + + + public void _NoMediaClean() { + try { + + final String command = "# pick command for cleaning from cmd"; + + final AlertDialog alertDialog = new AlertDialog.Builder(CustomCleanerActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  .š§šØš¦šžšš¢šš š…š¢š„šžš¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (set.getString("nomediaoutput", "").equals("1")) { + if (result.getText().toString().contains(".nomedia")) { + d1.setTitle("šŸ“ š—–š—¹š—²š—®š—暝—²š—± .š—”š—¼š—ŗš—²š—±š—¶š—® š—™š—¶š—¹š—²š˜€"); + d1.setMessage("š‘»š’š’•š’‚š’ š’…š’†š’š’†š’•š’†š’… : ".concat(counter.concat("\n\n")).concat(variable)); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + variable = ""; + } + else { + d1.setTitle("šŸ“ š—–š—¹š—²š—®š—暝—²š—± .š—”š—¼š—ŗš—²š—±š—¶š—® š—™š—¶š—¹š—²š˜€"); + d1.setMessage("All such files are already cleared"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + result.setText(""); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Cleared Sucessfully"); + result.setText(""); + } + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + _Error(); + result.setText(""); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(CustomCleanerActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _Themer(final View _view) { + _view.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFDD2C00, 0xFF69F0AE)); + } + + + @Deprecated + public void showMessage(String _s) { + Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show(); + } + + @Deprecated + public int getLocationX(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[0]; + } + + @Deprecated + public int getLocationY(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[1]; + } + + @Deprecated + public int getRandom(int _min, int _max) { + Random random = new Random(); + return random.nextInt(_max - _min + 1) + _min; + } + + @Deprecated + public ArrayList getCheckedItemPositionsToArray(ListView _list) { + ArrayList _result = new ArrayList(); + SparseBooleanArray _arr = _list.getCheckedItemPositions(); + for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) { + if (_arr.valueAt(_iIdx)) + _result.add((double)_arr.keyAt(_iIdx)); + } + return _result; + } + + @Deprecated + public float getDip(int _input) { + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, getResources().getDisplayMetrics()); + } + + @Deprecated + public int getDisplayWidthPixels() { + return getResources().getDisplayMetrics().widthPixels; + } + + @Deprecated + public int getDisplayHeightPixels() { + return getResources().getDisplayMetrics().heightPixels; + } +} \ No newline at end of file diff --git a/app/src/main/java/cleaner/lite/pro/CustomDirActivity.java b/app/src/main/java/cleaner/lite/pro/CustomDirActivity.java new file mode 100644 index 0000000..6a6be3c --- /dev/null +++ b/app/src/main/java/cleaner/lite/pro/CustomDirActivity.java @@ -0,0 +1,1019 @@ +package cleaner.lite.pro; + +import android.animation.*; +import android.app.*; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.app.Fragment; +import android.app.FragmentManager; +import android.content.*; +import android.content.ClipData; +import android.content.ClipboardManager; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.*; +import android.graphics.*; +import android.graphics.drawable.*; +import android.media.*; +import android.net.*; +import android.os.*; +import android.text.*; +import android.text.Editable; +import android.text.TextWatcher; +import android.text.style.*; +import android.util.*; +import android.view.*; +import android.view.View; +import android.view.View.*; +import android.view.animation.*; +import android.webkit.*; +import android.widget.*; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.CompoundButton; +import android.widget.EditText; +import android.widget.HorizontalScrollView; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.Switch; +import android.widget.TextView; +import java.io.*; +import java.text.*; +import java.util.*; +import java.util.Timer; +import java.util.TimerTask; +import java.util.regex.*; +import org.json.*; + +public class CustomDirActivity extends Activity { + + private Timer _timer = new Timer(); + + private String decrypted = ""; + private double Variable = 0; + private String variable = ""; + private String Info = ""; + + private ScrollView vscroll1; + private LinearLayout linear3; + private HorizontalScrollView hscroll3; + private LinearLayout linear8; + private TextView info; + private ScrollView vscroll3; + private LinearLayout linear4; + private Switch cust_enable; + private TextView help; + private Button checklist; + private TextView textview2; + private TextView textview3; + private HorizontalScrollView hscroll7; + private TextView paste; + private Button Modify; + private EditText customdirrr; + private LinearLayout linear9; + private TextView template; + private CheckBox subtitle; + private CheckBox alarm; + private CheckBox music; + private CheckBox movies; + private CheckBox notificaton; + private CheckBox audiobooks; + private CheckBox ringtone; + private CheckBox lostdir; + private CheckBox ramdump; + private CheckBox browser; + private CheckBox miuiGallerydlt; + private CheckBox documentsn; + + private SharedPreferences dir; + private AlertDialog.Builder Dir; + private AlertDialog.Builder d1; + private AlertDialog.Builder d2; + private AlertDialog.Builder d3; + private AlertDialog.Builder soon; + private AlertDialog.Builder d2_1; + private TimerTask t; + private SharedPreferences set; + private TimerTask infoo; + private AlertDialog.Builder cust; + private AlertDialog.Builder br; + private AlertDialog.Builder restore; + private TimerTask restored; + + @Override + protected void onCreate(Bundle _savedInstanceState) { + super.onCreate(_savedInstanceState); + setContentView(R.layout.custom_dir); + initialize(_savedInstanceState); + initializeLogic(); + } + + private void initialize(Bundle _savedInstanceState) { + vscroll1 = findViewById(R.id.vscroll1); + linear3 = findViewById(R.id.linear3); + hscroll3 = findViewById(R.id.hscroll3); + linear8 = findViewById(R.id.linear8); + info = findViewById(R.id.info); + vscroll3 = findViewById(R.id.vscroll3); + linear4 = findViewById(R.id.linear4); + cust_enable = findViewById(R.id.cust_enable); + help = findViewById(R.id.help); + checklist = findViewById(R.id.checklist); + textview2 = findViewById(R.id.textview2); + textview3 = findViewById(R.id.textview3); + hscroll7 = findViewById(R.id.hscroll7); + paste = findViewById(R.id.paste); + Modify = findViewById(R.id.Modify); + customdirrr = findViewById(R.id.customdirrr); + linear9 = findViewById(R.id.linear9); + template = findViewById(R.id.template); + subtitle = findViewById(R.id.subtitle); + alarm = findViewById(R.id.alarm); + music = findViewById(R.id.music); + movies = findViewById(R.id.movies); + notificaton = findViewById(R.id.notificaton); + audiobooks = findViewById(R.id.audiobooks); + ringtone = findViewById(R.id.ringtone); + lostdir = findViewById(R.id.lostdir); + ramdump = findViewById(R.id.ramdump); + browser = findViewById(R.id.browser); + miuiGallerydlt = findViewById(R.id.miuiGallerydlt); + documentsn = findViewById(R.id.documentsn); + dir = getSharedPreferences("dir", Activity.MODE_PRIVATE); + Dir = new AlertDialog.Builder(this); + d1 = new AlertDialog.Builder(this); + d2 = new AlertDialog.Builder(this); + d3 = new AlertDialog.Builder(this); + soon = new AlertDialog.Builder(this); + d2_1 = new AlertDialog.Builder(this); + set = getSharedPreferences("set", Activity.MODE_PRIVATE); + cust = new AlertDialog.Builder(this); + br = new AlertDialog.Builder(this); + restore = new AlertDialog.Builder(this); + + info.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View _view) { + d1.setTitle("šŸŖ§ š—›š—¶š—±š—² š—§š—µš—¶š˜€ š—›š—¶š—»š˜"); + d1.setMessage("It will not shown Next Time When you open Custom Cleaner"); + d1.setPositiveButton("āœ³ļø Hide", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + set.edit().putString("cst hide", "1").commit(); + info.setVisibility(View.GONE); + } + }); + d1.create().show(); + return true; + } + }); + + info.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + cust_enable.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + Variable = 0; + if (!cust_enable.isChecked()) { + set.edit().remove("cda").commit(); + } + else { + cust_enable.setChecked(false); + _advanceMode(); + } + } + }); + + cust_enable.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + cust_enable.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)20, 0xFF69F0AE)); + } + else { + cust_enable.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)20, 0xFFFF80AB)); + } + } + }); + + help.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸ“œ š—–š˜‚š˜€š˜š—¼š—ŗ š——š—¶š—暝—²š—°š˜š—¼š—暝˜† Help"); + d2.setMessage("ā€¢ Enter The Directory which you wish to add in Custom cleaner \nā€¢ Now supports /data directories , use Advance Mode\nā€¢ There is š‘µš’ š’š’Šš’Žš’Šš’• for Custom directories \nā€¢ These custom directories will be cleared everytime when you use Custom Cleaner\nā€¢ This feature is also useful when some folder or files automatically created on internal storage \nā€¢ You can Also use '*' (star) for subdirectories within a directory\nā€¢ For Multi-User (use /data/media/USER/PATH)"); + d2.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.setNegativeButton("šŸ“³ Known Bugs", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + d1.setTitle("šŸ“³ šŠš§šØš°š§ šš®š š¬ š¢š§ šœš®š¬š­šØš¦ šœš„šžššš§šžš«"); + d1.setMessage("šŸ”¹Removing a directory may cause error due to multiple subdirectories name matching"); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + d2.create().show(); + } + }); + + checklist.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View _view) { + + return true; + } + }); + + checklist.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if (dir.getString("custdir", "").length() > 5) { + d3.setTitle("šŸ“œ š‚š®š¬š­šØš¦ šƒš¢š«šžšœš­šØš«š² š‹š¢š¬š­"); + d3.setMessage(dir.getString("custdir", "").replace(" ", "\n")); + d3.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d3.setNeutralButton("āŽ Delete All", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + d2_1.setTitle("āš ļø š—Ŗš—®š—暝—»š—¶š—»š—“"); + d2_1.setMessage("This Will Clear All Custom Directories saved by you "); + d2_1.setPositiveButton("ā›” Delete", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + dir.edit().remove("custdir").commit(); + _Delete_All(); + SketchwareUtil.showMessage(getApplicationContext(), "ā— All Directories are Deleted"); + } + }); + d2_1.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2_1.create().show(); + } + }); + d3.create().show(); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ The Custom Directory List is Empty"); + } + } + }); + + textview2.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + br.setTitle("šŸ”® ššššœš¤š®š© š‚š®š¬š­šØš¦ šƒš¢š«šžšœš­šØš«š¢šžš¬"); + br.setMessage("You Can Backup Directories on Clipboard to Paste or Upload on Cloud"); + br.setPositiveButton("šŸ“‹ š‘©š’‚š’„š’Œš’–š’‘ š’•š’ š‘Ŗš’š’Šš’‘š’ƒš’š’‚š’“š’…", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (dir.getString("custdir", "").length() > 10) { + variable = "Do_not_modify_Anything_".concat(dir.getString("custdir", "").replace(" /storage/emulated/0/", "šŸš€")); + ((ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("clipboard", variable)); + if (String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).contains("Do_not_modify_Anything_")) { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“‹ Directory Backup copied to Clipboard"); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "āš ļø Something went wrong or Clipboard Permission denied"); + } + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "ā— Nothing to Backup Save Directories first"); + } + } + }); + br.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + br.create().show(); + } + }); + + textview3.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + restore.setTitle("šŸ”® š‘šžš¬š­šØš«šž š‚š®š¬š­šØš¦ šƒš¢š«šžšœš­šØš«š¢šžš¬"); + restore.setMessage("ā€¢ You Can Restore Directories From a File or Clipboard"); + final EditText restoreDirs = new EditText(CustomDirActivity.this); + restoreDirs.setHint("Paste The backedUp Text to Restore"); + LinearLayout.LayoutParams lpar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); + restoreDirs.setLayoutParams(lpar); + restore.setView(restoreDirs); + restore.setPositiveButton("ā¬‡ļø š‘¹š’†š’”š’•š’š’“š’†", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + variable = restoreDirs.getText().toString(); + if (Info.equals("1")) { + d1.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + d1.setMessage("Restored Recently\nPlease Try After some time"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + else { + if (variable.contains("Do_not_modify_Anything_")) { + variable = variable.replace("šŸš€", " /storage/emulated/0/"); + variable = variable.replace("Do_not_modify_Anything_", ""); + dir.edit().putString("custdir", dir.getString("custdir", "").concat(variable)).commit(); + _checkbox_selector(); + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“‹ Restored directories from clipboard"); + Info = "1"; + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "ā— Paste Valid Backup Text to Restore"); + } + } + } + }); + restore.setNeutralButton("šŸ“‹ š‘¹š’†š’”š’•š’š’“š’† š’‡š’“š’š’Ž š‘Ŗš’š’Šš’‘š’ƒš’š’‚š’“š’…", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (Info.equals("1")) { + d1.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + d1.setMessage("Restored Recently\nPlease Try After some time"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + else { + if (String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).contains("Do_not_modify_Anything_")) { + variable = String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).replace("šŸš€", " /storage/emulated/0/"); + variable = variable.replace("Do_not_modify_Anything_", ""); + dir.edit().putString("custdir", dir.getString("custdir", "").concat(variable)).commit(); + _checkbox_selector(); + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“‹ Restored directories from clipboard"); + Info = "1"; + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "ā— Not A Valid Directory backup in clipboard"); + } + } + } + }); + restore.create().show(); + } + }); + + paste.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if ((String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).contains("/") && (String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).contains("sdcard") || String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).contains("emulated"))) && !(String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).contains("\n") || String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).contains(" "))) { + customdirrr.setText(String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText())); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "ā— Not a Valid Directory in Clipboard"); + } + } + }); + + Modify.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if (set.getString("cda", "").equals("1")) { + if (((customdirrr.getText().toString().contains("/data/") || customdirrr.getText().toString().contains("/sdcard/")) || customdirrr.getText().toString().contains("/storage/emulated/0/")) && !(customdirrr.getText().toString().contains("\n") || customdirrr.getText().toString().contains(" "))) { + if ((customdirrr.getText().toString().length() > 6) && !((customdirrr.getText().toString().equals("/data/") || customdirrr.getText().toString().equals("/sdcard/")) || customdirrr.getText().toString().equals("/storage/emulated/0/"))) { + _custom_directory(); + } + else { + d1.setTitle("āš ļø š—Ŗš—®š—暝—»š—¶š—»š—“"); + d1.setMessage("This Directory is Not Allowed "); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + } + else { + d1.setTitle("āš ļø š—Ŗš—®š—暝—»š—¶š—»š—“"); + d1.setMessage("Enter A valid Directory"); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + } + else { + if ((customdirrr.getText().toString().contains("/sdcard/") || customdirrr.getText().toString().contains("/storage/emulated/0/")) && !(customdirrr.getText().toString().contains("\n") || customdirrr.getText().toString().contains(" "))) { + if ((customdirrr.getText().toString().length() > 6) && !(customdirrr.getText().toString().equals("/sdcard/") || customdirrr.getText().toString().equals("/storage/emulated/0/"))) { + _custom_directory(); + } + else { + d1.setTitle("āš ļø š—Ŗš—®š—暝—»š—¶š—»š—“"); + d1.setMessage("This Directory is Not Allowed "); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + } + else { + d1.setTitle("āš ļø š—Ŗš—®š—暝—»š—¶š—»š—“"); + d1.setMessage("Enter A valid Directory"); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + } + } + }); + + customdirrr.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + customdirrr.addTextChangedListener(new TextWatcher() { + @Override + public void onTextChanged(CharSequence _param1, int _param2, int _param3, int _param4) { + final String _charSeq = _param1.toString(); + if (_charSeq.equals("/sdcard/") || (_charSeq.equals("/storage/emulated/0/") || (_charSeq.equals("/storage/emulated/0") || _charSeq.equals("/sdcard")))) { + customdirrr.setError("This directory not Allowed"); + } + if (_charSeq.equals("/sdcard/*") || _charSeq.equals("/storage/emulated/0/*")) { + customdirrr.setError("This directory not Allowed , It may cause delete of Complete Internal Storage "); + } + if (_charSeq.contains("/data/")) { + if (set.getString("cda", "").contains("1")) { + if (_charSeq.equals("/data/")) { + customdirrr.setError("This directory not Allowed"); + } + } + else { + customdirrr.setError("Enable Advance Mode To get '/data' Directory support"); + } + } + if (_charSeq.equals("/data")) { + customdirrr.setError("This directory not Allowed"); + } + if (_charSeq.contains(" ")) { + customdirrr.setError("Currently Space Containing directories is not supported"); + } + if (_charSeq.equals("/data/*")) { + customdirrr.setError("This is Not Allowed , It can cause unexpected wipe or erase of All your Device data"); + } + if (_charSeq.contains("\n")) { + customdirrr.setError("Currently does not support next line input"); + } + if (_charSeq.contains("**")) { + customdirrr.setError("Double star not allowed"); + } + } + + @Override + public void beforeTextChanged(CharSequence _param1, int _param2, int _param3, int _param4) { + + } + + @Override + public void afterTextChanged(Editable _param1) { + + } + }); + + subtitle.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + subtitle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/Subtitles")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/Subtitles"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/Subtitles"), "")).commit(); + } + } + }); + + alarm.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/Alarms")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/Alarms"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/Alarms"), "")).commit(); + } + } + }); + + music.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/Music")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/Music"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/Music"), "")).commit(); + } + } + }); + + movies.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/Movies")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/Movies"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/Movies"), "")).commit(); + } + } + }); + + notificaton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/Notifications")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/Notifications"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/Notifications"), "")).commit(); + } + } + }); + + audiobooks.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View _view) { + + return true; + } + }); + + audiobooks.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/Audiobooks")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/Audiobooks"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/Audiobooks"), "")).commit(); + } + } + }); + + ringtone.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/Ringtones")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/Ringtones"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/Ringtones"), "")).commit(); + } + } + }); + + lostdir.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/LOST.DIR")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/LOST.DIR"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/LOST.DIR"), "")).commit(); + } + } + }); + + ramdump.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/ramdump")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/ramdump"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/ramdump"), "")).commit(); + } + } + }); + + browser.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/browser")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/browser"))).commit(); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/browser"), "")).commit(); + } + } + }); + + miuiGallerydlt.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + miuiGallerydlt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/DCIM/.globalTrash")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/DCIM/.globalTrash"))).commit(); + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ Sensitive Directory added"); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/DCIM/.globalTrash"), "")).commit(); + } + } + }); + + documentsn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + if (dir.getString("custdir", "").contains("/storage/emulated/0/Documents")) { + + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat("/storage/emulated/0/Documents"))).commit(); + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ Sensitive Directory added"); + } + } + else { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat("/storage/emulated/0/Documents"), "")).commit(); + } + } + }); + } + + private void initializeLogic() { + _color1(); + if (set.getString("cda", "").equals("1")) { + cust_enable.setChecked(true); + } + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (dir.getString("onetimesetup", "").equals("1")) { + + } + else { + _agreement(); + } + } + }); + } + }; + _timer.schedule(t, (int)(500)); + } + + @Override + public void onBackPressed() { + finish(); + } + + @Override + protected void onPostCreate(Bundle _savedInstanceState) { + super.onPostCreate(_savedInstanceState); + setTitle("šŸ’» š—–š˜‚š˜€š˜š—¼š—ŗ š—–š—¹š—²š—®š—»š—²š—æ"); + _checkbox_selector(); + if (set.getString("cst hide", "").contains("1")) { + info.setVisibility(View.GONE); + } + } + + @Override + public void onDestroy() { + super.onDestroy(); + + } + public void _custom_directory() { + cust.setTitle("šŸ”° š—–š˜‚š˜€š˜š—¼š—ŗ š——š—¶š—暝—²š—°š˜š—¼š—暝˜† "); + cust.setMessage("Select Option For your Directory :\n".concat(customdirrr.getText().toString())); + cust.setPositiveButton("šŸ”¹ Add", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (!dir.getString("custdir", "").contains(customdirrr.getText().toString())) { + dir.edit().putString("custdir", dir.getString("custdir", "").concat(" ".concat(customdirrr.getText().toString()))).commit(); + SketchwareUtil.showMessage(getApplicationContext(), "āœ… Successfully Added"); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ This Directly is Already Added"); + } + } + }); + cust.setNeutralButton("šŸ”ø Remove", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (dir.getString("custdir", "").contains(customdirrr.getText().toString())) { + dir.edit().putString("custdir", dir.getString("custdir", "").replaceFirst(" ".concat(customdirrr.getText().toString()), "")).commit(); + SketchwareUtil.showMessage(getApplicationContext(), "āœ… Successfully Removed"); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ This Directly is not found"); + } + } + }); + cust.create().show(); + } + + + public void _comingsoon() { + soon.setTitle("šŸ‘Øā€šŸ’» š—–š—¼š—ŗš—¶š—»š—“ š—¦š—¼š—¼š—» ..."); + soon.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + soon.create().show(); + } + + + public void _agreement() { + + } + + + public void _color1() { + Modify.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)20, 0xFFFFFF00)); + checklist.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)20, 0xFFFFFF8D)); + if (set.getString("cda", "").equals("1")) { + cust_enable.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)20, 0xFF009688)); + } + else { + cust_enable.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)20, 0xFFFF80AB)); + } + } + + + public void _checkbox_selector() { + if (dir.getString("custdir", "").contains("/storage/emulated/0/Subtitles")) { + subtitle.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/DCIM/.globalTrash")) { + miuiGallerydlt.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/Alarms")) { + alarm.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/Music")) { + music.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/Documents")) { + documentsn.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/Movies")) { + movies.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/Ringtones")) { + ringtone.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/Notifications")) { + notificaton.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/Audiobooks")) { + audiobooks.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/ramdump")) { + ramdump.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/LOST.DIR")) { + lostdir.setChecked(true); + } + if (dir.getString("custdir", "").contains("/storage/emulated/0/browser")) { + browser.setChecked(true); + } + } + + + public void _advanceMode() { + if (Variable == 5) { + d2.setTitle("šŸ—ƒļø š—”š—±š˜ƒš—®š—»š—°š—² š— š—¼š—±š—²"); + d2.setMessage("This Allow you to use \"/data/\" directories\nā€¢ šˆš­ š¢š¬ šššš§š šžš«šØš®š¬ šŽš©š­š¢šØš§ š›šž š¬š®š«šž š›šžšŸšØš«šž š®š¬š¢š§š \nā€¢ you will self responsible for Enabling This\n\nSure to Enable ?"); + d2.setPositiveButton("ā­• Enable", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + set.edit().putString("cda", "1").commit(); + cust_enable.setChecked(true); + SketchwareUtil.showMessage(getApplicationContext(), "āœ… Sucessfully Enabled Advanced Mode"); + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + else { + d2.setTitle("šŸ—ƒļø š—”š—±š˜ƒš—®š—»š—°š—² š— š—¼š—±š—²"); + d2.setMessage("This Allow you to use \"/data/\" directories\nā€¢ šˆš­ š¢š¬ šššš§š šžš«šØš®š¬ šŽš©š­š¢šØš§ š›šž š¬š®š«šž š›šžšŸšØš«šž š®š¬š¢š§š \nā€¢ you will self responsible for Enabling This\n\nš‘Ŗš’š’š’‡š’Šš’“š’Žš’‚š’•š’Šš’š’š’” : ".concat(String.valueOf((long)(Variable)).concat("/5"))); + d2.setPositiveButton("ā© NEXT", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + Variable++; + _advanceMode(); + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + } + + + public void _dis_selector() { + + } + + + public void _Delete_All() { + subtitle.setChecked(false); + alarm.setChecked(false); + music.setChecked(false); + documentsn.setChecked(false); + movies.setChecked(false); + miuiGallerydlt.setChecked(false); + notificaton.setChecked(false); + audiobooks.setChecked(false); + ringtone.setChecked(false); + ramdump.setChecked(false); + lostdir.setChecked(false); + browser.setChecked(false); + } + + + @Deprecated + public void showMessage(String _s) { + Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show(); + } + + @Deprecated + public int getLocationX(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[0]; + } + + @Deprecated + public int getLocationY(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[1]; + } + + @Deprecated + public int getRandom(int _min, int _max) { + Random random = new Random(); + return random.nextInt(_max - _min + 1) + _min; + } + + @Deprecated + public ArrayList getCheckedItemPositionsToArray(ListView _list) { + ArrayList _result = new ArrayList(); + SparseBooleanArray _arr = _list.getCheckedItemPositions(); + for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) { + if (_arr.valueAt(_iIdx)) + _result.add((double)_arr.keyAt(_iIdx)); + } + return _result; + } + + @Deprecated + public float getDip(int _input) { + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, getResources().getDisplayMetrics()); + } + + @Deprecated + public int getDisplayWidthPixels() { + return getResources().getDisplayMetrics().widthPixels; + } + + @Deprecated + public int getDisplayHeightPixels() { + return getResources().getDisplayMetrics().heightPixels; + } +} \ No newline at end of file diff --git a/app/src/main/java/cleaner/lite/pro/FileUtil.java b/app/src/main/java/cleaner/lite/pro/FileUtil.java new file mode 100644 index 0000000..cb70f43 --- /dev/null +++ b/app/src/main/java/cleaner/lite/pro/FileUtil.java @@ -0,0 +1,595 @@ +package cleaner.lite.pro; + +import android.content.ContentResolver; +import android.content.ContentUris; +import android.content.Context; +import android.database.Cursor; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.ColorFilter; +import android.graphics.ColorMatrix; +import android.graphics.ColorMatrixColorFilter; +import android.graphics.LightingColorFilter; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.Rect; +import android.graphics.RectF; +import android.media.ExifInterface; +import android.net.Uri; +import android.os.Environment; +import android.provider.DocumentsContract; +import android.provider.MediaStore; +import android.text.TextUtils; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.net.URLDecoder; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; + +public class FileUtil { + + private static void createNewFile(String path) { + int lastSep = path.lastIndexOf(File.separator); + if (lastSep > 0) { + String dirPath = path.substring(0, lastSep); + makeDir(dirPath); + } + + File file = new File(path); + + try { + if (!file.exists()) file.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static String readFile(String path) { + createNewFile(path); + + StringBuilder sb = new StringBuilder(); + FileReader fr = null; + try { + fr = new FileReader(new File(path)); + + char[] buff = new char[1024]; + int length = 0; + + while ((length = fr.read(buff)) > 0) { + sb.append(new String(buff, 0, length)); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (fr != null) { + try { + fr.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + return sb.toString(); + } + + public static void writeFile(String path, String str) { + createNewFile(path); + FileWriter fileWriter = null; + + try { + fileWriter = new FileWriter(new File(path), false); + fileWriter.write(str); + fileWriter.flush(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + if (fileWriter != null) + fileWriter.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + public static void copyFile(String sourcePath, String destPath) { + if (!isExistFile(sourcePath)) return; + createNewFile(destPath); + + FileInputStream fis = null; + FileOutputStream fos = null; + + try { + fis = new FileInputStream(sourcePath); + fos = new FileOutputStream(destPath, false); + + byte[] buff = new byte[1024]; + int length = 0; + + while ((length = fis.read(buff)) > 0) { + fos.write(buff, 0, length); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (fis != null) { + try { + fis.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (fos != null) { + try { + fos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + public static void copyDir(String oldPath, String newPath) { + File oldFile = new File(oldPath); + File[] files = oldFile.listFiles(); + File newFile = new File(newPath); + if (!newFile.exists()) { + newFile.mkdirs(); + } + for (File file : files) { + if (file.isFile()) { + copyFile(file.getPath(), newPath + "/" + file.getName()); + } else if (file.isDirectory()) { + copyDir(file.getPath(), newPath + "/" + file.getName()); + } + } + } + + public static void moveFile(String sourcePath, String destPath) { + copyFile(sourcePath, destPath); + deleteFile(sourcePath); + } + + public static void deleteFile(String path) { + File file = new File(path); + + if (!file.exists()) return; + + if (file.isFile()) { + file.delete(); + return; + } + + File[] fileArr = file.listFiles(); + + if (fileArr != null) { + for (File subFile : fileArr) { + if (subFile.isDirectory()) { + deleteFile(subFile.getAbsolutePath()); + } + + if (subFile.isFile()) { + subFile.delete(); + } + } + } + + file.delete(); + } + + public static boolean isExistFile(String path) { + File file = new File(path); + return file.exists(); + } + + public static void makeDir(String path) { + if (!isExistFile(path)) { + File file = new File(path); + file.mkdirs(); + } + } + + public static void listDir(String path, ArrayList list) { + File dir = new File(path); + if (!dir.exists() || dir.isFile()) return; + + File[] listFiles = dir.listFiles(); + if (listFiles == null || listFiles.length <= 0) return; + + if (list == null) return; + list.clear(); + for (File file : listFiles) { + list.add(file.getAbsolutePath()); + } + } + + public static boolean isDirectory(String path) { + if (!isExistFile(path)) return false; + return new File(path).isDirectory(); + } + + public static boolean isFile(String path) { + if (!isExistFile(path)) return false; + return new File(path).isFile(); + } + + public static long getFileLength(String path) { + if (!isExistFile(path)) return 0; + return new File(path).length(); + } + + public static String getExternalStorageDir() { + return Environment.getExternalStorageDirectory().getAbsolutePath(); + } + + public static String getPackageDataDir(Context context) { + return context.getExternalFilesDir(null).getAbsolutePath(); + } + + public static String getPublicDir(String type) { + return Environment.getExternalStoragePublicDirectory(type).getAbsolutePath(); + } + + public static String convertUriToFilePath(final Context context, final Uri uri) { + String path = null; + if (DocumentsContract.isDocumentUri(context, uri)) { + if (isExternalStorageDocument(uri)) { + final String docId = DocumentsContract.getDocumentId(uri); + final String[] split = docId.split(":"); + final String type = split[0]; + + if ("primary".equalsIgnoreCase(type)) { + path = Environment.getExternalStorageDirectory() + "/" + split[1]; + } + } else if (isDownloadsDocument(uri)) { + final String id = DocumentsContract.getDocumentId(uri); + + if (!TextUtils.isEmpty(id)) { + if (id.startsWith("raw:")) { + return id.replaceFirst("raw:", ""); + } + } + + final Uri contentUri = ContentUris + .withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(id)); + + path = getDataColumn(context, contentUri, null, null); + } else if (isMediaDocument(uri)) { + final String docId = DocumentsContract.getDocumentId(uri); + final String[] split = docId.split(":"); + final String type = split[0]; + + Uri contentUri = null; + if ("image".equals(type)) { + contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; + } else if ("video".equals(type)) { + contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI; + } else if ("audio".equals(type)) { + contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; + } + + final String selection = "_id=?"; + final String[] selectionArgs = new String[]{ + split[1] + }; + + path = getDataColumn(context, contentUri, selection, selectionArgs); + } + } else if (ContentResolver.SCHEME_CONTENT.equalsIgnoreCase(uri.getScheme())) { + path = getDataColumn(context, uri, null, null); + } else if (ContentResolver.SCHEME_FILE.equalsIgnoreCase(uri.getScheme())) { + path = uri.getPath(); + } + + if (path != null) { + try { + return URLDecoder.decode(path, "UTF-8"); + } catch(Exception e) { + return null; + } + } + return null; + } + + private static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) { + final String column = MediaStore.Images.Media.DATA; + final String[] projection = { + column + }; + + try (Cursor cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null)) { + if (cursor != null && cursor.moveToFirst()) { + final int column_index = cursor.getColumnIndexOrThrow(column); + return cursor.getString(column_index); + } + } catch (Exception e) { + + } + return null; + } + + + private static boolean isExternalStorageDocument(Uri uri) { + return "com.android.externalstorage.documents".equals(uri.getAuthority()); + } + + private static boolean isDownloadsDocument(Uri uri) { + return "com.android.providers.downloads.documents".equals(uri.getAuthority()); + } + + private static boolean isMediaDocument(Uri uri) { + return "com.android.providers.media.documents".equals(uri.getAuthority()); + } + + private static void saveBitmap(Bitmap bitmap, String destPath) { + FileUtil.createNewFile(destPath); + try (FileOutputStream out = new FileOutputStream(new File(destPath))) { + bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static Bitmap getScaledBitmap(String path, int max) { + Bitmap src = BitmapFactory.decodeFile(path); + + int width = src.getWidth(); + int height = src.getHeight(); + float rate = 0.0f; + + if (width > height) { + rate = max / (float) width; + height = (int) (height * rate); + width = max; + } else { + rate = max / (float) height; + width = (int) (width * rate); + height = max; + } + + return Bitmap.createScaledBitmap(src, width, height, true); + } + + public static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) { + final int width = options.outWidth; + final int height = options.outHeight; + int inSampleSize = 1; + + if (height > reqHeight || width > reqWidth) { + final int halfHeight = height / 2; + final int halfWidth = width / 2; + + while ((halfHeight / inSampleSize) >= reqHeight && (halfWidth / inSampleSize) >= reqWidth) { + inSampleSize *= 2; + } + } + + return inSampleSize; + } + + public static Bitmap decodeSampleBitmapFromPath(String path, int reqWidth, int reqHeight) { + final BitmapFactory.Options options = new BitmapFactory.Options(); + options.inJustDecodeBounds = true; + BitmapFactory.decodeFile(path, options); + + options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight); + + options.inJustDecodeBounds = false; + return BitmapFactory.decodeFile(path, options); + } + + public static void resizeBitmapFileRetainRatio(String fromPath, String destPath, int max) { + if (!isExistFile(fromPath)) return; + Bitmap bitmap = getScaledBitmap(fromPath, max); + saveBitmap(bitmap, destPath); + } + + public static void resizeBitmapFileToSquare(String fromPath, String destPath, int max) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + Bitmap bitmap = Bitmap.createScaledBitmap(src, max, max, true); + saveBitmap(bitmap, destPath); + } + + public static void resizeBitmapFileToCircle(String fromPath, String destPath) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + Bitmap bitmap = Bitmap.createBitmap(src.getWidth(), + src.getHeight(), Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + + final int color = 0xff424242; + final Paint paint = new Paint(); + final Rect rect = new Rect(0, 0, src.getWidth(), src.getHeight()); + + paint.setAntiAlias(true); + canvas.drawARGB(0, 0, 0, 0); + paint.setColor(color); + canvas.drawCircle(src.getWidth() / 2, src.getHeight() / 2, + src.getWidth() / 2, paint); + paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); + canvas.drawBitmap(src, rect, rect, paint); + + saveBitmap(bitmap, destPath); + } + + public static void resizeBitmapFileWithRoundedBorder(String fromPath, String destPath, int pixels) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + Bitmap bitmap = Bitmap.createBitmap(src.getWidth(), src + .getHeight(), Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + + final int color = 0xff424242; + final Paint paint = new Paint(); + final Rect rect = new Rect(0, 0, src.getWidth(), src.getHeight()); + final RectF rectF = new RectF(rect); + final float roundPx = pixels; + + paint.setAntiAlias(true); + canvas.drawARGB(0, 0, 0, 0); + paint.setColor(color); + canvas.drawRoundRect(rectF, roundPx, roundPx, paint); + + paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); + canvas.drawBitmap(src, rect, rect, paint); + + saveBitmap(bitmap, destPath); + } + + public static void cropBitmapFileFromCenter(String fromPath, String destPath, int w, int h) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + + int width = src.getWidth(); + int height = src.getHeight(); + + if (width < w && height < h) return; + + int x = 0; + int y = 0; + + if (width > w) x = (width - w) / 2; + + if (height > h) y = (height - h) / 2; + + int cw = w; + int ch = h; + + if (w > width) cw = width; + + if (h > height) ch = height; + + Bitmap bitmap = Bitmap.createBitmap(src, x, y, cw, ch); + saveBitmap(bitmap, destPath); + } + + public static void rotateBitmapFile(String fromPath, String destPath, float angle) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + Matrix matrix = new Matrix(); + matrix.postRotate(angle); + Bitmap bitmap = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true); + saveBitmap(bitmap, destPath); + } + + public static void scaleBitmapFile(String fromPath, String destPath, float x, float y) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + Matrix matrix = new Matrix(); + matrix.postScale(x, y); + + int w = src.getWidth(); + int h = src.getHeight(); + + Bitmap bitmap = Bitmap.createBitmap(src, 0, 0, w, h, matrix, true); + saveBitmap(bitmap, destPath); + } + + public static void skewBitmapFile(String fromPath, String destPath, float x, float y) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + Matrix matrix = new Matrix(); + matrix.postSkew(x, y); + + int w = src.getWidth(); + int h = src.getHeight(); + + Bitmap bitmap = Bitmap.createBitmap(src, 0, 0, w, h, matrix, true); + saveBitmap(bitmap, destPath); + } + + public static void setBitmapFileColorFilter(String fromPath, String destPath, int color) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + Bitmap bitmap = Bitmap.createBitmap(src, 0, 0, + src.getWidth() - 1, src.getHeight() - 1); + Paint p = new Paint(); + ColorFilter filter = new LightingColorFilter(color, 1); + p.setColorFilter(filter); + Canvas canvas = new Canvas(bitmap); + canvas.drawBitmap(bitmap, 0, 0, p); + saveBitmap(bitmap, destPath); + } + + public static void setBitmapFileBrightness(String fromPath, String destPath, float brightness) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + ColorMatrix cm = new ColorMatrix(new float[] + { + 1, 0, 0, 0, brightness, + 0, 1, 0, 0, brightness, + 0, 0, 1, 0, brightness, + 0, 0, 0, 1, 0 + }); + + Bitmap bitmap = Bitmap.createBitmap(src.getWidth(), src.getHeight(), src.getConfig()); + Canvas canvas = new Canvas(bitmap); + Paint paint = new Paint(); + paint.setColorFilter(new ColorMatrixColorFilter(cm)); + canvas.drawBitmap(src, 0, 0, paint); + saveBitmap(bitmap, destPath); + } + + public static void setBitmapFileContrast(String fromPath, String destPath, float contrast) { + if (!isExistFile(fromPath)) return; + Bitmap src = BitmapFactory.decodeFile(fromPath); + ColorMatrix cm = new ColorMatrix(new float[] + { + contrast, 0, 0, 0, 0, + 0, contrast, 0, 0, 0, + 0, 0, contrast, 0, 0, + 0, 0, 0, 1, 0 + }); + + Bitmap bitmap = Bitmap.createBitmap(src.getWidth(), src.getHeight(), src.getConfig()); + Canvas canvas = new Canvas(bitmap); + Paint paint = new Paint(); + paint.setColorFilter(new ColorMatrixColorFilter(cm)); + canvas.drawBitmap(src, 0, 0, paint); + + saveBitmap(bitmap, destPath); + } + + public static int getJpegRotate(String filePath) { + int rotate = 0; + try { + ExifInterface exif = new ExifInterface(filePath); + int iOrientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1); + + switch (iOrientation) { + case ExifInterface.ORIENTATION_ROTATE_90: + rotate = 90; + break; + + case ExifInterface.ORIENTATION_ROTATE_180: + rotate = 180; + break; + + case ExifInterface.ORIENTATION_ROTATE_270: + rotate = 270; + break; + } + } catch (IOException e) { + return 0; + } + + return rotate; + } + + public static File createNewPictureFile(Context context) { + SimpleDateFormat date = new SimpleDateFormat("yyyyMMdd_HHmmss"); + String fileName = date.format(new Date()) + ".jpg"; + return new File(context.getExternalFilesDir(Environment.DIRECTORY_DCIM).getAbsolutePath() + File.separator + fileName); + } +} diff --git a/app/src/main/java/cleaner/lite/pro/MainActivity.java b/app/src/main/java/cleaner/lite/pro/MainActivity.java new file mode 100644 index 0000000..71e3123 --- /dev/null +++ b/app/src/main/java/cleaner/lite/pro/MainActivity.java @@ -0,0 +1,3406 @@ +package cleaner.lite.pro; + +import android.animation.*; +import android.app.*; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.app.Fragment; +import android.app.FragmentManager; +import android.content.*; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.*; +import android.graphics.*; +import android.graphics.drawable.*; +import android.media.*; +import android.net.*; +import android.net.Uri; +import android.os.*; +import android.os.Bundle; +import android.text.*; +import android.text.style.*; +import android.util.*; +import android.view.*; +import android.view.View; +import android.view.View.*; +import android.view.animation.*; +import android.webkit.*; +import android.widget.*; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.TextView; +import java.io.*; +import java.io.InputStream; +import java.text.*; +import java.text.DecimalFormat; +import java.util.*; +import java.util.HashMap; +import java.util.Timer; +import java.util.TimerTask; +import java.util.regex.*; +import org.json.*; + +public class MainActivity extends Activity { + + private Timer _timer = new Timer(); + + private String PremiumCheck = ""; + private String delvikSizer = ""; + private String oatSizer = ""; + private String oatcode = ""; + private double converter = 0; + private double Converter = 0; + private String sspnd = ""; + private String variable = ""; + private double secure = 0; + private String dynumic = ""; + private String random = ""; + private String Random = ""; + private String decrypted = ""; + private String Runner = ""; + private String cmd = ""; + private String counter = ""; + private HashMap Cmd = new HashMap<>(); + + private ImageView imageview1; + private ScrollView vscroll1; + private LinearLayout linear1; + private LinearLayout linear5; + private LinearLayout linear6; + private LinearLayout linear7; + private LinearLayout linear8; + private LinearLayout linear12; + private LinearLayout linear9; + private LinearLayout extra; + private LinearLayout forDeveloper; + private Button DailyCleaner; + private LinearLayout linear2; + private LinearLayout linear13; + private Button additional; + private LinearLayout linear14; + private Button button23; + private LinearLayout linear4; + private TextView result; + private TextView bt_Calibrate; + private TextView storageviewer; + private TextView logclean; + private TextView delvikclean; + private TextView cachetrim; + private TextView fstrimmm; + private TextView internalStorage; + private TextView multiUser; + private TextView OneTap; + private TextView EmptyFolder_Cleaner; + private TextView oatclean; + private TextView wiperapi; + private TextView cleanertoolbox; + private TextView tmpfilecleaner; + private TextView cleanall; + private TextView Clean; + private Button button19; + private Button button31; + private Button help; + private Button button45; + private Button settings; + private Button dynamicbutton; + private Button button27; + private Button feedback; + + private AlertDialog.Builder d; + private AlertDialog.Builder n; + private AlertDialog.Builder nnnn; + private AlertDialog.Builder h; + private AlertDialog.Builder clear; + private AlertDialog.Builder new2; + private AlertDialog.Builder feed; + private Intent update = new Intent(); + private AlertDialog.Builder list; + private AlertDialog.Builder onetime; + private SharedPreferences ot; + private TimerTask t; + private AlertDialog.Builder changelog; + private AlertDialog.Builder donate; + private AlertDialog.Builder upi; + private AlertDialog.Builder trx; + private AlertDialog.Builder btc; + private TimerTask check; + private SharedPreferences off; + private AlertDialog.Builder dd; + private AlertDialog.Builder expire; + private AlertDialog.Builder trim; + private AlertDialog.Builder fix; + private Intent sett = new Intent(); + private SharedPreferences set; + private AlertDialog.Builder whatsappadvv; + private AlertDialog.Builder wac; + private AlertDialog.Builder dalvik; + private AlertDialog.Builder oat; + private AlertDialog.Builder viewstorage; + private AlertDialog.Builder wiperapiii; + private AlertDialog.Builder info; + private AlertDialog.Builder multi; + private AlertDialog.Builder enablefirst; + private Intent whatsapp = new Intent(); + private AlertDialog.Builder d2; + private AlertDialog.Builder d1; + private AlertDialog.Builder d3; + private Intent i = new Intent(); + private SharedPreferences premium; + private AlertDialog.Builder prm; + private SharedPreferences dir; + private AlertDialog.Builder d2_1; + private AlertDialog.Builder soon; + private AlertDialog.Builder noRoot; + private AlertDialog.Builder agree; + private AlertDialog.Builder error; + private AlertDialog.Builder tmp; + private Intent a = new Intent(); + private Intent b = new Intent(); + private Intent c = new Intent(); + private TimerTask expired; + private AlertDialog.Builder dynamic; + private Intent chng = new Intent(); + private AlertDialog.Builder empty; + private Intent download = new Intent(); + private AlertDialog.Builder Notice; + private AlertDialog.Builder oatClean; + + @Override + protected void onCreate(Bundle _savedInstanceState) { + super.onCreate(_savedInstanceState); + setContentView(R.layout.main); + initialize(_savedInstanceState); + initializeLogic(); + } + + private void initialize(Bundle _savedInstanceState) { + imageview1 = findViewById(R.id.imageview1); + vscroll1 = findViewById(R.id.vscroll1); + linear1 = findViewById(R.id.linear1); + linear5 = findViewById(R.id.linear5); + linear6 = findViewById(R.id.linear6); + linear7 = findViewById(R.id.linear7); + linear8 = findViewById(R.id.linear8); + linear12 = findViewById(R.id.linear12); + linear9 = findViewById(R.id.linear9); + extra = findViewById(R.id.extra); + forDeveloper = findViewById(R.id.forDeveloper); + DailyCleaner = findViewById(R.id.DailyCleaner); + linear2 = findViewById(R.id.linear2); + linear13 = findViewById(R.id.linear13); + additional = findViewById(R.id.additional); + linear14 = findViewById(R.id.linear14); + button23 = findViewById(R.id.button23); + linear4 = findViewById(R.id.linear4); + result = findViewById(R.id.result); + bt_Calibrate = findViewById(R.id.bt_Calibrate); + storageviewer = findViewById(R.id.storageviewer); + logclean = findViewById(R.id.logclean); + delvikclean = findViewById(R.id.delvikclean); + cachetrim = findViewById(R.id.cachetrim); + fstrimmm = findViewById(R.id.fstrimmm); + internalStorage = findViewById(R.id.internalStorage); + multiUser = findViewById(R.id.multiUser); + OneTap = findViewById(R.id.OneTap); + EmptyFolder_Cleaner = findViewById(R.id.EmptyFolder_Cleaner); + oatclean = findViewById(R.id.oatclean); + wiperapi = findViewById(R.id.wiperapi); + cleanertoolbox = findViewById(R.id.cleanertoolbox); + tmpfilecleaner = findViewById(R.id.tmpfilecleaner); + cleanall = findViewById(R.id.cleanall); + Clean = findViewById(R.id.Clean); + button19 = findViewById(R.id.button19); + button31 = findViewById(R.id.button31); + help = findViewById(R.id.help); + button45 = findViewById(R.id.button45); + settings = findViewById(R.id.settings); + dynamicbutton = findViewById(R.id.dynamicbutton); + button27 = findViewById(R.id.button27); + feedback = findViewById(R.id.feedback); + d = new AlertDialog.Builder(this); + n = new AlertDialog.Builder(this); + nnnn = new AlertDialog.Builder(this); + h = new AlertDialog.Builder(this); + clear = new AlertDialog.Builder(this); + new2 = new AlertDialog.Builder(this); + feed = new AlertDialog.Builder(this); + list = new AlertDialog.Builder(this); + onetime = new AlertDialog.Builder(this); + ot = getSharedPreferences("ot", Activity.MODE_PRIVATE); + changelog = new AlertDialog.Builder(this); + donate = new AlertDialog.Builder(this); + upi = new AlertDialog.Builder(this); + trx = new AlertDialog.Builder(this); + btc = new AlertDialog.Builder(this); + off = getSharedPreferences("off", Activity.MODE_PRIVATE); + dd = new AlertDialog.Builder(this); + expire = new AlertDialog.Builder(this); + trim = new AlertDialog.Builder(this); + fix = new AlertDialog.Builder(this); + set = getSharedPreferences("set", Activity.MODE_PRIVATE); + whatsappadvv = new AlertDialog.Builder(this); + wac = new AlertDialog.Builder(this); + dalvik = new AlertDialog.Builder(this); + oat = new AlertDialog.Builder(this); + viewstorage = new AlertDialog.Builder(this); + wiperapiii = new AlertDialog.Builder(this); + info = new AlertDialog.Builder(this); + multi = new AlertDialog.Builder(this); + enablefirst = new AlertDialog.Builder(this); + d2 = new AlertDialog.Builder(this); + d1 = new AlertDialog.Builder(this); + d3 = new AlertDialog.Builder(this); + premium = getSharedPreferences("premium", Activity.MODE_PRIVATE); + prm = new AlertDialog.Builder(this); + dir = getSharedPreferences("dir", Activity.MODE_PRIVATE); + d2_1 = new AlertDialog.Builder(this); + soon = new AlertDialog.Builder(this); + noRoot = new AlertDialog.Builder(this); + agree = new AlertDialog.Builder(this); + error = new AlertDialog.Builder(this); + tmp = new AlertDialog.Builder(this); + dynamic = new AlertDialog.Builder(this); + empty = new AlertDialog.Builder(this); + Notice = new AlertDialog.Builder(this); + oatClean = new AlertDialog.Builder(this); + + linear1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + linear5.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + DailyCleaner.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if (set.getString("confirm", "").equals("0")) { + try { + final String command = "# perform daily clean"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” ššžš«šŸšØš«š¦š¢š§š  šƒššš¢š„š² š‚š„šžššš§") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(MainActivity.this, "āœ… Action Performed", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission is denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + d.setTitle("šŸš€ š——š—®š—¶š—¹š˜† š—–š—¹š—²š—®š—»š—²š—æ"); + d.setMessage("ā€¢ It does not affect any data."); + d.setPositiveButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "# perform daily clean"; + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” ššžš«šŸšØš«š¦š¢š§š  šƒššš¢š„š² š‚š„šžššš§") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + SketchwareUtil.showMessage(getApplicationContext(), "āœ… Action Performed"); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(MainActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d.create().show(); + } + } + }); + + additional.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + i.setAction(Intent.ACTION_VIEW); + i.setClass(getApplicationContext(), PremiumActivity.class); + startActivity(i); + } + }); + + button23.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + h.setTitle("šŸŖ† š—”š—Æš—¼š˜‚š˜"); + h.setMessage("š“š”šž šŒšØš¬š­ š€ššÆššš§šœšž š‚š„šžššš§šžš« š„š¢š­šž šžšÆšžš« š¦ššššž š¢š§ š€š§šš«šØš¢š š‹š¢šŸšž.\n\nā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢\n\nšŸ·ļøš‘šžšŖš®š¢š«šžš¦šžš§š­š¬: \n- Root Acess Only\n\n------------------------------------------\nšŸ“‘ šŒššš¢š§ š…šžššš­š®š«šžš¬:\nā€¢ One Click Dynamic Cleaner\nā€¢ All Cache/waste cleaner \nā€¢ Custom Cleaner\nā€¢ Smart Cleaner\nā€¢ Battery Callibration \nā€¢ Fstrim & Cache Trim\nā€¢ No background functionality\nā€¢ Dynamic Cleaning Mechanism\nā€¢ Cleaner Toolbox \nš–’š–”š–—š–Š +++\n------------------------------------------\n\nšŸ‘Øā€šŸŽ¤ Developer : š‘Øš’“š’‚š’‚š’‡š‘¹š’š’šš’‚š’š’ šŸ‡®šŸ‡³\nTelegram id : @AraafRoyall\nEmail : araafroyall@digdig.org\nGmail : araafrogall@gmail.com\n\n------------------------------------------\n\nšŸ“œ Note :\nThis App never Collect Any data\nThis App is totally Offline\nThis App Never Affect Any Usable Data unless defined\nšƒšžšÆšžš„šØš©šžš« š¢š¬ š§šØš­ š«šžš¬š©šØš§š¬š¢š›š„šž šŸšØš« ššš§š² šššš¦ššš šž š©š„šžššš¬šž š›šž šœššš«šžšŸš®š„š„ š›šžšŸšØš«šž š®š¬š¢š§š  š­š”š¢š¬ ššš©š©\n\nA suggestion is most welcome šŸ˜Š\n[Please Try Premium features too]"); + h.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + h.create().show(); + } + }); + + result.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + bt_Calibrate.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if (set.getString("enable", "").contains("battery")) { + _battery_calibrate(); + } + else { + _enable_first(); + } + } + }); + + storageviewer.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + b.setClass(getApplicationContext(), StorageusageActivity.class); + startActivity(b); + } + }); + + logclean.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + new2.setTitle("šŸ›ø š—Ÿš—¼š—“š˜€ š—–š—¹š—²š—®š—»š—²š—æ š„š§š”ššš§šœšžš"); + new2.setMessage("This Will Clear All Logs Globally"); + new2.setPositiveButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + + final String command = sspnd.concat("# clean logs dynamically"); + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  š‹šØš š¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Cleared Sucessfully"); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + _Error(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + new2.setNegativeButton("cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + new2.create().show(); + } + }); + + delvikclean.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if (set.getString("dalvikkkk", "").equals("1")) { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ‘Øā€šŸ’» This Option is Disabled"); + } + else { + _delvik_clean(); + } + } + }); + + cachetrim.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + _cache_trim(); + } + }); + + fstrimmm.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + _fstrim(); + } + }); + + internalStorage.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + new2.setTitle("šŸ“‚ š™„š™£š™©š™šš™§š™£š™–š™” š™Žš™©š™¤š™§š™–š™œš™š š‘Ŗš’š’†š’‚š’š’†š’“"); + new2.setMessage("This Will Clear All unwanted folder and files from Internal storage (š‘ŗš’‚š’‡š’†)\n\nš‘µš’ š‘«š’‚š’•š’‚ š‘¾š’Šš’š’ š‘«š’†š’š’†š’•š’†"); + new2.setPositiveButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "# clean internal storage waste"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  šˆš§š­šžš«š§ššš„ š’š­šØš«ššš šž") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(MainActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + new2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + new2.create().show(); + } + }); + + multiUser.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + _multi_user_clean(); + } + }); + + OneTap.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + i.setClass(getApplicationContext(), OnetapActivity.class); + startActivity(i); + } + }); + + EmptyFolder_Cleaner.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + empty.setTitle("šŸ“ š—˜š—ŗš—½š˜š˜† š—™š—¼š—¹š—±š—²š—æ š‚š„šžššš§šžš«"); + empty.setMessage("Clears All š‘¬š’Žš’‘š’•š’š š‘­š’š’š’…š’†š’“š’” from Internal Storage"); + LinearLayout layuu = new LinearLayout(MainActivity.this); + layuu.setOrientation(LinearLayout.VERTICAL); + + LinearLayout.LayoutParams prm = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); + + final CheckBox alt = new CheckBox(MainActivity.this); + alt.setText("Alternate Method"); + alt.setLayoutParams(prm); + layuu.addView(alt); + final CheckBox mpty = new CheckBox(MainActivity.this); + mpty.setText("Multi-User"); + mpty.setLayoutParams(prm); + layuu.addView(mpty); + + empty.setView(layuu); + alt.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + mpty.setChecked(false); + if + ((alt.isChecked())){ + + alt.setChecked(true); + } + else + { + + + } + } + }); + mpty.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + alt.setChecked(false); + if + ((mpty.isChecked())){ + + mpty.setChecked(true); + } + else + { + + + } + } + }); + empty.setPositiveButton("šŸš€ š‚š„šžššš§", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if + ((mpty.isChecked())){ + + _EmptyFolderMultiuser(); + } + else + { + if + ((alt.isChecked())){ + + cmd = sspnd.concat("# clean empty folder from internal storage"); + } + else + { + cmd = sspnd.concat("# clean empty folder from MultiUser"); + + } + _EmptyFolderClean(); + + } + } + }); + empty.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + empty.create().show(); + } + }); + + oatclean.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + oat.setTitle("šŸ“­ š—¢š—±š—²š˜…/š—©š—±š—²š˜…/š—¼š—®š˜ š—–š—¹š—²š—®š—»š—²š—æ"); + oat.setMessage("Clears All oat (usually dex/vdex) files of user apps.\nNot affect any app functionality"); + oat.setPositiveButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + _odex_vdex_etc_cleaner(); + } + }); + oat.setNeutralButton("šŸ’» Used storage", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + _OAT_Storage_Viewer(); + } + }); + oat.create().show(); + } + }); + + wiperapi.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + _easy_wiper_api(); + } + }); + + cleanertoolbox.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + whatsapp.setAction(Intent.ACTION_VIEW); + whatsapp.setClass(getApplicationContext(), CustomCleanerActivity.class); + startActivity(whatsapp); + } + }); + + tmpfilecleaner.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸ“¦ š“šžš¦š©šØš«ššš«š² š…š¢š„šžš¬ š‚š„šžššš§šžš«"); + d2.setMessage("This Clears All Temporary Files created by many Apps"); + d2.setPositiveButton("šŸ›ø Clean", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + _TmpFilesCleaner(); + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + + cleanall.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸ›ø š‚š„šžššš§š€š„š„"); + d2.setMessage("This Will Perform Clean Mechanism Provided for Developer Only"); + d2.setPositiveButton("š‚š„šžššš§", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + + final String command = "cleanall"; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” ššžš«šŸšØš«š¦š¢š§š  š‚š„šžššš§") + .setMessage(" Please Wait....") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Cleared Sucessfully"); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("Currently this feature is only for Developer"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + + Clean.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸ›ø š‚š„šžššš§"); + d2.setMessage("This Will Perform Clean Mechanism Provided for Developer Only"); + d2.setPositiveButton("š‚š„šžššš§", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + + final String command = "clean"; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” ššžš«šŸšØš«š¦š¢š§š  š‚š„šžššš§") + .setMessage(" Please Wait....") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Cleared Sucessfully"); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("Currently this feature is only for Developer"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + + button19.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + _ChangeLog(); + } + }); + + button31.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + list.setTitle("šŸ‘Øā€šŸ’» š—›š—²š—¹š—½ & š‚š„šžššš§š¢š§š  š‹š¢š¬š­"); + list.setMessage("š“š”š¢š¬ š€š©š© š§šžšÆšžš« šššŸšŸšžšœš­ ššš§š² š®š¬šžš«šššš­šš.\n\nšŸ§‘ā€šŸ’» šƒšžšÆšžš„šØš©šžš« š¢š¬ š§šØš­ š«šžš¬š©šØš§š¬š¢š›š„šž šŸšØš« ššš§š² šššš¦ššš šž š©š„šžššš¬šž š›šž šœššš«šžšŸš®š„š„ š›šžšŸšØš«šž š®š¬š¢š§š  š­š”š¢š¬ ššš©š©.\n\nā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢\n\nšŸ›ø š—Ÿš—¼š—“š˜€ š—–š—¹š—²š—®š—»š—²š—æ\nā€¢ Clears Almost All Apps and system logs \nā€¢ It Also clears All Logs in /data and its subdirectories\nā€¢ Clears all Logs with extension '.log' Globally\n\nAll Apps logs \nlogcat\n/data log\nlogger files\nruntime.log\nupdate engine log\nLsposed logs\nlsposed old logs\nthanox logs \nfox logs\nš‚š„šžššš«š¬ ššš„š„ š‹šØš š¬ š°š¢š­š” šžš±š­šžš§š¬š¢šØš§ '.š„šØš '\nš–’š–”š–—š–Š +++\n------------------------------------------\nšŸ›ø š—˜š—®š˜€š˜† š—–š—®š—°š—µš—² š—Ŗš—¶š—½š—²š—æ š—”š—£š—œ\nThis is based on \"Easy Cache Wiper\" app from playstore .\nAnd contains All That Clean Functionality in Single Option.\n\nAll app cache \ncache in internal storage\nbugreports\nLost.dir\ntombstone files\nlogger\ndropbox cache\nusagestatus waste files\nš–’š–”š–—š–Š +++\n------------------------------------------\nšŸ’¼ š— š˜‚š—¹š˜š—¶-š—Øš˜€š—²š—æ š—–š—¹š—²š—®š—»š—²š—æ\nClears All Unwanted File and Folder from MultiUsers Spaces Storage\nIt supports All Multi-Space like Island,WorkProfile,Any Dual Apps , MiUi second space and so on...\n\nAll type of .thumbnails\nwastage empty folder \nCache in storage \nwhatsapp wastage \nramdump\ndebug log\n.trash\nfoxlogs\n.shareit\n.android\nlost.dir\nš–’š–”š–—š–Š +++\n------------------------------------------\nšŸ“¦ š“šžš¦š©š«šØš«ššš«š² š…š¢š„šžš¬ š‚š„šžššš§šžš«\nThis Clears all (temp or tmp) files created by many apps for temporary work\n--------------------------------------------\nšŸŖ† š—Ÿš˜‚š—°š—øš˜† š—£š—®š˜š—°š—µš—²š—æ š—–š—¹š—²š—®š—»š—²š—æ\nIt simply Contains the downloaded patch cleaner and modified Apps Cleaner to save little storage\n--------------------------------------------\nšŸ“« š‹šŽš’š“.šƒšˆš‘ š‚š„šžššš§šžš«\nLOST.DIR files are temporary files created on file tranfer \nClears All LOST.DIR files and Folder from Device including SD Card\n--------------------------------------------\nšŸ“‚ š™„š™£š™©š™šš™§š™£š™–š™” š™Žš™©š™¤š™§š™–š™œš™š š‘Ŗš’š’†š’‚š’š’†š’“\nThis Will Clear All unwanted folder and files from Internal storage (š‘ŗš’‚š’‡š’†)\nIt is best to add more directories in custom cleaner if you think that some files or folders left from clean\n\nAll type of .thumbnails\nwastage empty folder \nCache in storage \nwhatsapp wastage \nramdump\ndebug log\n.trash\nfoxlogs\n.shareit\n.android\nlost.dir\nš–’š–”š–—š–Š +++\n-------------------------------------------\nšŸ’¾ š—¼š—±š—²š˜…/š˜ƒš—±š—²š˜…/š—¼š—®š˜ š—–š—¹š—²š—®š—»š—²š—æ\nThis will clear All oat (usually dex/vdex) files from user Apps including MultiUser.\nThis does not affect any app functionality\nCurrently No Effect on System Apps (impliment later)\n------------------------------------------\nšŸ®š——š—®š—¹š˜ƒš—¶š—ø š—–š—®š—°š—µš—² š—–š—¹š—²š—®š—»š—²š—æ\nIt Clears All Dalvik cache dynamically.\nSupports All Android version\nš’”š’š’Žš’†š’•š’Šš’Žš’† š’š’š’˜š’†š’“ š‘Øš’š’…š’“š’š’Šš’… š’—š’†š’“š’”š’Šš’š’ (š’–š’‘š’•š’ 9) š’š’†š’†š’…š’” š’…š’š’–š’ƒš’š’† š’“š’†š’ƒš’š’š’• š’•š’ š’ƒš’š’š’• š’šš’š’–š’“ š’…š’†š’—š’Šš’„š’†\n------------------------------------------\nšŸŖ€ š—Ŗš—µš—®š˜š˜€š—”š—½š—½ š—–š—¹š—²š—®š—»š—²š—æ (waste files only)\nIt Clears All unwanted cache, log, file, directories in whatsApp.\nIt Also Include : Status Cleaner , .shared cleaner , and more\n--------------------------------------------\nšŸŖ† š—–š—®š—°š—µš—² š—§š—暝—¶š—ŗš—ŗš—²š—æ\nAll Apps Cache at system level \ndeep cache cleaner \nDynamically Clears All cache Folder with its contents Globally\n\nā€¢ It clears All App (user+system) cache to 0 KB.\nā€¢ It is most effective Cache cleaner in 3 seconds\nā€¢ Every Single folder naming 'Cache' or 'cache' with its content will be cleared in one click from device Globally\n-------------------------------------------\nā˜„ļø š—™š˜€š—§š—暝—¶š—ŗ\nIt Generally Remove lags from system and data but it is Slow process (Don't use if you don't like)\nuse Cache Trimmer Instead for best result \nIt include /system & /data Fstrim\nRequirement : š’ƒš’–š’”š’šš’ƒš’š’™\n-------------------------------------------\nšŸŽ›ļø .ššØš¦šžšš¢šš š‚š„šžššš§šžš«\nClears all nomedia files from device globally \n.nomedia files are used for hide media files from Gallery or other apps to get visible \non Cleaning this may cause all hidden media available in Gallery or similar apps\n--------------------------------------------\nšŸ”‹š—•š—®š˜š˜š—²š—暝˜† š—–š—®š—¹š—¹š—¶š—Æš—暝—®š˜š—²\nCalibrate of battery is rarely needed.\nit is required to be performed when you switch rom and at any other condition.\nThis App Also offers to Revert Battery calibrate file Dynamically in case of Any Issue \n--------------------------------------------\nšŸ’» š—–š˜‚š˜€š˜š—¼š—ŗ š—–š—¹š—²š—®š—»š—²š—æ\nIt Allow you to use custom directories to clean\nIt Also include few pre-saved directories to be select from its settings.\nCurrently It Allow you to choose directories only from Internal Storage\n---------------------------------------------\nšŸ”® šŽš§šžš“ššš© š‚š„šžššš§šžš«\nThis option is useful when you Want to clean multiple items in Less time \nJust select the options once , than use as many time as you want\n--------------------------------------------\nšŸ—‚ļø š—˜š—ŗš—½š˜š˜† š—™š—¼š—¹š—±š—²š—æ š‚š„šžššš§šžš«\n It Can clear All empty folders in one click From Internal Storage\n(MultiUser impliment soon)\n--------------------------------------------\n\n\nš–’š–”š–—š–Š +++ ( No Enough time to Explain all directories, If you think any missing directory just use custom cleaner or submit a directory , I will add in next update) šŸ‘Øā€šŸŽ¤"); + list.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + list.create().show(); + } + }); + + help.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + a.setClass(getApplicationContext(), CompatibilityActivity.class); + startActivity(a); + } + }); + + button45.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d3.setTitle("šŸ§© š—–š—¹š—²š—®š—»š—²š—æ š—Ÿš—¶š˜š—² š—›š—²š—¹š—½š—²š—æ"); + d3.setMessage("To maintain Cleaner lite Pro Size and Offline working All Additional Functions are shifted to Helper App\nšˆš­ šˆš§šœš„š®ššž\nā€¢ Premium , Payment Methods, Feedback, bug report, Directory Submission, Forums etc.\n\nš‘«š’š’˜š’š’š’š’‚š’… š‘Øš’‘š’‘ or Use Telegram Bot"); + d3.setPositiveButton("šŸŒ€ š“šžš„šžš š«ššš¦ bot", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + download.setAction(Intent.ACTION_VIEW); + download.setData(Uri.parse("https://t.me/Cleaner_Lite_Robot")); + startActivity(download); + } + }); + d3.setNegativeButton("šŸŒ€ š“šžš„šžš š«ššš¦ Channel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + download.setAction(Intent.ACTION_VIEW); + download.setData(Uri.parse("https://t.me/cleanerprolite")); + startActivity(download); + } + }); + d3.setNeutralButton("ā¬‡ļø šƒš¢š«šžšœš­ šƒšØš°š§š„šØššš", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + download.setAction(Intent.ACTION_VIEW); + download.setData(Uri.parse("https://github.com/araafroyall/Cleaner.Lite.Helper/releases/download/Latest/Cleaner.Lite.Helper.Latest.apk")); + startActivity(download); + } + }); + d3.create().show(); + } + }); + + settings.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + sett.setClass(getApplicationContext(), SettingsActivity.class); + startActivity(sett); + } + }); + + dynamicbutton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if (!(Random.length() == 6)) { + random = "1234567890"; + Random = ""; + for (int i = 0; i < 6; i++) { + Random = Random + random.charAt(new java.util.Random().nextInt(random.length())); + } + } + expired = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + d1.setTitle("šŸŖ„ š——š˜†š—»š—®š—ŗš—¶š—° š—”š—°š˜š—¶š—¼š—»"); + d1.setMessage("ā€¢ This Allow you to Perform Enhanced Actions Dynamically.\nā€¢ Redeem code , Shell commands , settings Changer , Data Modifier, Bugs Fixer etc ..."); + d1.setPositiveButton("ā© ššžš±š­", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + dynamic.setTitle("šŸŖ„ š——š˜†š—»š—®š—ŗš—¶š—° š—”š—°š˜š—¶š—¼š—»"); + dynamic.setMessage("š‘·š’‚š’”š’•š’† š’•š’‰š’† š’•š’†š’™š’• š’‘š’“š’š’—š’Šš’…š’†š’… š’ƒš’š 'š‘Øš’“š’‚š’‚š’‡š‘¹š’š’šš’‚š’š’' š’•š’ š’‘š’†š’“š’‡š’š’“š’Ž š’“š’†š’”š’‘š’†š’„š’•š’†š’… š‘Øš’„š’•š’Šš’š’\nAcess Code : ".concat(Random)); + final EditText dynomic = new EditText(MainActivity.this); + dynomic.setHint("Paste Here..."); + LinearLayout.LayoutParams lpar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); + dynomic.setLayoutParams(lpar); + dynamic.setView(dynomic); + dynamic.setPositiveButton("āš” ššžš«šŸšØš«š¦ š€šœš­š¢šØš§", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + dynumic = dynomic.getText().toString(); + _dynamicAction(); + } + }); + dynamic.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + dynamic.create().show(); + } + }); + d1.create().show(); + } + }); + } + }; + _timer.schedule(expired, (int)(150)); + } + }); + + button27.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d3.setTitle("ā¬†ļø š—–š—µš—²š—°š—ø š—Øš—½š—±š—®š˜š—²"); + d3.setMessage("We Provides Continue Updates \nIt is Recommended To Always use Latest Version For best Exprience\n\nHow would you like to get Latest update ?"); + d3.setPositiveButton("šŸŒ š—šš—¶š˜š—µš˜‚š—Æ", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + c.setAction(Intent.ACTION_VIEW); + c.setData(Uri.parse("https://github.com/araafroyall/Cleaner.Lite.Helper")); + startActivity(c); + } + }); + d3.setNegativeButton("ā–¶ļø š—§š—²š—¹š—²š—“š—暝—®š—ŗ", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + c.setAction(Intent.ACTION_VIEW); + c.setData(Uri.parse("https://t.me/cleanerprolite")); + startActivity(c); + } + }); + d3.setNeutralButton("ā¬‡ļø šƒš¢š«šžšœš­ šƒšØš°š§š„šØššš", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + c.setAction(Intent.ACTION_VIEW); + c.setData(Uri.parse("https://github.com/araafroyall/Cleaner-Pro-Lite/releases/download/Latest/Cleaner.Lite.Pro.Latest.apk")); + startActivity(c); + } + }); + d3.create().show(); + } + }); + + feedback.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + feed.setTitle("āœ‰ļø š—™š—²š—²š—±š—Æš—®š—°š—ø"); + feed.setMessage("Please give us feedback or suggestion or tell us about the problem which you are facing with this app.\nEvery suggestion is important to make it batter \nUse Helper App or Cleaner bot for Faster & Organized Response\n\nWhat do you want to do ?"); + feed.setPositiveButton("šŸ“Ø Suggestion or Feedback", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + update.setAction(Intent.ACTION_VIEW); + update.setData(Uri.parse("https://m.kuku.lu/f.php?bbee3ceedf")); + startActivity(update); + } + }); + feed.setNeutralButton("ā— Report A bug", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + update.setAction(Intent.ACTION_VIEW); + update.setData(Uri.parse("https://m.kuku.lu/f.php?bcdbee4579")); + startActivity(update); + } + }); + feed.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + feed.create().show(); + } + }); + } + + private void initializeLogic() { + if (premium.getString("#", "").equals("1")) { + setTitle("šŸ… š—–š—¹š—²š—®š—»š—²š—æ š—Ÿš—¶š˜š—² š—£š—暝—²š—ŗš—¶š˜‚š—ŗ"); + } + else { + setTitle("šŸŒ€ Cleaner Pro Lite"); + } + if (set.getString("setu", "").equals("1")) { + if (set.getString("notice", "").equals("1")) { + + } + else { + _Note(); + } + } + else { + _privacy_Agreement(); + } + } + + @Override + protected void onPostCreate(Bundle _savedInstanceState) { + super.onPostCreate(_savedInstanceState); + PremiumCheck = "#!/bin/sh\n\n# This variable checks premium purchase "; + DailyCleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)15, 0xFFFF3D00, 0xFF76FF03)); + sspnd = "#!/bin/sh\n\n# this variable checks App functioning \n"; + if (set.getString("developer", "").equals("1")) { + forDeveloper.setVisibility(View.VISIBLE); + } + else { + forDeveloper.setVisibility(View.GONE); + } + } + + @Override + public void onBackPressed() { + finishAffinity(); + } + + @Override + public void onStart() { + super.onStart(); + if (!set.getString("theme", "").equals("2")) { + _color1(); + } + else { + _color2(); + } + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + d1.setTitle("ā¬†ļø š—Øš—½š—±š—®š˜š—² š—”š˜ƒš—®š—¶š—¹š—®š—Æš—¹š—²"); + d1.setMessage("Please download latest version"); + d1.setPositiveButton("Download", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + download.setAction(Intent.ACTION_VIEW); + download.setData(Uri.parse("https://github.com/araafroyall/Cleaner-Pro-Lite/releases/download/Latest/Cleaner.Lite.Pro.Latest.apk")); + startActivity(download); + } + }); + d1.create().show(); + } + }); + } + }; + _timer.schedule(t, (int)(4000)); + } + public void _ChangeLog() { + changelog.setTitle("šŸ’  š—–š—µš—®š—»š—“š—²š—¹š—¼š—“... všŸ®.šŸµ"); + changelog.setMessage("šŸš€ : Globally .nomedia Cleaner\nšŸš€ : Deleted File count in some option\nšŸš€ : SpeedUp EmptyFolder Cleaner\nš—™š—¶š˜… : Custom Directories Hints\nš—™š—¶š˜… : Temporary Files Cleaner Output\nš—™š—¶š˜… : Texts & minor information\nš—™š—¶š˜… : Notification checkbox in custom cleaner\nš—™š—¶š˜… : Fstrim on Android 13\nš—™š—¶š˜… : Bugs & Bot Intent issue\nšŸ’¬ : Bash changed to 'sh' Shell scripting to support Almost All Devices\nšŸ’¬ : MultiUser EmptyFolder Cleaner now outputs 'user'\nšŸ’¬ : New Custom Dirs Import Style\nšŸ’¬ : Premium Price is now fixed to 3$ for upto v2.9.\nšŸ’¬ : Prevent Obb Folder Clean even if it is Empty\nšŸ’¬ : Oat cleaner UI changes\nšŸ’¬ : Theme Stroke option\nšŸ’¬ : Theme change Dynamically without Restart App\nšŸ’¬ : Removed Unwanted Options\nā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢.\nv2.8\nšŸš€ : Smart Clean (Customizable)\nšŸš€ : Increased Overall Speed\nšŸš€ : Multi-User EmptyFolder Cleaner\nšŸš€ : Theme Support now Available\nšŸš€ : Browser Cache Cleaner\nšŸš€ : Templates in Smart Cleaner\nš—™š—¶š˜… : output of EmptyFolder Cleaner\nš—™š—¶š˜… : Dynamic Action Acess Code\nšŸ’¬ : Suspended storage view on Android 11 below devices\nšŸ’¬ : Reduced App Size\nšŸ’¬ : Introducing Custom Directory Hints\nšŸ’¬ : Smart Cleaner in place of .nomedia cleaner , and this is moved to Cleaner Toolbox\nšŸ’¬ : Updated java version 1.7>11\nšŸ’¬ : Updated Dexer from x to 8\nā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢\n\nšŸ”øOld ChangeLog is on Github\n\n------------------------------------------\nšŸ“³ Known Bugs:\nšŸ”¹ Custom Directory may not remove correctly if found multiple name matching\n------------------------------------------\n\nšŸ‘Øā€šŸŽ¤ š——š—²š˜ƒš—²š—¹š—¼š—½š—²š—æ :\n ā€¢ š‘Øš’“š’‚š’‚š’‡š‘¹š’š’šš’‚š’š’ [AR]\nEmail : araafroyall@digdig.org\nGmail : araafroyall@gmail.com\nTelegram : @AraafRoyall\n------------------------------------------\nšŸ“œ Note : \nšƒšžšÆšžš„šØš©šžš« š¢š¬ š§šØš­ š«šžš¬š©šØš§š¬š¢š›š„šž šŸšØš« ššš§š² šššš¦ššš šž š©š„šžššš¬šž š›šž šœššš«šžšŸš®š„š„ š›šžšŸšØš«šž š®š¬š¢š§š  š­š”š¢š¬ ššš©š©."); + changelog.setNeutralButton("šŸ“ƒ View All", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + chng.setAction(Intent.ACTION_VIEW); + chng.setData(Uri.parse("https://github.com/araafroyall/Cleaner-Pro-Lite/blob/ChangeLog/ChangeLog.txt")); + startActivity(chng); + } + }); + changelog.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + changelog.create().show(); + } + + + public void _delvik_clean() { + try { + + final String command = "# clean the dalvik dynamically"; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš”š—–š—®š—¹š—°š˜‚š—¹š—®š˜š—¶š—»š—“ š——š—²š—¹š˜ƒš—¶š—ø š—–š—®š—°š—µš—²") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + variable = result.getText().toString().replace("/data/dalvik-cache/", " "); + d2.setTitle("šŸ®š——š—®š—¹š˜ƒš—¶š—ø š—–š—®š—°š—µš—² š—–š—¹š—²š—®š—»š—²š—æ"); + d2.setMessage("\nDalvik Cache size : ".concat(variable)); + d2.setPositiveButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = sspnd.concat("# clean the dalvik dynamically"); + + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš”š‚š„šžššš§š¢š§š  šƒšžš„šÆš¢š¤ š‚šššœš”šž") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(MainActivity.this, "šŸ„ Cleared Delvik Cache", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + d1.setTitle("ā— š—˜š—暝—暝—¼š—æ"); + d1.setMessage("Unable to Calculate Delvik Size\nSomething went wrong or Root Permission is denied"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _battery_calibrate() { + d.setTitle("šŸ”‹ š—•š—®š˜š˜š—²š—暝˜† š—–š—®š—¹š—¶š—Æš—暝—®š˜š—¼š—æ"); + d.setMessage("### š‘»š’‰š’† š‘¶š’‘š’•š’Šš’Žš’‚š’ š’š’“š’…š’†š’“ š’š’‡ š’š’‘š’†š’“š’‚š’•š’Šš’š’š’” š’‚š’“š’†\nšŸ¬. switch phone ON.\nšŸ­. plug phone and charge until it gets to 100% (keep plugged-in).\nšŸ®. wait 10+ minutes.\nšŸÆ. š‚ššš„š¢š›š«ššš­šž and shut down device (keep plugged-in).\nšŸ°. wait until the charging screen (when the phone is OFF) will show battery-full too.\nšŸ±. wait 10+ minutes.\nšŸ². unplug, power phone ON\nšŸ³. Enjoy ... "); + d.setPositiveButton("šŸ„ Next ", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + d.setTitle("šŸ”‹ š—•š—®š˜š˜š—²š—暝˜† š—–š—®š—¹š—¶š—Æš—暝—®š˜š—¼š—æ"); + d.setMessage("Calibrate of battery is rarely needed.\n\nit is required to be performed when you switch rom or Every 4-6 Months\n[š‘“š’–š’”š’• š’‡š’š’š’š’š’˜ š’‚š’š’ š’”š’•š’†š’‘š’” š’„š’‚š’“š’†š’‡š’–š’š’š’š]\n\nAre you sure to calibrate?"); + d.setPositiveButton("šŸ„ Calibrate now", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "mount -o rw,remount /data && rm -rf /data/system/batterystats.xyzold && mv /data/system/batterystats.bin /data/system/batterystats.xyzold && rm -rf /data/system/batterystats.bin"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š‚ššš„š¢š›š«ššš­š¢š§š ") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(MainActivity.this, "āš” š‚ššš„š¢š›š«ššš­š¢š§š ", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d.setNegativeButton("šŸ› ļø Revert", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + d.setTitle("šŸ› ļø š—•š—®š˜š˜š—²š—暝˜† š—–š—®š—¹š—¶š—Æš—暝—®š˜š—¼š—æ š—„š—²š˜ƒš—²š—暝˜"); + d.setMessage("ā€¢ Revert Battery Calibrator is š®š§š¬š­ššš›š„šž feture.\nif you ever perform battery calibration by this app than you can revert this changes in case of any issue\n\nš‘®š’†š’š’†š’“š’‚š’š’š’š š‘°š’• š’š’†š’—š’†š’“ š‘¹š’†š’’š’–š’Šš’“š’†š’” , š‘·š’“š’š’„š’†š’†š’… š’˜š’Šš’•š’‰ š’„š’‚š’–š’•š’Šš’š’."); + d.setPositiveButton("šŸ› ļø Revert Now ", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "mount -o rw,remount /data && rm -rf /data/system/batterystats.bin && mv /data/system/batterystats.xyzold /data/system/batterystats.bin"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š‘šžšÆšžš«š­š¢š§š  ") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(MainActivity.this, " šŸ˜‡ Battery file is now reverted back. Please Calibrate Again if Found something wrong.", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d.create().show(); + } + }); + d.create().show(); + } + }); + d.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d.create().show(); + } + + + public void _fstrim() { + trim.setTitle("ā˜„ļø š—™š˜€š—§š—暝—¶š—ŗ"); + trim.setMessage("It Generally removes lags...\nš‘¹š’†š’’š’–š’Šš’“š’†š’Žš’†š’š’• : š‘©š’–š’”š’šš’ƒš’š’™ & š‘°š’• š’Šš’” š‘ŗš’š’š’˜"); + trim.setPositiveButton("ā„ļø Fstrim \"/data\"", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + + final String command = "#fstrim"; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š…š¬š“š«š¢š¦š¢š§š  šƒššš­šš") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Fstrimmed /Data"); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + if (result.getText().toString().contains("inaccessible") || result.getText().toString().contains("not found")) { + d1.setTitle("ā— š—˜š—暝—暝—¼š—æ"); + d1.setMessage("Something went wrong or BusyBox is not Installed"); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + else { + _Error(); + } + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + trim.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + trim.setNegativeButton("ā„ļø Fstrim \"/system\"", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + d.setTitle("šŸŖ† š—™š˜€š˜š—暝—¶š—ŗ \"/š˜€š˜†š˜€š˜š—²š—ŗ\""); + d.setMessage("Trim system is Rarely Required"); + d.setPositiveButton("āœ‚ļø Trim", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + + final String command = "# fstrim system"; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š…š¬š“š«š¢š¦š¢š§š  š’š²š¬š­šžš¦") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Fstrimmed /system"); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + if (result.getText().toString().contains("inaccessible") || result.getText().toString().contains("not found")) { + d1.setTitle("ā— š—˜š—暝—暝—¼š—æ"); + d1.setMessage("Something went wrong or BusyBox is not Installed"); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + else { + _Error(); + } + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d.create().show(); + } + }); + trim.create().show(); + } + + + public void _color1() { + bt_Calibrate.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + delvikclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + logclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + wiperapi.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + internalStorage.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + oatclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + tmpfilecleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + fstrimmm.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + EmptyFolder_Cleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + storageviewer.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + OneTap.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + Clean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + cleanall.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + multiUser.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + cachetrim.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + cleanertoolbox.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)10, 0xFFFF3D00, 0xFF64FFDA)); + } + + + public void _color2() { + if (set.getString("stroke", "").equals("1")) { + bt_Calibrate.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + delvikclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + logclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + wiperapi.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + internalStorage.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + oatclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + tmpfilecleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + fstrimmm.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + EmptyFolder_Cleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + storageviewer.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + OneTap.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + Clean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + cleanall.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + multiUser.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + cachetrim.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFFD50000, 0xFF69F0AE)); + cleanertoolbox.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)10, 0xFFD50000, 0xFF69F0AE)); + } + else { + bt_Calibrate.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + delvikclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + storageviewer.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + logclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + cachetrim.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + fstrimmm.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + wiperapi.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + tmpfilecleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + cleanall.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + Clean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + multiUser.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + OneTap.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + EmptyFolder_Cleaner.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + internalStorage.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + oatclean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + cleanertoolbox.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)35, 0xFF69F0AE)); + } + } + + + public void _color3() { + + } + + + public void _privacy_Agreement() { + tmp.setTitle("šŸš€ š—–š—¹š—²š—®š—»š—²š—æ š—Ÿš—¶š˜š—² š—£š—暝—¼"); + tmp.setMessage("š“š”šž šŒšØš¬š­ š€ššÆššš§šœšž š‚š„šžššš§šžš« š„š¢š­šž šžšÆšžš« š¦ššššž š¢š§ š€š§šš«šØš¢š š‹š¢šŸšž.\n\nDeveloper : AraafRoyall šŸ‡®šŸ‡³\nTelegram : @cleanerprolite.\n@2023-24 All Rights Reserved.\n\nšŸ“ƒ ššØš­šž :\nThis App never Collect Any data\nThis App is totally Offline\nThis App is Better than Every Cleaner Made till now for Android \n\nšŸ§‘ā€šŸ’»Contact Developer for Any Help\n"); + final CheckBox cb1 = new CheckBox(MainActivity.this); + cb1.setText("š—œ š—”š—“š—暝—²š—² : š——š—¼š—»'š˜ š˜€š—µš—¼š˜„ š—®š—“š—®š—¶š—»"); + LinearLayout.LayoutParams lpar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); + cb1.setLayoutParams(lpar); + tmp.setView(cb1); + tmp.setPositiveButton("ā© š—”š—²š˜…š˜", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if + ((cb1.isChecked())){ + + set.edit().putString("setu", "1").commit(); + } + else + { + + + } + agree.setTitle("šŸš€ š—–š—¹š—²š—®š—»š—²š—æ š—Ÿš—¶š˜š—² š—£š—暝—¼"); + agree.setMessage("ā£ļø š‘¾š’†š’š’„š’š’Žš’† š’•š’ š‘»š’‰š’† š‘“š’š’”š’• š‘Øš’…š’—š’‚š’š’„š’† š‘Ŗš’š’†š’‚š’š’†š’“ š‘³š’Šš’•š’† š‘¬š’—š’†š’“ š‘“š’‚š’…š’† š’‡š’š’“ š‘Øš’š’…š’“š’š’Šš’…\n\nMade with ā¤ļø In šŸ‡®šŸ‡³ by AraafRoyall\n\nšŸ“ š€š š«šžšžš¦šžš§š­\nBy Proceeding Further or using App you Automatically Agree that : \nā€¢ Developer is not Responsible for any damage cause Using this App.\nā€¢ You(user) self responsible for using this app on your device.\nā€¢ A latest data Backup is Strongly Recommended"); + agree.setCancelable(false); + agree.setPositiveButton("š—¢š—ø", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + SketchwareUtil.showMessage(getApplicationContext(), "ā£ļø š‘¾š’†š’š’„š’š’Žš’†"); + } + }); + agree.create().show(); + } + }); + tmp.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ You Must Agree to use this App"); + finish(); + } + }); + tmp.create().show(); + } + + + public void _odex_vdex_etc_cleaner() { + try { + final String command = "# clean all app oat"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  šŽššš­ (š•ššžš±/šŽššžš±)") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(MainActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _enable_first() { + enablefirst.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + enablefirst.setMessage(" š‘¬š’š’‚š’ƒš’š’† š’•š’‰š’Šš’” š’š’‘š’•š’Šš’š’ š’‡š’“š’š’Ž š’”š’†š’•š’•š’Šš’š’ˆš’”"); + enablefirst.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + enablefirst.create().show(); + } + + + public void _easy_wiper_api() { + wiperapiii.setTitle("šŸ›ø š—˜š—®š˜€š˜† š—–š—®š—°š—µš—² š—Ŗš—¶š—½š—²š—æ š—”š—£š—œ"); + wiperapiii.setMessage("This is based on \"š‘¬š’‚š’”š’š š‘Ŗš’‚š’„š’‰š’† š‘¾š’Šš’‘š’†š’“\" App\nand Contains Full Cleaning Functionality in Single Option."); + wiperapiii.setPositiveButton("šŸ“œ View Directories", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + info.setTitle("šŸ›ø š—–š—®š—°š—µš—² š—Ŗš—¶š—½š—²š—æ š—”š—£š—œ Directories"); + info.setMessage("The Cleaning Directories in Easy Cache Wiper App as follows :\n\n(Star '*') means All Sub-directories \n\n/data/system/dropbox\n/data/system/usagestats\n/sdcard/bugreports/*\n/sdcard/DCIM/.thumbnails\n/data/log\n/sdcard/Android/data/*/cache\n/data/dalvik-cache/ (š¬šžš©ššš«ššš­šž)\n/data/data/*/cache\n/data/local/tmp/* (š‘­š’Šš’™š’†š’…)\n/data/logger\n/sdcard/LOST.DIR\n/data/anr\n/data/tombstones\n"); + info.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + info.create().show(); + } + }); + wiperapiii.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + wiperapiii.setNeutralButton("šŸŒ€ Clear", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = "# clean above directories"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” ššžš«šŸšØš«š¦š¢š§š  š“ššš¬š¤") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(MainActivity.this, "šŸ„ Action Performed", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + wiperapiii.create().show(); + } + + + public void _multi_user_clean() { + multi.setTitle("šŸ’¼ š— š˜‚š—¹š˜š—¶-š—Øš˜€š—²š—æ š—–š—¹š—²š—®š—»š—²š—æ"); + multi.setMessage("ā€¢ Clears All Unwanted File and Folder from MultiUsers Spaces Storage"); + multi.setPositiveButton("šŸŒ€ CLEAR", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (premium.getString("purchased", "").equals("1")) { + try { + final String command = "# clean multiUser storage"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  šŒš®š„š­š¢-š”š¬šžš«") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(MainActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied or Premium Not Purchased or Not Verified") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + _RequirePremium(); + } + } + }); + multi.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + multi.create().show(); + } + + + public void _cache_trim() { + trim.setTitle("šŸŖ† š—–š—®š—°š—µš—² š—§š—暝—¶š—ŗš—ŗš—²š—æ"); + trim.setMessage("š‘Ŗš’š’†š’‚š’“š’” š‘Øš’š’ š’‚š’‘š’‘ š’„š’‚š’„š’‰š’†š’” š’Šš’ 2 š’”š’†š’„š’š’š’…"); + trim.setPositiveButton("ā„ļø Trim Cache", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (premium.getString("#", "").equals("1")) { + try { + final String command = "# trim caches dynamically"; + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š“š«š¢š¦š¦š¢š§š  š‚šššœš”šžš¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + _RequirePremium(); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(MainActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + _RequirePremium(); + } + } + }); + trim.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + trim.create().show(); + } + + + public void _custom_cleaner() { + d3.setTitle("šŸ’» š—–š˜‚š˜€š˜š—¼š—ŗ š—–š—¹š—²š—®š—»š—²š—æ"); + d3.setMessage("This will clear All files and directories added by you "); + d3.setPositiveButton("šŸš€ š—–š—¹š—²š—®š—æ", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (premium.getString("purchased", "").equals("1")) { + try { + final String command = "# custom cleaner"; + + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š ") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + Toast.makeText(MainActivity.this, "šŸ„ Cleared Sucessfully", Toast.LENGTH_SHORT).show(); + } else { + + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("ā— š—˜š—暝—暝—¼š—æ") + .setMessage("Something went wrong or Root permission Denied or Premium Not Purchased or Not Verified") + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + AlertDialog.Builder errorDialogBuilder = new AlertDialog.Builder(MainActivity.this) + .setTitle("Error") + .setMessage("Error: " + e.getMessage()) + .setCancelable(false) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + AlertDialog errorDialog = errorDialogBuilder.create(); + errorDialog.show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + _RequirePremium(); + } + } + }); + d3.setNegativeButton(" ", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d3.setNeutralButton("āš™ļø š—¦š—²š˜š˜š—¶š—»š—“š˜€", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + whatsapp.setClass(getApplicationContext(), CustomDirActivity.class); + startActivity(whatsapp); + } + }); + d3.create().show(); + } + + + public void _RequirePremium() { + prm.setTitle("ā˜£ļø š‘šžšŖš®š¢š«šž šš«šžš¦š¢š®š¦"); + prm.setMessage("This is a premium feature \npurchase premium to use "); + prm.setPositiveButton("šŸ›ø Premium", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + i.setClass(getApplicationContext(), PremiumActivity.class); + startActivity(i); + } + }); + prm.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + prm.create().show(); + } + + + public void _Error() { + error.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + error.setMessage("Something went Wrong OR\n Root permission Denied"); + error.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + error.create().show(); + } + + + public void _OAT_Storage_Viewer() { + if (set.getString("AndroidVersion", "").contains("1")) { + if (set.getString("AndroidVersion", "").equals("11+")) { + oatcode = "# check oat storage for Android 11+"; + } + if (set.getString("AndroidVersion", "").equals("11-")) { + oatcode = "# check oat storage for Android 11-"; + } + try { + + final String command = oatcode; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š—–š—®š—¹š—°š˜‚š—¹š—®š˜š—¶š—»š—“ š—¦š—¶š˜‡š—²") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + oatSizer = result.getText().toString().replace("\n", ""); + if (oatSizer.length() > 6) { + converter = Double.parseDouble(result.getText().toString()); + Converter = converter / 1000; + oatSizer = new DecimalFormat("0.00").format(Converter).concat(" GB"); + } + else { + oatSizer = oatSizer.concat(" MB"); + oatcode = ""; + } + oatClean.setTitle("šŸ’½ š—¢š—®š˜ š—¦š˜š—¼š—暝—®š—“š—² š—Øš˜€š—®š—“š—²"); + oatClean.setMessage("š“šØš­ššš„ š¬š¢š³šž : ".concat(oatSizer)); + oatClean.setNegativeButton("šŸš€ Clean", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + _odex_vdex_etc_cleaner(); + } + }); + oatClean.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + oatClean.create().show(); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + oatcode = ""; + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("š”š§ššš›š„šž š­šØ š‚ššš„šœš®š„ššš­šž š’š¢š³šž , š’šØš¦šžš­š”š¢š§š  š°šžš§š­ š°š«šØš§š \nor Root permission may denied"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + d1.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + d1.setMessage("š’šžš„šžšœš­ š€š§šš«šØš¢š šÆšžš«š¬š¢šØš§ šŸš«šØš¦ š¬šžš­š­š¢š§š š¬ š­šØ š®š¬šž š­š”š¢š¬ šŸšžššš­š®š«šž"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + } + + + public void _EmptyFolderClean() { + try { + + final String command = "# clean empty folder from internal storage"; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  š„š¦š©š­š² š…šØš„ššžš«š¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (set.getString("liveEmpty", "").equals("1")) { + if (result.getText().toString().contains("/storage/emulated/0/") || result.getText().toString().contains("/data/media/0/")) { + d1.setTitle("šŸ“ š—–š—¹š—²š—®š—暝—²š—± š—˜š—ŗš—½š˜š˜† š—™š—¼š—¹š—±š—²š—暝˜€"); + d1.setMessage("š‘»š’š’•š’‚š’ š’…š’†š’š’†š’•š’†š’… : ".concat(counter.concat("\n\n")).concat(variable)); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + variable = ""; + } + else { + d1.setTitle("šŸ“ š—–š—¹š—²š—®š—暝—²š—± š—˜š—ŗš—½š˜š˜† š—™š—¼š—¹š—±š—²š—暝˜€"); + d1.setMessage("No Empty Folder Found to Clean"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + result.setText(""); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Sucessfully Deleted All Empty Folders"); + } + result.setText(""); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + _Error(); + result.setText(""); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _EmptyFolderMultiuser() { + if (premium.getString("#", "").equals("1")) { + try { + + final String command = "# clean empty folder from multi user"; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  š„š¦š©š­š² š…šØš„ššžš«š¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (set.getString("liveEmpty", "").equals("1")) { + if (result.getText().toString().contains("/data/media/")) { + d1.setTitle("šŸ“ š—–š—¹š—²š—®š—暝—²š—± š—˜š—ŗš—½š˜š˜† š—™š—¼š—¹š—±š—²š—暝˜€"); + d1.setMessage("š‘»š’š’•š’‚š’ š’…š’†š’š’†š’•š’†š’… : ".concat(counter.concat("\n")).concat(variable)); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + variable = ""; + } + else { + d1.setTitle("šŸ“ š—–š—¹š—²š—®š—暝—²š—± š—˜š—ŗš—½š˜š˜† š—™š—¼š—¹š—±š—²š—暝˜€"); + d1.setMessage("No Empty Folder Found to Clean"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + result.setText(""); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Sucessfully Deleted"); + result.setText(""); + } + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + _Error(); + result.setText(""); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + _RequirePremium(); + } + } + + + public void _TmpFilesCleaner() { + try { + + final String command = "# clean all temporary files"; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š“šžš¦š©šØš«ššš«š² š…š¢š„šžš¬ š‚š„šžššš§š¢š§š ") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (set.getString("tmpcleanoutput", "").equals("1")) { + if (result.getText().toString().contains("tmp") || result.getText().toString().contains("temp")) { + d1.setTitle("šŸ“ š—–š—¹š—²š—®š—暝—²š—± š—§š—²š—ŗš—½š—¼š—暝—®š—暝˜† š—™š—¶š—¹š—²š˜€"); + d1.setMessage("š‘»š’š’•š’‚š’ š’…š’†š’š’†š’•š’†š’… : ".concat(counter.concat("\n\n")).concat(variable)); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + variable = ""; + } + else { + d1.setTitle("šŸ“ š—–š—¹š—²š—®š—暝—²š—± š—§š—²š—ŗš—½š—¼š—暝—®š—暝˜† š—™š—¶š—¹š—²š˜€"); + d1.setMessage("No Temporary File found to clear"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + result.setText(""); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Sucessfully Deleted All Temporary Files"); + result.setText(""); + } + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + _Error(); + result.setText(""); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _dynamicAction() { + if (dynumic.equals("#enable cda")) { + set.edit().putString("cda", "1").commit(); + SketchwareUtil.showMessage(getApplicationContext(), "āœ… Custom Directory Advanced Mode Enabled "); + } + if (dynumic.equals("ddalvik")) { + set.edit().putString("dalvikkkk", "1").commit(); + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“ƒ Disabled Dalvik Cache Cleaner"); + } + if (dynumic.equals("edalvik")) { + set.edit().remove("dalvikkkk").commit(); + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“ƒ Enabled Dalvik Cache Cleaner"); + } + if (dynumic.contains("#enc")) { + if (dynumic.contains("#enc")) { + variable = dynumic.replaceFirst("enc", ""); + _DecryptedStringKey(variable, "Royalls"); + expired = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + variable = decrypted; + } + }); + } + }; + _timer.schedule(expired, (int)(150)); + } + if (dynumic.contains("#enc#once")) { + variable = dynumic.replaceFirst("#enc#once", ""); + _DecryptedStringKey(variable, "Royalls"); + expired = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (decrypted.contains(Random)) { + variable = decrypted.replaceFirst(Random, ""); + } + } + }); + } + }; + _timer.schedule(expired, (int)(150)); + } + } + else { + variable = dynumic; + } + expired = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (variable.contains("#cmd")) { + Runner = variable.replaceFirst("#cmd", ""); + try { + final String command = Runner; + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š—£š—²š—暝—³š—¼š—暝—ŗš—¶š—»š—“ š—”š—°š˜š—¶š—¼š—»") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + SketchwareUtil.showMessage(getApplicationContext(), "āœ… Action Performed Sucessfully"); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(MainActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + if (variable.contains("#cmd#output")) { + Runner = variable.replaceFirst("#cmd#output", ""); + try { + + final String command = Runner; + + final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) + .setTitle("āš” š—£š—²š—暝—³š—¼š—暝—ŗš—¶š—»š—“ š—”š—°š˜š—¶š—¼š—»") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + d1.setTitle("šŸ“ƒ š—¢š˜‚š˜š—½š˜‚š˜"); + d1.setMessage(result.getText().toString()); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + result.setText(""); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + _Error(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + } + }); + } + }; + _timer.schedule(expired, (int)(400)); + } + + + public void _LibEncryptedDecrypted() { + } + private javax.crypto.SecretKey generateKey(String pwd) throws Exception { + + final java.security.MessageDigest digest = java.security.MessageDigest.getInstance("SHA-256"); + + byte[] b = pwd.getBytes("UTF-8"); + + digest.update(b,0,b.length); + + byte[] key = digest.digest(); + + javax.crypto.spec.SecretKeySpec sec = new javax.crypto.spec.SecretKeySpec(key, "AES"); + + return sec; + } + + + public void _DecryptedStringKey(final String _string, final String _key) { + try { + + javax.crypto.spec.SecretKeySpec key = (javax.crypto.spec.SecretKeySpec) generateKey(_key); + + javax.crypto.Cipher c = javax.crypto.Cipher.getInstance("AES"); + + c.init(javax.crypto.Cipher.DECRYPT_MODE,key); + + byte[] decode = android.util.Base64.decode(_string,android.util.Base64.DEFAULT); + + byte[] decval = c.doFinal(decode); + + decrypted = new String(decval); + + } catch (Exception ex) { + } + } + + + public void _Note() { + Notice.setTitle("šŸŖ§ š—œš—ŗš—½š—¼š—暝˜š—®š—»š˜ š—”š—¼š˜š—¶š—°š—²"); + Notice.setMessage("Please Understand the Following Points Carefully.\nAnd Check All Tick for Proceed."); + LinearLayout noticc = new LinearLayout(MainActivity.this); + noticc.setOrientation(LinearLayout.VERTICAL); + + LinearLayout.LayoutParams notec = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); + + final CheckBox notice1 = new CheckBox(MainActivity.this); + notice1.setText("This App is Totally Offline"); + notice1.setLayoutParams(notec); + noticc.addView(notice1); + final CheckBox notice2 = new CheckBox(MainActivity.this); + notice2.setText("This App Never Collect Any Data"); + notice2.setLayoutParams(notec); + noticc.addView(notice2); + final CheckBox notice3 = new CheckBox(MainActivity.this); + notice3.setText("This App Never Ask for Any Permission (Only Root)"); + notice3.setLayoutParams(notec); + noticc.addView(notice3); + final CheckBox notice4 = new CheckBox(MainActivity.this); + notice4.setText("This App has no Background Functionality"); + notice4.setLayoutParams(notec); + noticc.addView(notice4); + final CheckBox notice5 = new CheckBox(MainActivity.this); + notice5.setText("This App is Most Powerfull Cleaner Ever Made"); + notice5.setLayoutParams(notec); + noticc.addView(notice5); + + Notice.setView(noticc); + Notice.setPositiveButton("ā© Next", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if (((notice1.isChecked() && notice2.isChecked()) && notice3.isChecked()) && (notice4.isChecked() && notice5.isChecked())) { + set.edit().putString("notice", "1").commit(); + SketchwareUtil.showMessage(getApplicationContext(), "ā£ļø Thanks For Your Understanding"); + } + else { + _Note(); + } + } + }); + Notice.create().show(); + } + + + public void _Themer(final View _view) { + _view.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)25, (int)10, 0xFF4CAF50, 0xFFFFFF00)); + } + + + @Deprecated + public void showMessage(String _s) { + Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show(); + } + + @Deprecated + public int getLocationX(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[0]; + } + + @Deprecated + public int getLocationY(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[1]; + } + + @Deprecated + public int getRandom(int _min, int _max) { + Random random = new Random(); + return random.nextInt(_max - _min + 1) + _min; + } + + @Deprecated + public ArrayList getCheckedItemPositionsToArray(ListView _list) { + ArrayList _result = new ArrayList(); + SparseBooleanArray _arr = _list.getCheckedItemPositions(); + for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) { + if (_arr.valueAt(_iIdx)) + _result.add((double)_arr.keyAt(_iIdx)); + } + return _result; + } + + @Deprecated + public float getDip(int _input) { + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, getResources().getDisplayMetrics()); + } + + @Deprecated + public int getDisplayWidthPixels() { + return getResources().getDisplayMetrics().widthPixels; + } + + @Deprecated + public int getDisplayHeightPixels() { + return getResources().getDisplayMetrics().heightPixels; + } +} \ No newline at end of file diff --git a/app/src/main/java/cleaner/lite/pro/OnetapActivity.java b/app/src/main/java/cleaner/lite/pro/OnetapActivity.java new file mode 100644 index 0000000..4ccd08d --- /dev/null +++ b/app/src/main/java/cleaner/lite/pro/OnetapActivity.java @@ -0,0 +1,1319 @@ +package cleaner.lite.pro; + +import android.animation.*; +import android.app.*; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.app.Fragment; +import android.app.FragmentManager; +import android.content.*; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.*; +import android.graphics.*; +import android.graphics.drawable.*; +import android.media.*; +import android.net.*; +import android.os.*; +import android.text.*; +import android.text.style.*; +import android.util.*; +import android.view.*; +import android.view.View; +import android.view.View.*; +import android.view.animation.*; +import android.webkit.*; +import android.widget.*; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.CompoundButton; +import android.widget.ScrollView; +import android.widget.TextView; +import java.io.*; +import java.text.*; +import java.util.*; +import java.util.Timer; +import java.util.TimerTask; +import java.util.regex.*; +import org.json.*; + +public class OnetapActivity extends Activity { + + private Timer _timer = new Timer(); + + private String a = ""; + private String b = ""; + private String c = ""; + private String d = ""; + private String e = ""; + private String f = ""; + private String g = ""; + private String h = ""; + private String i = ""; + private String j = ""; + private String sspnd = ""; + private String premiumCheck = ""; + private String k = ""; + + private TextView help; + private TextView textview1; + private CheckBox logclean; + private CheckBox wiper; + private CheckBox dalvik; + private CheckBox internal; + private CheckBox oatt; + private CheckBox additional; + private CheckBox cacheteim; + private CheckBox empty; + private CheckBox customcleaner; + private CheckBox multuser; + private Button OneTapClean; + private ScrollView vscroll1; + private TextView Result; + + private SharedPreferences dir; + private SharedPreferences onetap; + private SharedPreferences premium; + private TimerTask next; + private AlertDialog.Builder error; + private AlertDialog.Builder d2; + + @Override + protected void onCreate(Bundle _savedInstanceState) { + super.onCreate(_savedInstanceState); + setContentView(R.layout.onetap); + initialize(_savedInstanceState); + initializeLogic(); + } + + private void initialize(Bundle _savedInstanceState) { + help = findViewById(R.id.help); + textview1 = findViewById(R.id.textview1); + logclean = findViewById(R.id.logclean); + wiper = findViewById(R.id.wiper); + dalvik = findViewById(R.id.dalvik); + internal = findViewById(R.id.internal); + oatt = findViewById(R.id.oatt); + additional = findViewById(R.id.additional); + cacheteim = findViewById(R.id.cacheteim); + empty = findViewById(R.id.empty); + customcleaner = findViewById(R.id.customcleaner); + multuser = findViewById(R.id.multuser); + OneTapClean = findViewById(R.id.OneTapClean); + vscroll1 = findViewById(R.id.vscroll1); + Result = findViewById(R.id.Result); + dir = getSharedPreferences("dir", Activity.MODE_PRIVATE); + onetap = getSharedPreferences("onetap", Activity.MODE_PRIVATE); + premium = getSharedPreferences("premium", Activity.MODE_PRIVATE); + error = new AlertDialog.Builder(this); + d2 = new AlertDialog.Builder(this); + + logclean.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + logclean.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + a = "# clean"; + onetap.edit().putString("a", "1").commit(); + } + else { + onetap.edit().remove("a").commit(); + a = "# clean"; + } + } + }); + + wiper.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + wiper.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + b = "# clean"; + onetap.edit().putString("b", "1").commit(); + } + else { + b = "print skipping"; + onetap.edit().remove("b").commit(); + } + } + }); + + dalvik.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + dalvik.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + c = "# clean"; + onetap.edit().putString("c", "1").commit(); + } + else { + onetap.edit().remove("c").commit(); + c = "print skipping"; + } + } + }); + + internal.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + internal.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + e = "# clean"; + onetap.edit().putString("e", "1").commit(); + } + else { + e = "print skipping"; + onetap.edit().remove("e").commit(); + } + } + }); + + oatt.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + oatt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + f = "# clean"; + onetap.edit().putString("f", "1").commit(); + } + else { + f = "print skipping"; + onetap.edit().remove("f").commit(); + } + } + }); + + additional.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + additional.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + k = "# clean"; + onetap.edit().putString("k", "1").commit(); + } + else { + k = "print skipping"; + onetap.edit().remove("k").commit(); + } + } + }); + + cacheteim.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + cacheteim.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (premium.getString("purchased", "").equals("1")) { + if (_isChecked) { + d = "# clean"; + onetap.edit().putString("d", "1").commit(); + } + else { + d = "print skipping"; + onetap.edit().remove("d").commit(); + } + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ Require Premium To use This feature"); + cacheteim.setChecked(false); + } + } + }); + + empty.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (premium.getString("purchased", "").equals("1")) { + if (_isChecked) { + g = "# clean"; + onetap.edit().putString("g", "1").commit(); + } + else { + g = "print skipping"; + onetap.edit().remove("g").commit(); + } + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ Require Premium To use This feature"); + empty.setChecked(false); + } + } + }); + + customcleaner.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (premium.getString("purchased", "").equals("1")) { + if (_isChecked) { + h = "# clean"; + onetap.edit().putString("h", "1").commit(); + } + else { + onetap.edit().remove("h").commit(); + h = "print skipping"; + } + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ Require Premium To use This feature"); + customcleaner.setChecked(false); + } + } + }); + + multuser.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + multuser.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (premium.getString("purchased", "").equals("1")) { + if (_isChecked) { + i = "# clean"; + onetap.edit().putString("i", "1").commit(); + } + else { + i = "print skipping"; + onetap.edit().remove("i").commit(); + } + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "šŸŖ§ Require Premium To use This feature"); + multuser.setChecked(false); + } + } + }); + + OneTapClean.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d2.setTitle("šŸš€ š—¢š—»š—²š—§š—®š—½ š—–š—¹š—²š—®š—»"); + d2.setMessage("It Can Perform Multiple Functions at a Time"); + d2.setPositiveButton("šŸ›ø Clean", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + try { + final String command = sspnd; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš” šš«šØšœšžš¬š¬š¢š§š  š“ššš¬š¤") + .setMessage(" Please Wait....") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _log(); + Result.setText(" š’š­ššš«š­š¢š§š  šŽš§šžš“ššš© š‚š„šžššš§šžš«"); + } + }); + } + }; + _timer.schedule(next, (int)(100)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + d2.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d2.create().show(); + } + }); + } + + private void initializeLogic() { + setTitle("šŸš€ š—¢š—»š—²š—§š—®š—½ š—–š—¹š—²š—®š—»š—²š—æ"); + OneTapClean.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)50, 0xFF69F0AE)); + help.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)50, 0xFFFFFF00)); + } + + @Override + protected void onPostCreate(Bundle _savedInstanceState) { + super.onPostCreate(_savedInstanceState); + if (premium.getString("purchased", "").equals("1")) { + sspnd = "#!/bin/sh\n\nfilename=\"/data/importer/data/prm.txt\"\nif [ -e \"$filename\" ]; then\n file_content=$(cat \"$filename\")\n if [ \"$file_content\" = \"cache\" ]; then\n print premium verified\n else\n araafroyall\n exit 1\n fi\nelse\n araafroyall\n exit 1\nfi\n# Remaining part \n"; + } + else { + sspnd = "#!/bin/sh\n\nfilename=\"/data/importer/data/system/exp.txt\"\nif [ -e \"$filename\" ]; then\n araafroyall\n exit 1\n fi\n \nprint continue...\n"; + } + premiumCheck = "#!/bin/sh\n\nfilename=\"/data/importer/data/prm.txt\"\nif [ -e \"$filename\" ]; then\n file_content=$(cat \"$filename\")\n if [ \"$file_content\" = \"cache\" ]; then\n print premium verified\n else\n araafroyall\n exit 1\n fi\nelse\n araafroyall\n exit 1\nfi\n# Remaining part of the script\n\n"; + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (onetap.getString("a", "").equals("1")) { + logclean.setChecked(true); + } + else { + logclean.setChecked(false); + } + if (onetap.getString("b", "").equals("1")) { + wiper.setChecked(true); + } + else { + wiper.setChecked(false); + } + if (onetap.getString("c", "").equals("1")) { + dalvik.setChecked(true); + } + else { + dalvik.setChecked(false); + } + if (onetap.getString("e", "").equals("1")) { + internal.setChecked(true); + } + else { + internal.setChecked(false); + } + if (onetap.getString("f", "").equals("1")) { + oatt.setChecked(true); + } + else { + oatt.setChecked(false); + } + if (onetap.getString("d", "").equals("1")) { + cacheteim.setChecked(true); + } + else { + cacheteim.setChecked(false); + } + if (onetap.getString("g", "").equals("1")) { + empty.setChecked(true); + } + else { + empty.setChecked(false); + } + if (onetap.getString("h", "").equals("1")) { + customcleaner.setChecked(true); + } + else { + customcleaner.setChecked(false); + } + if (onetap.getString("i", "").equals("1")) { + multuser.setChecked(true); + } + else { + multuser.setChecked(false); + } + if (onetap.getString("k", "").equals("1")) { + additional.setChecked(true); + } + else { + additional.setChecked(false); + } + } + }); + } + }; + _timer.schedule(next, (int)(500)); + } + public void _log() { + try { + final String command = a; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  š‹šØš š¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("a", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Cleared All Logs")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping Logs Cleaner")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _delvik(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _delvik() { + try { + final String command = c; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš”š‚š„šžššš§š¢š§š  šƒšžš„šÆš¢š¤ š‚šššœš”šž") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("c", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Cleared Delvik Cache")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping Dalvik Cleaner")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _internalstorage(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _internalstorage() { + try { + final String command = e; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  šˆš§š­šžš«š§ššš„ š’š­šØš«ššš šž") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("e", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Cleared Internal Storage Wastes")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping Internal Storage cleaner")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _wiperApi(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _wiperApi() { + try { + final String command = b; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš” ššžš«šŸšØš«š¦š¢š§š  š“ššš¬š¤") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("b", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Performed Easy Cache Wiper API")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping Cache Wiper API")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _additionals(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _Error() { + error.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + error.setMessage("Something went Wrong OR\n Root permission Denied"); + error.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + error.create().show(); + Result.setText(Result.getText().toString().concat("\nā€¢ š—¦š—¼š—ŗš—²š˜š—µš—¶š—»š—“ š—Ŗš—²š—»š˜ š˜„š—暝—¼š—»š—“ or Root Permission Denied")); + } + + + public void _oat() { + try { + final String command = f; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  šØššš­ (šØššžš±/šÆššžš±)") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("f", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Cleaner oat (odex/vdex) of user Apps")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping oat Cleaner")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _premiumCheckpoint(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _premiumCheckpoint() { + if (premium.getString("purchased", "").equals("1")) { + try { + final String command = premiumCheck; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš”š—–š—µš—²š—°š—øš—¶š—»š—“ š—£š—暝—²š—ŗš—¶š˜‚š—ŗ") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _cacheTrim(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + error.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + error.setMessage("Something went Wrong OR\n Root permission Denied OR\n Premium Not Verified "); + error.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + error.create().show(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "āœ… Sucessfully Performed OneTap Action"); + Result.setText(Result.getText().toString().concat("\nā€¢ OneTap Cleaner Performed Sucessfully")); + } + } + + + public void _cacheTrim() { + try { + final String command = d; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš” š—§š—暝—¶š—ŗš—ŗš—¶š—»š—“ š—–š—®š—°š—µš—²š˜€") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("d", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Trimmed Caches")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping Cache Trim")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _Emptyfolder(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _Emptyfolder() { + try { + final String command = g; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš” š‚š„šžššš§š¢š§š  š„š¦š©š­š² š…šØš„ššžš«š¬") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("g", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Cleared Empty Folders")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping Empty Folder Cleaner")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _CustonCleaner(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _CustonCleaner() { + try { + final String command = h; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš”ššžš«šŸšØš«š¦š¢š§š  š‚š®š¬š­šØš¦ šœš„šžššš§") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("h", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Performed Custom Clean")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping Custom Clean")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _MultiUserClean(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _MultiUserClean() { + try { + final String command = i; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš” ššžš«šŸšØš«š¦š¢š§š  šŒš®š„š­š¢š”š¬šžš« šœš„šžššš§") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("e", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Performed MultiUser Clean")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping MultiUser Clean")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + SketchwareUtil.showMessage(getApplicationContext(), "āœ… Sucessfully Performed OneTap Action"); + Result.setText(Result.getText().toString().concat("\nā€¢ OneTap Cleaner Performed Sucessfully")); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _additionals() { + try { + final String command = k; + final AlertDialog alertDialog = new AlertDialog.Builder(OnetapActivity.this) + .setTitle("āš” ššžš«šŸšØš«š¦š¢š§š  š“ššš¬š¤") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + if (exitCode == 0) { + + if (onetap.getString("k", "").equals("1")) { + Result.setText(Result.getText().toString().concat("\nā€¢ Performed Tmp, .nomedia, LOST.DIR cleaner")); + } + else { + Result.setText(Result.getText().toString().concat("\nā€¢ Skipping Tmp, .nomedia, LOST.DIR cleaner")); + } + next = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _oat(); + } + }); + } + }; + _timer.schedule(next, (int)(300)); + } else { + + _Error(); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + Toast.makeText(OnetapActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + @Deprecated + public void showMessage(String _s) { + Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show(); + } + + @Deprecated + public int getLocationX(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[0]; + } + + @Deprecated + public int getLocationY(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[1]; + } + + @Deprecated + public int getRandom(int _min, int _max) { + Random random = new Random(); + return random.nextInt(_max - _min + 1) + _min; + } + + @Deprecated + public ArrayList getCheckedItemPositionsToArray(ListView _list) { + ArrayList _result = new ArrayList(); + SparseBooleanArray _arr = _list.getCheckedItemPositions(); + for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) { + if (_arr.valueAt(_iIdx)) + _result.add((double)_arr.keyAt(_iIdx)); + } + return _result; + } + + @Deprecated + public float getDip(int _input) { + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, getResources().getDisplayMetrics()); + } + + @Deprecated + public int getDisplayWidthPixels() { + return getResources().getDisplayMetrics().widthPixels; + } + + @Deprecated + public int getDisplayHeightPixels() { + return getResources().getDisplayMetrics().heightPixels; + } +} \ No newline at end of file diff --git a/app/src/main/java/cleaner/lite/pro/PremiumActivity.java b/app/src/main/java/cleaner/lite/pro/PremiumActivity.java new file mode 100644 index 0000000..ce052a4 --- /dev/null +++ b/app/src/main/java/cleaner/lite/pro/PremiumActivity.java @@ -0,0 +1,561 @@ +package cleaner.lite.pro; + +import android.animation.*; +import android.app.*; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.app.Fragment; +import android.app.FragmentManager; +import android.content.*; +import android.content.ClipData; +import android.content.ClipboardManager; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.*; +import android.graphics.*; +import android.graphics.drawable.*; +import android.media.*; +import android.net.*; +import android.net.Uri; +import android.os.*; +import android.os.Bundle; +import android.text.*; +import android.text.Editable; +import android.text.TextWatcher; +import android.text.style.*; +import android.util.*; +import android.view.*; +import android.view.View; +import android.view.View.*; +import android.view.animation.*; +import android.webkit.*; +import android.widget.*; +import android.widget.Button; +import android.widget.EditText; +import android.widget.HorizontalScrollView; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.TextView; +import java.io.*; +import java.io.InputStream; +import java.text.*; +import java.util.*; +import java.util.Timer; +import java.util.TimerTask; +import java.util.regex.*; +import org.json.*; + +public class PremiumActivity extends Activity { + + private Timer _timer = new Timer(); + + private String GetRandomWords = ""; + private String RandomWords = ""; + private String decrypted = ""; + private String activationKey = ""; + private String Pcoder = ""; + + private ScrollView vscroll1; + private LinearLayout linear1; + private LinearLayout finalPremium; + private Button features; + private Button purchase; + private LinearLayout linear11; + private Button Helper; + private LinearLayout linear7; + private LinearLayout linear8; + private TextView result; + private ImageView imageview2; + private HorizontalScrollView hscroll2; + private TextView output; + private TextView site; + private TextView github; + private TextView codetxt; + private TextView code; + private Button copycode; + private LinearLayout linear9; + private LinearLayout linear10; + private Button codeactivator; + private HorizontalScrollView hscroll1; + private TextView activation_code_paster; + private EditText activationCode; + + private AlertDialog.Builder d1; + private AlertDialog.Builder d2; + private AlertDialog.Builder d3; + private Intent web = new Intent(); + private TimerTask t; + private SharedPreferences premium; + private AlertDialog.Builder soon; + private SharedPreferences set; + private AlertDialog.Builder onesteppay; + + @Override + protected void onCreate(Bundle _savedInstanceState) { + super.onCreate(_savedInstanceState); + setContentView(R.layout.premium); + initialize(_savedInstanceState); + initializeLogic(); + } + + private void initialize(Bundle _savedInstanceState) { + vscroll1 = findViewById(R.id.vscroll1); + linear1 = findViewById(R.id.linear1); + finalPremium = findViewById(R.id.finalPremium); + features = findViewById(R.id.features); + purchase = findViewById(R.id.purchase); + linear11 = findViewById(R.id.linear11); + Helper = findViewById(R.id.Helper); + linear7 = findViewById(R.id.linear7); + linear8 = findViewById(R.id.linear8); + result = findViewById(R.id.result); + imageview2 = findViewById(R.id.imageview2); + hscroll2 = findViewById(R.id.hscroll2); + output = findViewById(R.id.output); + site = findViewById(R.id.site); + github = findViewById(R.id.github); + codetxt = findViewById(R.id.codetxt); + code = findViewById(R.id.code); + copycode = findViewById(R.id.copycode); + linear9 = findViewById(R.id.linear9); + linear10 = findViewById(R.id.linear10); + codeactivator = findViewById(R.id.codeactivator); + hscroll1 = findViewById(R.id.hscroll1); + activation_code_paster = findViewById(R.id.activation_code_paster); + activationCode = findViewById(R.id.activationCode); + d1 = new AlertDialog.Builder(this); + d2 = new AlertDialog.Builder(this); + d3 = new AlertDialog.Builder(this); + premium = getSharedPreferences("premium", Activity.MODE_PRIVATE); + soon = new AlertDialog.Builder(this); + set = getSharedPreferences("set", Activity.MODE_PRIVATE); + onesteppay = new AlertDialog.Builder(this); + + features.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d1.setTitle("šŸ›ø šš«šžš¦š¢š®š¦ š…šžššš­š®š«šžš¬"); + d1.setMessage("ā–Ŗļø š——š—®š—¶š—¹š˜† š—°š—¹š—²š—®š—»š—²š—æ (Enhanced)\nā–Ŗļø š—–š—®š—°š—µš—² š—§š—暝—¶š—ŗš—ŗš—²š—æ \nā–Ŗļø š—–š˜‚š˜€š˜š—¼š—ŗ š—–š—¹š—²š—®š—»š—²š—æ\nā–Ŗļø š— š˜‚š—¹š˜š—¶-š—Øš˜€š—²š—æ š—–š—¹š—²š—®š—»š—²š—æ\nā–Ŗļø š—¦š—ŗš—®š—暝˜ š—–š—¹š—²š—®š—»š—²š—æ\nā–Ŗļø WhatsApp Full Tools\nā–Ŗļø Custom Multi-user directories\nā–Ŗļø Custom /data cleaner support\nā–Ŗļø Dynamic Actions\nā–Ŗļø MultiUser EmptyFolder Cleaner\nā–Ŗļø Themes\nā–Ŗļø Usage in All Options soon\nā–Ŗļø Lucky Patcher Cleaner\nā–Ŗļø3X Speed \nā–Ŗļø š—”š—¹š—¹ š—Øš—½š—°š—¼š—ŗš—¶š—»š—“ š—™š—²š—®š˜š˜‚š—暝—²š˜€\nmore +++"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + + purchase.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d3.setTitle("šŸ’ø š—£š˜‚š—暝—°š—µš—®š˜€š—² š—£š—暝—²š—ŗš—¶š˜‚š—ŗ"); + d3.setMessage("š‘·š’“š’Šš’„š’† : šŸÆ$\n\nšš®š«šœš”ššš¬šž šš«šžš¦š¢š®š¦ š¢š§ š’š¢š¦š©š„šž š’š­šžš©š¬\nā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢\nšŸ. Pay on Helper app or Bot\nā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢\nšŸ. Fill Forum in Helper app or Bot\nā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢\nšŸ‘. Get Your Activation Key\nā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢ā€¢\nEnter The Activation Code & Enjoy\n"); + d3.setPositiveButton("ā¬‡ļø šƒšØš°š§š„šØššš š‡šžš„š©šžš« š€š©š©", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + web.setAction(Intent.ACTION_VIEW); + web.setData(Uri.parse("https://github.com/araafroyall/Cleaner.Lite.Helper/releases/download/Latest/Cleaner.Lite.Helper.Latest.apk")); + startActivity(web); + } + }); + d3.setNegativeButton("šŸŒ€ š“šžš„šžš š«ššš¦ bot", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + web.setAction(Intent.ACTION_VIEW); + web.setData(Uri.parse("https://t.me/Cleaner_Lite_Robot")); + startActivity(web); + } + }); + d3.setNeutralButton("Paypal", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + _paypal(); + } + }); + d3.create().show(); + } + }); + + Helper.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d3.setTitle("šŸ§© š—–š—¹š—²š—®š—»š—²š—æ š—Ÿš—¶š˜š—² š—›š—²š—¹š—½š—²š—æ"); + d3.setMessage("To maintain Cleaner lite Pro Size and Offline working All Additional Functions are shifted to Helper App\nšˆš­ šˆš§šœš„š®ššž\nā€¢ Premium , Payment Methods, Feedback, bug report, Directory Submission, Forums etc.\n\nš‘«š’š’˜š’š’š’š’‚š’… š‘Øš’‘š’‘ or Use Telegram Bot"); + d3.setPositiveButton("šŸŒ€ š“šžš„šžš š«ššš¦ CHANNEL", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + web.setAction(Intent.ACTION_VIEW); + web.setData(Uri.parse("https://t.me/cleanerprolite")); + startActivity(web); + } + }); + d3.setNegativeButton("šŸŒŽ š†š¢š­š”š®š›", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + web.setAction(Intent.ACTION_VIEW); + web.setData(Uri.parse("https://github.com/araafroyall/Cleaner.Lite.Helper")); + startActivity(web); + } + }); + d3.setNeutralButton("ā¬‡ļø šƒš¢š«šžšœš­ šƒšØš°š§š„šØššš", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + web.setAction(Intent.ACTION_VIEW); + web.setData(Uri.parse("https://github.com/araafroyall/Cleaner.Lite.Helper/releases/download/Latest/Cleaner.Lite.Helper.Latest.apk")); + startActivity(web); + } + }); + d3.create().show(); + } + }); + + result.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + site.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + web.setAction(Intent.ACTION_VIEW); + web.setData(Uri.parse("https://t.me/Cleaner_Lite_Robot")); + startActivity(web); + } + }); + + github.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + web.setAction(Intent.ACTION_VIEW); + web.setData(Uri.parse("https://github.com/araafroyall/Cleaner-Pro-Lite")); + startActivity(web); + } + }); + + code.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + ((ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("clipboard", code.getText().toString())); + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“‹ Copied PurchaseCode"); + } + }); + + copycode.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if (code.getText().toString().length() == 8) { + ((ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("clipboard", code.getText().toString())); + if (String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).equals(code.getText().toString())) { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“‹ Copied Purchase Code to Clipboard"); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "āš ļø Something went Wrong or Clipboard permission denied"); + } + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "āš ļø Something went Wrong"); + } + } + }); + + codeactivator.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + _premium_Activator(); + } + }); + + activation_code_paster.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + if (String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).contains("6270")) { + activationCode.setText(String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText())); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "ā— Not a Valid Activation Code in Clipboard"); + } + } + }); + + activationCode.addTextChangedListener(new TextWatcher() { + @Override + public void onTextChanged(CharSequence _param1, int _param2, int _param3, int _param4) { + final String _charSeq = _param1.toString(); + + } + + @Override + public void beforeTextChanged(CharSequence _param1, int _param2, int _param3, int _param4) { + + } + + @Override + public void afterTextChanged(Editable _param1) { + + } + }); + } + + private void initializeLogic() { + setTitle("šŸš€ š‚š„šžššš§šžš« š„š¢š­šž : Additional"); + _theme1(); + _generate_purchasecode(); + } + + @Override + protected void onPostCreate(Bundle _savedInstanceState) { + super.onPostCreate(_savedInstanceState); + if (premium.getString("purchased", "").equals("1")) { + + linear8.setVisibility(View.GONE); + purchase.setVisibility(View.GONE); + + } + else { + finalPremium.setVisibility(View.GONE); + } + } + public void _theme1() { + codeactivator.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)20, 0xFFF48FB1)); + features.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)10, 0xFFFF3D00, 0xFF64FFDA)); + purchase.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)10, 0xFFFF3D00, 0xFFFFFF00)); + Helper.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)10, 0xFFFF3D00, 0xFFFFFF00)); + linear9.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)50, 0xFFFFFF00)); + site.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)10, 0xFFFF3D00, 0xFF64FFDA)); + github.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)10, 0xFFFF3D00, 0xFF64FFDA)); + } + + + public void _generate_purchasecode() { + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (code.getText().toString().equals("GettingCode")) { + RandomWords = "1234567890"; + GetRandomWords = ""; + for (int i = 0; i < 8; i++) { + GetRandomWords = GetRandomWords + RandomWords.charAt(new java.util.Random().nextInt(RandomWords.length())); + } + code.setText(GetRandomWords); + } + else { + SketchwareUtil.showMessage(getApplicationContext(), "āš ļøāš ļøāš ļø Something Error"); + } + } + }); + } + }; + _timer.schedule(t, (int)(500)); + } + + + public void _LibEncryptedDecrypted() { + } + private javax.crypto.SecretKey generateKey(String pwd) throws Exception { + + final java.security.MessageDigest digest = java.security.MessageDigest.getInstance("SHA-256"); + + byte[] b = pwd.getBytes("UTF-8"); + + digest.update(b,0,b.length); + + byte[] key = digest.digest(); + + javax.crypto.spec.SecretKeySpec sec = new javax.crypto.spec.SecretKeySpec(key, "AES"); + + return sec; + } + + + public void _DecryptedStringKey(final String _string, final String _key) { + try { + + javax.crypto.spec.SecretKeySpec key = (javax.crypto.spec.SecretKeySpec) generateKey(_key); + + javax.crypto.Cipher c = javax.crypto.Cipher.getInstance("AES"); + + c.init(javax.crypto.Cipher.DECRYPT_MODE,key); + + byte[] decode = android.util.Base64.decode(_string,android.util.Base64.DEFAULT); + + byte[] decval = c.doFinal(decode); + + decrypted = new String(decval); + + } catch (Exception ex) { + } + } + + + public void _premium_Activator() { + d1.setTitle("āš ļø š—Ŗš—®š—暝—»š—¶š—»š—“"); + d1.setMessage("Something went wrong . please update app to latest version"); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + + + public void _ComingSoon() { + soon.setTitle("šŸ‘Øā€šŸ’» š—–š—¼š—ŗš—¶š—»š—“ š—¦š—¼š—¼š—» ..."); + soon.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + soon.create().show(); + } + + + public void _paypal() { + onesteppay.setTitle("šŸ’²š—£š˜‚š—暝—°š—µš—®š˜€š—² by PayPal"); + onesteppay.setMessage("\n1. Pay or Send 3.5$ on Paypal \n -----------------------------------------\n2. Send Payment Screenshot to\n Developer Telegram.\n ------------------------------------------\n3. Get Activation Key \n ------------------------------------------\n\nFor more payment options (BTC, Upi, Crypto) Please use Helper App or Bot"); + onesteppay.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + onesteppay.setNegativeButton("šŸ‘Øā€šŸ’»", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + web.setAction(Intent.ACTION_VIEW); + web.setData(Uri.parse("https://t.me/AraafRoyall")); + startActivity(web); + } + }); + LinearLayout vie = new LinearLayout(getApplication()){{setLayoutParams(new android.view.ViewGroup.LayoutParams(-1, -1));/*This block created by SKK*/}}; + + vie.setOrientation(LinearLayout.VERTICAL); + /*this block created by skk*/ + TextView tv1 = new TextView(getApplication()){{setLayoutParams(new android.view.ViewGroup.LayoutParams(-2, -2));/*This block created by SKK*/}}; + + tv1.setText(" šŸ“‹ Copy Paypal Gmail"); + tv1.setTextColor(0xFFF50057); + tv1.setTextSize((int)14); + tv1.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)20, 0xFFFFFF8D)); + vie.addView(tv1); + TextView tv3 = new TextView(getApplication()){{setLayoutParams(new android.view.ViewGroup.LayoutParams(-2, -2));/*This block created by SKK*/}}; + + tv3.setText(" "); + vie.addView(tv3); + TextView tv2 = new TextView(getApplication()){{setLayoutParams(new android.view.ViewGroup.LayoutParams(-2, -2));/*This block created by SKK*/}}; + + tv2.setText(" šŸ“‹ Copy Developer Telegram Username"); + tv2.setTextColor(0xFF000000); + tv2.setTextSize((int)14); + tv2.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)20, 0xFFB9F6CA)); + vie.addView(tv2); + tv1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + ((ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("clipboard", "araaafroyalls@gmail.com")); + if (String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).equals("araaafroyalls@gmail.com")) { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“‹ Copied"); + } + else { + d1.setTitle("āš ļø š—–š—¼š—½š˜† š—™š—®š—¶š—¹š—²š—±"); + d1.setMessage("Please Send 3.5$ to \naraaafroyalls@gmail.com"); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + } + }); + tv2.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + ((ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("clipboard", " @AraafRoyall")); + if (String.valueOf(((android.content.ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).getText()).equals(" @AraafRoyall")) { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ“‹ Copied"); + } + else { + d1.setTitle("āš ļø š—–š—¼š—½š˜† š—™š—®š—¶š—¹š—²š—±"); + d1.setMessage("Contact Directly by This Telegram Username \n\n@AraafRoyall"); + d1.setPositiveButton("šŸ‘Øā€šŸ’»", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + web.setAction(Intent.ACTION_VIEW); + web.setData(Uri.parse("https://t.me/AraafRoyall")); + startActivity(web); + } + }); + d1.create().show(); + } + } + }); + onesteppay.setView(vie); + /*this block created by skk*/ + onesteppay.create().show(); + } + + + @Deprecated + public void showMessage(String _s) { + Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show(); + } + + @Deprecated + public int getLocationX(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[0]; + } + + @Deprecated + public int getLocationY(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[1]; + } + + @Deprecated + public int getRandom(int _min, int _max) { + Random random = new Random(); + return random.nextInt(_max - _min + 1) + _min; + } + + @Deprecated + public ArrayList getCheckedItemPositionsToArray(ListView _list) { + ArrayList _result = new ArrayList(); + SparseBooleanArray _arr = _list.getCheckedItemPositions(); + for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) { + if (_arr.valueAt(_iIdx)) + _result.add((double)_arr.keyAt(_iIdx)); + } + return _result; + } + + @Deprecated + public float getDip(int _input) { + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, getResources().getDisplayMetrics()); + } + + @Deprecated + public int getDisplayWidthPixels() { + return getResources().getDisplayMetrics().widthPixels; + } + + @Deprecated + public int getDisplayHeightPixels() { + return getResources().getDisplayMetrics().heightPixels; + } +} \ No newline at end of file diff --git a/app/src/main/java/cleaner/lite/pro/SettingsActivity.java b/app/src/main/java/cleaner/lite/pro/SettingsActivity.java new file mode 100644 index 0000000..4437523 --- /dev/null +++ b/app/src/main/java/cleaner/lite/pro/SettingsActivity.java @@ -0,0 +1,559 @@ +package cleaner.lite.pro; + +import android.animation.*; +import android.app.*; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.app.Fragment; +import android.app.FragmentManager; +import android.content.*; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.*; +import android.graphics.*; +import android.graphics.drawable.*; +import android.media.*; +import android.net.*; +import android.net.Uri; +import android.os.*; +import android.os.Bundle; +import android.text.*; +import android.text.style.*; +import android.util.*; +import android.view.*; +import android.view.View; +import android.view.View.*; +import android.view.animation.*; +import android.webkit.*; +import android.widget.*; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.CompoundButton; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.Switch; +import android.widget.TextView; +import java.io.*; +import java.io.InputStream; +import java.text.*; +import java.util.*; +import java.util.Timer; +import java.util.TimerTask; +import java.util.regex.*; +import org.json.*; + +public class SettingsActivity extends Activity { + + private Timer _timer = new Timer(); + + private ScrollView vscroll1; + private LinearLayout linear1; + private LinearLayout linear4; + private Switch multisup; + private Switch btcall; + private Switch intrimer; + private Switch delvikcach; + private Switch advwhat; + private Switch lightui; + private Switch noconfirm; + private Switch liveEmpty; + private Switch tempclean; + private Switch nomedia; + private Switch developer; + private LinearLayout linear3; + private Button GetPremium; + private TextView textview7; + private RadioButton belowEleven; + private RadioButton elevenplus; + private TextView textview6; + private LinearLayout linear5; + private CheckBox stroke; + private TextView title; + private RadioButton Preset1; + private RadioButton Preset2; + + private SharedPreferences set; + private AlertDialog.Builder d; + private TimerTask t; + private AlertDialog.Builder user; + private AlertDialog.Builder Help; + private AlertDialog.Builder soon; + private SharedPreferences premium; + private AlertDialog.Builder prm; + private Intent i = new Intent(); + + @Override + protected void onCreate(Bundle _savedInstanceState) { + super.onCreate(_savedInstanceState); + setContentView(R.layout.settings); + initialize(_savedInstanceState); + initializeLogic(); + } + + private void initialize(Bundle _savedInstanceState) { + vscroll1 = findViewById(R.id.vscroll1); + linear1 = findViewById(R.id.linear1); + linear4 = findViewById(R.id.linear4); + multisup = findViewById(R.id.multisup); + btcall = findViewById(R.id.btcall); + intrimer = findViewById(R.id.intrimer); + delvikcach = findViewById(R.id.delvikcach); + advwhat = findViewById(R.id.advwhat); + lightui = findViewById(R.id.lightui); + noconfirm = findViewById(R.id.noconfirm); + liveEmpty = findViewById(R.id.liveEmpty); + tempclean = findViewById(R.id.tempclean); + nomedia = findViewById(R.id.nomedia); + developer = findViewById(R.id.developer); + linear3 = findViewById(R.id.linear3); + GetPremium = findViewById(R.id.GetPremium); + textview7 = findViewById(R.id.textview7); + belowEleven = findViewById(R.id.belowEleven); + elevenplus = findViewById(R.id.elevenplus); + textview6 = findViewById(R.id.textview6); + linear5 = findViewById(R.id.linear5); + stroke = findViewById(R.id.stroke); + title = findViewById(R.id.title); + Preset1 = findViewById(R.id.Preset1); + Preset2 = findViewById(R.id.Preset2); + set = getSharedPreferences("set", Activity.MODE_PRIVATE); + d = new AlertDialog.Builder(this); + user = new AlertDialog.Builder(this); + Help = new AlertDialog.Builder(this); + soon = new AlertDialog.Builder(this); + premium = getSharedPreferences("premium", Activity.MODE_PRIVATE); + prm = new AlertDialog.Builder(this); + + multisup.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + + } + }); + + btcall.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("enable", "battery").commit(); + } + else { + set.edit().remove("enable").commit(); + } + } + }); + + intrimer.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + + } + }); + + delvikcach.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + delvikcach.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + + } + else { + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + delvikcach.setChecked(true); + } + }); + } + }; + _timer.schedule(t, (int)(500)); + } + } + }); + + advwhat.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("enable5", "whatsapp").commit(); + } + else { + set.edit().remove("enable5").commit(); + } + } + }); + + lightui.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + lightui.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("lite", "1").commit(); + } + else { + set.edit().remove("lite").commit(); + } + } + }); + + noconfirm.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + noconfirm.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("confirm", "0").commit(); + } + else { + set.edit().remove("confirm").commit(); + } + } + }); + + liveEmpty.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + liveEmpty.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("liveEmpty", "1").commit(); + } + else { + set.edit().remove("liveEmpty").commit(); + } + } + }); + + tempclean.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("tmpcleanoutput", "1").commit(); + } + else { + set.edit().remove("tmpcleanoutput").commit(); + } + } + }); + + nomedia.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + nomedia.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("nomediaoutput", "1").commit(); + } + else { + set.edit().remove("nomediaoutput").commit(); + } + } + }); + + developer.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + developer.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("developer", "1").commit(); + } + else { + set.edit().remove("developer").commit(); + } + } + }); + + GetPremium.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View _view) { + + return true; + } + }); + + GetPremium.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + i.setAction(Intent.ACTION_VIEW); + i.setClass(getApplicationContext(), PremiumActivity.class); + startActivity(i); + } + }); + + belowEleven.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + elevenplus.setChecked(false); + set.edit().putString("AndroidVersion", "11-").commit(); + } + else { + + } + } + }); + + elevenplus.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + elevenplus.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + belowEleven.setChecked(false); + set.edit().putString("AndroidVersion", "11+").commit(); + } + else { + + } + } + }); + + linear5.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + stroke.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + stroke.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("stroke", "1").commit(); + } + else { + set.edit().remove("stroke").commit(); + } + } + }); + + Preset1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + Preset1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("theme", "1").commit(); + Preset2.setChecked(false); + } + } + }); + + Preset2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton _param1, boolean _param2) { + final boolean _isChecked = _param2; + if (_isChecked) { + set.edit().putString("theme", "2").commit(); + Preset1.setChecked(false); + stroke.setVisibility(View.VISIBLE); + } + else { + stroke.setVisibility(View.GONE); + if (set.getString("stroke", "").equals("1")) { + stroke.setChecked(true); + } + } + } + }); + } + + private void initializeLogic() { + setTitle("āš™ļø š—¦š—²š˜š˜š—¶š—»š—“š˜€"); + _premiumpurchaseddone(); + _Theme(); + } + + @Override + protected void onPostCreate(Bundle _savedInstanceState) { + super.onPostCreate(_savedInstanceState); + if (set.getString("enable", "").equals("battery")) { + btcall.setChecked(true); + } + if (set.getString("enable5", "").equals("whatsapp")) { + advwhat.setChecked(true); + } + if (set.getString("AndroidVersion", "").equals("11-")) { + belowEleven.setChecked(true); + } + if (set.getString("AndroidVersion", "").equals("11+")) { + elevenplus.setChecked(true); + } + if (set.getString("lite", "").equals("1")) { + lightui.setChecked(true); + } + if (set.getString("confirm", "").equals("0")) { + noconfirm.setChecked(true); + } + if (set.getString("developer", "").equals("1")) { + developer.setChecked(true); + } + if (set.getString("liveEmpty", "").equals("1")) { + liveEmpty.setChecked(true); + } + if (set.getString("tmpcleanoutput", "").equals("1")) { + tempclean.setChecked(true); + } + if (set.getString("nomediaoutput", "").equals("1")) { + nomedia.setChecked(true); + } + } + public void _comingsoon() { + soon.setTitle("šŸ‘Øā€šŸ’» š—–š—¼š—ŗš—¶š—»š—“ š—¦š—¼š—¼š—» ..."); + soon.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + soon.create().show(); + } + + + public void _premiumpurchaseddone() { + if (premium.getString("#", "").equals("1")) { + GetPremium.setText("šŸ›ø š—£š—暝—²š—ŗš—¶š˜‚š—ŗ š—”š—°š˜š—¶š˜ƒš—®š˜š—²š—±"); + } + else { + + } + } + + + public void _Theme() { + GetPremium.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)10, 0xFFFF3D00, 0xFF00E676)); + if (set.getString("theme", "").equals("2")) { + Preset2.setChecked(true); + stroke.setVisibility(View.VISIBLE); + if (set.getString("stroke", "").equals("1")) { + stroke.setChecked(true); + } + } + else { + Preset1.setChecked(true); + stroke.setVisibility(View.GONE); + } + } + + + @Deprecated + public void showMessage(String _s) { + Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show(); + } + + @Deprecated + public int getLocationX(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[0]; + } + + @Deprecated + public int getLocationY(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[1]; + } + + @Deprecated + public int getRandom(int _min, int _max) { + Random random = new Random(); + return random.nextInt(_max - _min + 1) + _min; + } + + @Deprecated + public ArrayList getCheckedItemPositionsToArray(ListView _list) { + ArrayList _result = new ArrayList(); + SparseBooleanArray _arr = _list.getCheckedItemPositions(); + for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) { + if (_arr.valueAt(_iIdx)) + _result.add((double)_arr.keyAt(_iIdx)); + } + return _result; + } + + @Deprecated + public float getDip(int _input) { + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, getResources().getDisplayMetrics()); + } + + @Deprecated + public int getDisplayWidthPixels() { + return getResources().getDisplayMetrics().widthPixels; + } + + @Deprecated + public int getDisplayHeightPixels() { + return getResources().getDisplayMetrics().heightPixels; + } +} \ No newline at end of file diff --git a/app/src/main/java/cleaner/lite/pro/SketchwareUtil.java b/app/src/main/java/cleaner/lite/pro/SketchwareUtil.java new file mode 100644 index 0000000..70fc1f8 --- /dev/null +++ b/app/src/main/java/cleaner/lite/pro/SketchwareUtil.java @@ -0,0 +1,207 @@ +package cleaner.lite.pro; +import android.app.*; +import android.content.*; +import android.graphics.drawable.*; +import android.net.*; +import android.util.*; +import android.view.*; +import android.view.inputmethod.*; +import android.widget.*; + +import java.io.*; +import java.util.*; + +public class SketchwareUtil { + + public static int TOP = 1; + public static int CENTER = 2; + public static int BOTTOM = 3; + + public static void CustomToast(Context _context, String _message, int _textColor, int _textSize, int _bgColor, int _radius, int _gravity) { + Toast _toast = Toast.makeText(_context, _message, Toast.LENGTH_SHORT); + View _view = _toast.getView(); + TextView _textView = _view.findViewById(android.R.id.message); + _textView.setTextSize(_textSize); + _textView.setTextColor(_textColor); + _textView.setGravity(Gravity.CENTER); + + GradientDrawable _gradientDrawable = new GradientDrawable(); + _gradientDrawable.setColor(_bgColor); + _gradientDrawable.setCornerRadius(_radius); + _view.setBackgroundDrawable(_gradientDrawable); + _view.setPadding(15, 10, 15, 10); + _view.setElevation(10); + + switch (_gravity) { + case 1: + _toast.setGravity(Gravity.TOP, 0, 150); + break; + + case 2: + _toast.setGravity(Gravity.CENTER, 0, 0); + break; + + case 3: + _toast.setGravity(Gravity.BOTTOM, 0, 150); + break; + } + _toast.show(); + } + + public static void CustomToastWithIcon(Context _context, String _message, int _textColor, int _textSize, int _bgColor, int _radius, int _gravity, int _icon) { + Toast _toast = Toast.makeText(_context, _message, Toast.LENGTH_SHORT); + View _view = _toast.getView(); + TextView _textView = (TextView) _view.findViewById(android.R.id.message); + _textView.setTextSize(_textSize); + _textView.setTextColor(_textColor); + _textView.setCompoundDrawablesWithIntrinsicBounds(_icon, 0, 0, 0); + _textView.setGravity(Gravity.CENTER); + _textView.setCompoundDrawablePadding(10); + + GradientDrawable _gradientDrawable = new GradientDrawable(); + _gradientDrawable.setColor(_bgColor); + _gradientDrawable.setCornerRadius(_radius); + _view.setBackgroundDrawable(_gradientDrawable); + _view.setPadding(10, 10, 10, 10); + _view.setElevation(10); + + switch (_gravity) { + case 1: + _toast.setGravity(Gravity.TOP, 0, 150); + break; + + case 2: + _toast.setGravity(Gravity.CENTER, 0, 0); + break; + + case 3: + _toast.setGravity(Gravity.BOTTOM, 0, 150); + break; + } + _toast.show(); + } + + public static void sortListMap(final ArrayList> listMap, final String key, final boolean isNumber, final boolean ascending) { + Collections.sort(listMap, new Comparator>() { + public int compare(HashMap _compareMap1, HashMap _compareMap2) { + if (isNumber) { + int _count1 = Integer.valueOf(_compareMap1.get(key).toString()); + int _count2 = Integer.valueOf(_compareMap2.get(key).toString()); + if (ascending) { + return _count1 < _count2 ? -1 : _count1 < _count2 ? 1 : 0; + } else { + return _count1 > _count2 ? -1 : _count1 > _count2 ? 1 : 0; + } + } else { + if (ascending) { + return (_compareMap1.get(key).toString()).compareTo(_compareMap2.get(key).toString()); + } else { + return (_compareMap2.get(key).toString()).compareTo(_compareMap1.get(key).toString()); + } + } + } + }); + } + + public static void CropImage(Activity _activity, String _path, int _requestCode) { + try { + Intent _intent = new Intent("com.android.camera.action.CROP"); + File _file = new File(_path); + Uri _contentUri = Uri.fromFile(_file); + _intent.setDataAndType(_contentUri, "image/*"); + _intent.putExtra("crop", "true"); + _intent.putExtra("aspectX", 1); + _intent.putExtra("aspectY", 1); + _intent.putExtra("outputX", 280); + _intent.putExtra("outputY", 280); + _intent.putExtra("return-data", false); + _activity.startActivityForResult(_intent, _requestCode); + } catch (ActivityNotFoundException _e) { + Toast.makeText(_activity, "Your device doesn't support the crop action!", Toast.LENGTH_SHORT).show(); + } + } + + public static boolean isConnected(Context _context) { + ConnectivityManager _connectivityManager = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE); + NetworkInfo _activeNetworkInfo = _connectivityManager.getActiveNetworkInfo(); + return _activeNetworkInfo != null && _activeNetworkInfo.isConnected(); + } + + public static String copyFromInputStream(InputStream _inputStream) { + ByteArrayOutputStream _outputStream = new ByteArrayOutputStream(); + byte[] _buf = new byte[1024]; + int _i; + try { + while ((_i = _inputStream.read(_buf)) != -1){ + _outputStream.write(_buf, 0, _i); + } + _outputStream.close(); + _inputStream.close(); + } catch (IOException _e) { + } + + return _outputStream.toString(); + } + + public static void hideKeyboard(Context _context) { + InputMethodManager _inputMethodManager = (InputMethodManager) _context.getSystemService(Context.INPUT_METHOD_SERVICE); + _inputMethodManager.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0); + } + + public static void showKeyboard(Context _context) { + InputMethodManager _inputMethodManager = (InputMethodManager) _context.getSystemService(Context.INPUT_METHOD_SERVICE); + _inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); + } + + public static void showMessage(Context _context, String _s) { + Toast.makeText(_context, _s, Toast.LENGTH_SHORT).show(); + } + + public static int getLocationX(View _view) { + int _location[] = new int[2]; + _view.getLocationInWindow(_location); + return _location[0]; + } + + public static int getLocationY(View _view) { + int _location[] = new int[2]; + _view.getLocationInWindow(_location); + return _location[1]; + } + + public static int getRandom(int _min, int _max) { + Random random = new Random(); + return random.nextInt(_max - _min + 1) + _min; + } + + public static ArrayList getCheckedItemPositionsToArray(ListView _list) { + ArrayList _result = new ArrayList(); + SparseBooleanArray _arr = _list.getCheckedItemPositions(); + for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) { + if (_arr.valueAt(_iIdx)) + _result.add((double) _arr.keyAt(_iIdx)); + } + return _result; + } + + public static float getDip(Context _context, int _input) { + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, _context.getResources().getDisplayMetrics()); + } + + public static int getDisplayWidthPixels(Context _context) { + return _context.getResources().getDisplayMetrics().widthPixels; + } + + public static int getDisplayHeightPixels(Context _context) { + return _context.getResources().getDisplayMetrics().heightPixels; + } + + public static void getAllKeysFromMap(Map _map, ArrayList _output) { + if (_output == null) return; + _output.clear(); + if (_map == null || _map.size() < 1) return; + for (Map.Entry _entry : _map.entrySet()) { + _output.add(_entry.getKey()); + } + } +} diff --git a/app/src/main/java/cleaner/lite/pro/StorageusageActivity.java b/app/src/main/java/cleaner/lite/pro/StorageusageActivity.java new file mode 100644 index 0000000..6156128 --- /dev/null +++ b/app/src/main/java/cleaner/lite/pro/StorageusageActivity.java @@ -0,0 +1,1091 @@ +package cleaner.lite.pro; + +import android.animation.*; +import android.app.*; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.app.Fragment; +import android.app.FragmentManager; +import android.content.*; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.*; +import android.graphics.*; +import android.graphics.drawable.*; +import android.media.*; +import android.net.*; +import android.os.*; +import android.text.*; +import android.text.style.*; +import android.util.*; +import android.view.*; +import android.view.View; +import android.view.View.*; +import android.view.animation.*; +import android.webkit.*; +import android.widget.*; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.TextView; +import java.io.*; +import java.text.*; +import java.text.DecimalFormat; +import java.util.*; +import java.util.Timer; +import java.util.TimerTask; +import java.util.regex.*; +import org.json.*; + +public class StorageusageActivity extends Activity { + + private Timer _timer = new Timer(); + + private double converter = 0; + private double Converter = 0; + private String oatcode = ""; + private String oatSizer = ""; + private String variable = ""; + + private ScrollView vscroll1; + private LinearLayout linear1; + private TextView help; + private LinearLayout linear13; + private LinearLayout linear17; + private LinearLayout linear19; + private LinearLayout linear21; + private LinearLayout linear23; + private LinearLayout linear25; + private Button Calculate; + private TextView result; + private LinearLayout linear14; + private TextView system; + private TextView textview12; + private LinearLayout linear18; + private TextView magisk; + private TextView textview16; + private LinearLayout linear20; + private TextView internal; + private TextView textview18; + private LinearLayout linear22; + private TextView delvik; + private TextView textview20; + private LinearLayout linear24; + private TextView oat; + private TextView textview22; + private LinearLayout linear26; + private TextView multiInternal; + private TextView textview24; + private ImageView imageview2; + + private SharedPreferences set; + private AlertDialog.Builder d1; + private TimerTask t; + private AlertDialog.Builder notify; + + @Override + protected void onCreate(Bundle _savedInstanceState) { + super.onCreate(_savedInstanceState); + setContentView(R.layout.storageusage); + initialize(_savedInstanceState); + initializeLogic(); + } + + private void initialize(Bundle _savedInstanceState) { + vscroll1 = findViewById(R.id.vscroll1); + linear1 = findViewById(R.id.linear1); + help = findViewById(R.id.help); + linear13 = findViewById(R.id.linear13); + linear17 = findViewById(R.id.linear17); + linear19 = findViewById(R.id.linear19); + linear21 = findViewById(R.id.linear21); + linear23 = findViewById(R.id.linear23); + linear25 = findViewById(R.id.linear25); + Calculate = findViewById(R.id.Calculate); + result = findViewById(R.id.result); + linear14 = findViewById(R.id.linear14); + system = findViewById(R.id.system); + textview12 = findViewById(R.id.textview12); + linear18 = findViewById(R.id.linear18); + magisk = findViewById(R.id.magisk); + textview16 = findViewById(R.id.textview16); + linear20 = findViewById(R.id.linear20); + internal = findViewById(R.id.internal); + textview18 = findViewById(R.id.textview18); + linear22 = findViewById(R.id.linear22); + delvik = findViewById(R.id.delvik); + textview20 = findViewById(R.id.textview20); + linear24 = findViewById(R.id.linear24); + oat = findViewById(R.id.oat); + textview22 = findViewById(R.id.textview22); + linear26 = findViewById(R.id.linear26); + multiInternal = findViewById(R.id.multiInternal); + textview24 = findViewById(R.id.textview24); + imageview2 = findViewById(R.id.imageview2); + set = getSharedPreferences("set", Activity.MODE_PRIVATE); + d1 = new AlertDialog.Builder(this); + notify = new AlertDialog.Builder(this); + + help.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d1.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + d1.setMessage("ā€¢ On Certain Devices , This Feature may show inaccurate storage usage due to some system components\nā€¢ On upcoming updates , This Option may include all features storage view\nā€¢ Please provide feedback to Developer if found inaccurate information via \"Cleaner Lite Helper App\""); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + + Calculate.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + _oatStorage(); + } + }); + + textview24.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + + } + }); + + imageview2.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View _view) { + d1.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + d1.setMessage("It Shows the total size of Multi users Internal Storage including Device Internal storage usage"); + d1.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + + private void initializeLogic() { + setTitle("šŸ’½ š—¦š˜š—¼š—暝—®š—“š—² š—Øš˜€š—®š—“š—²"); + help.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b) { this.setCornerRadius(a); this.setColor(b); return this; } }.getIns((int)50, 0xFFFFFF00)); + } + + @Override + protected void onPostCreate(Bundle _savedInstanceState) { + super.onPostCreate(_savedInstanceState); + Calculate.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)30, (int)10, 0xFFFF3D00, 0xFF00E676)); + if (set.getString("storageviewer", "").contains("1")) { + + } + else { + notify.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + notify.setMessage("This Feature is NOT completed yet and may work inaccurately.\nIt Gets Completed in UpComing Updates\n"); + LinearLayout setup2done = new LinearLayout(StorageusageActivity.this); + setup2done.setOrientation(LinearLayout.VERTICAL); + + LinearLayout.LayoutParams p2done = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); + + final CheckBox setup2check = new CheckBox(StorageusageActivity.this); + setup2check.setText("Don't Show Again"); + setup2check.setLayoutParams(p2done); + setup2done.addView(setup2check); + + notify.setView(setup2done); + notify.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + if + ((setup2check.isChecked())){ + + set.edit().putString("storageviewer", "1").commit(); + } + else + { + + + } + } + }); + notify.create().show(); + } + } + public void _oatStorage() { + if (set.getString("AndroidVersion", "").contains("1")) { + if (set.getString("AndroidVersion", "").equals("11+")) { + oatcode = "# size checker"; + try { + + final String command = oatcode; + + final AlertDialog alertDialog = new AlertDialog.Builder(StorageusageActivity.this) + .setTitle("āš” š—–š—®š—¹š—°š˜‚š—¹š—®š˜š—¶š—»š—“ š—¦š—¶š˜‡š—²") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + oatSizer = result.getText().toString().replace("\n", ""); + if (oatSizer.length() > 6) { + converter = Double.parseDouble(result.getText().toString()); + Converter = converter / 1000; + oatSizer = new DecimalFormat("0.00").format(Converter).concat(" GB"); + } + else { + oatSizer = oatSizer.concat(" MB"); + oatcode = ""; + } + oat.setText(oatSizer); + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _delvikstorage(); + } + }); + } + }; + _timer.schedule(t, (int)(300)); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + oatcode = ""; + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("š”š§ššš›š„šž š­šØ š‚ššš„šœš®š„ššš­šž š’š¢š³šž , š’šØš¦šžš­š”š¢š§š  š°šžš§š­ š°š«šØš§š \nor Root permission may denied"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(StorageusageActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + if (set.getString("AndroidVersion", "").equals("11-")) { + d1.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + d1.setMessage("This Feature is Suspended for lower Android Versions due to wrong calculation of size"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + } + else { + d1.setTitle("šŸŖ§ š—œš—»š—³š—¼š—暝—ŗš—®š˜š—¶š—¼š—»"); + d1.setMessage("š’šžš„šžšœš­ š€š§šš«šØš¢š šÆšžš«š¬š¢šØš§ šŸš«šØš¦ š¬šžš­š­š¢š§š š¬ š­šØ š®š¬šž š­š”š¢š¬ šŸšžššš­š®š«šž"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + } + + + public void _delvikstorage() { + try { + + final String command = "# size checker"; + + final AlertDialog alertDialog = new AlertDialog.Builder(StorageusageActivity.this) + .setTitle("āš”š—–š—®š—¹š—°š˜‚š—¹š—®š˜š—¶š—»š—“ š—¦š—¶š˜‡š—²") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + final StringBuilder errorText = new StringBuilder(); + java.io.BufferedReader errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); + while ((line = errorReader.readLine()) != null) { + errorText.append(line).append("\n"); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + variable = result.getText().toString().replace("/data/dalvik-cache/", " "); + variable = variable.replace("3.5K", "0 KB"); + variable = variable.replace("M", " MB"); + variable = variable.replace("\n", ""); + variable = variable.replace("Result", ""); + delvik.setText(variable); + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _magiskStorage(); + } + }); + } + }; + _timer.schedule(t, (int)(300)); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorText.toString()); + d1.setTitle("ā— š—˜š—暝—暝—¼š—æ"); + d1.setMessage("Unable to Calculate Delvik Size\nSomething went wrong or Root Permission is denied"); + d1.setPositiveButton("ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(StorageusageActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _magiskStorage() { + try { + + final String command = "# size checker"; + + final AlertDialog alertDialog = new AlertDialog.Builder(StorageusageActivity.this) + .setTitle("āš” š—–š—®š—¹š—°š˜‚š—¹š—®š˜š—¶š—»š—“ š—¦š—¶š˜‡š—²") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + variable = result.getText().toString().replace("\n", ""); + if (variable.length() > 6) { + converter = Double.parseDouble(result.getText().toString()); + Converter = converter / 1000; + variable = new DecimalFormat("0.00").format(Converter).concat(" GB"); + } + else { + variable = variable.concat(" MB"); + } + magisk.setText(variable); + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _systemstorage(); + } + }); + } + }; + _timer.schedule(t, (int)(300)); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("š”š§ššš›š„šž š­šØ š‚ššš„šœš®š„ššš­šž š’š¢š³šž , š’šØš¦šžš­š”š¢š§š  š°šžš§š­ š°š«šØš§š \nor Root permission may denied"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(StorageusageActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _internalStorage() { + try { + + final String command = "# size checker"; + + final AlertDialog alertDialog = new AlertDialog.Builder(StorageusageActivity.this) + .setTitle("āš” š—–š—®š—¹š—°š˜‚š—¹š—®š˜š—¶š—»š—“ š—¦š—¶š˜‡š—²") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + variable = result.getText().toString().replace("\n", ""); + if (variable.length() > 6) { + converter = Double.parseDouble(result.getText().toString()); + Converter = converter / 1000; + variable = new DecimalFormat("0.00").format(Converter).concat(" GB"); + } + else { + variable = variable.concat(" MB"); + } + internal.setText(variable); + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _multiInternall(); + } + }); + } + }; + _timer.schedule(t, (int)(300)); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("š”š§ššš›š„šž š­šØ š‚ššš„šœš®š„ššš­šž š’š¢š³šž , š’šØš¦šžš­š”š¢š§š  š°šžš§š­ š°š«šØš§š \nor Root permission may denied"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(StorageusageActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _systemstorage() { + try { + + final String command = "# size checker"; + + final AlertDialog alertDialog = new AlertDialog.Builder(StorageusageActivity.this) + .setTitle("āš” š—–š—®š—¹š—°š˜‚š—¹š—®š˜š—¶š—»š—“ š—¦š—¶š˜‡š—²") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + variable = result.getText().toString().replace("\n", ""); + if (variable.length() > 6) { + converter = Double.parseDouble(result.getText().toString()); + Converter = converter / 1000; + variable = new DecimalFormat("0.00").format(Converter).concat(" GB"); + } + else { + variable = variable.concat(" MB"); + } + system.setText(variable); + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _internalStorage(); + } + }); + } + }; + _timer.schedule(t, (int)(300)); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("š”š§ššš›š„šž š­šØ š‚ššš„šœš®š„ššš­šž š’š¢š³šž , š’šØš¦šžš­š”š¢š§š  š°šžš§š­ š°š«šØš§š \nor Root permission may denied"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(StorageusageActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _multiInternall() { + try { + + final String command = "# size checker"; + + final AlertDialog alertDialog = new AlertDialog.Builder(StorageusageActivity.this) + .setTitle("āš” š—–š—®š—¹š—°š˜‚š—¹š—®š˜š—¶š—»š—“ š—¦š—¶š˜‡š—²") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + variable = result.getText().toString().replace("\n", ""); + if (variable.length() > 6) { + converter = Double.parseDouble(result.getText().toString()); + Converter = converter / 1000; + variable = new DecimalFormat("0.00").format(Converter).concat(" GB"); + } + else { + variable = variable.concat(" MB"); + } + multiInternal.setText(variable); + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + _lastTask(); + } + }); + } + }; + _timer.schedule(t, (int)(300)); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("š”š§ššš›š„šž š­šØ š‚ššš„šœš®š„ššš­šž š’š¢š³šž , š’šØš¦šžš­š”š¢š§š  š°šžš§š­ š°š«šØš§š \nor Root permission may denied"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(StorageusageActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _Logsizer() { + try { + + final String command = "# size checker"; + + final AlertDialog alertDialog = new AlertDialog.Builder(StorageusageActivity.this) + .setTitle("āš” š—–š—®š—¹š—°š˜‚š—¹š—®š˜š—¶š—»š—“ š—¦š—¶š˜‡š—²") + .setMessage(" Please wait...") + .setCancelable(false) + .create(); + + alertDialog.show(); + + final TextView result = findViewById(R.id.result); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + try { + java.lang.Process process = java.lang.Runtime.getRuntime().exec("su"); + java.io.DataOutputStream outputStream = new java.io.DataOutputStream(process.getOutputStream()); + + outputStream.writeBytes(command + "\n"); + outputStream.flush(); + + outputStream.writeBytes("exit\n"); + outputStream.flush(); + + int exitCode = process.waitFor(); + + alertDialog.dismiss(); + + final StringBuilder outputText = new StringBuilder(); + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + outputText.append(line).append("\n"); + + + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(outputText.toString()); + } + }); + } + + if (exitCode == 0) { + runOnUiThread(new Runnable() { + @Override + public void run() { + variable = result.getText().toString().replace("\n", ""); + if (variable.length() > 6) { + converter = Double.parseDouble(result.getText().toString()); + Converter = converter / 1000; + variable = new DecimalFormat("0.00").format(Converter).concat(" GB"); + } + else { + variable = variable.concat(" MB"); + } + t = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + + } + }); + } + }; + _timer.schedule(t, (int)(300)); + } + }); + } else { + runOnUiThread(new Runnable() { + @Override + public void run() { + d1.setTitle("ā—š—˜š—暝—暝—¼š—æ"); + d1.setMessage("š”š§ššš›š„šž š­šØ š‚ššš„šœš®š„ššš­šž š’š¢š³šž , š’šØš¦šžš­š”š¢š§š  š°šžš§š­ š°š«šØš§š \nor Root permission may denied"); + d1.setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface _dialog, int _which) { + + } + }); + d1.create().show(); + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + alertDialog.dismiss(); + final String errorMessage = "Error: " + e.getMessage(); + runOnUiThread(new Runnable() { + @Override + public void run() { + result.setText(errorMessage); + Toast.makeText(StorageusageActivity.this, errorMessage, Toast.LENGTH_SHORT).show(); + } + }); + } + } + }, 100); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void _lastTask() { + SketchwareUtil.showMessage(getApplicationContext(), "šŸ„ Sucessfully Calculated "); + Calculate.setVisibility(View.INVISIBLE); + } + + + @Deprecated + public void showMessage(String _s) { + Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show(); + } + + @Deprecated + public int getLocationX(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[0]; + } + + @Deprecated + public int getLocationY(View _v) { + int _location[] = new int[2]; + _v.getLocationInWindow(_location); + return _location[1]; + } + + @Deprecated + public int getRandom(int _min, int _max) { + Random random = new Random(); + return random.nextInt(_max - _min + 1) + _min; + } + + @Deprecated + public ArrayList getCheckedItemPositionsToArray(ListView _list) { + ArrayList _result = new ArrayList(); + SparseBooleanArray _arr = _list.getCheckedItemPositions(); + for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) { + if (_arr.valueAt(_iIdx)) + _result.add((double)_arr.keyAt(_iIdx)); + } + return _result; + } + + @Deprecated + public float getDip(int _input) { + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, getResources().getDisplayMetrics()); + } + + @Deprecated + public int getDisplayWidthPixels() { + return getResources().getDisplayMetrics().widthPixels; + } + + @Deprecated + public int getDisplayHeightPixels() { + return getResources().getDisplayMetrics().heightPixels; + } +} \ No newline at end of file