Advertisement
l33tb0mb3r

four.apk

Jun 14th, 2023
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.00 KB | Cybersecurity | 0 0
  1. package com.four.editor;
  2.  
  3. import android.content.SharedPreferences;
  4. import android.os.Bundle;
  5. import android.view.View;
  6. import android.widget.Button;
  7. import android.widget.EditText;
  8. import android.widget.TextView;
  9. import androidx.appcompat.app.AppCompatActivity;
  10. import java.io.File;
  11. import java.io.FileWriter;
  12. import java.io.IOException;
  13.  
  14. /* loaded from: classes3.dex */
  15. public class MainActivity extends AppCompatActivity {
  16.     EditText contentText;
  17.     String currentsettings = "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n<map>\n    <string name=\"server\">supersecureserver.com</string>\n</map>";
  18.     EditText editText;
  19.     TextView result;
  20.  
  21.     @Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
  22.     protected void onCreate(Bundle savedInstanceState) {
  23.         super.onCreate(savedInstanceState);
  24.         setContentView(C0567R.layout.activity_main);
  25.         SharedPreferences prefs = getApplicationContext().getSharedPreferences("server_discover_settings", 0);
  26.         SharedPreferences.Editor editor = prefs.edit();
  27.         if (!new File("/data/data/com.four.editor/shared_prefs/server_discover_settings.xml").exists()) {
  28.             editor.putString("server", "supersecureserver.com");
  29.             editor.apply();
  30.         }
  31.         ((TextView) findViewById(C0567R.C0570id.pseudopoll)).setText("Connected to:  " + prefs.getString("server", "supersecureserver.com"));
  32.         this.contentText = (EditText) findViewById(C0567R.C0570id.editTextFileContent);
  33.         this.result = (TextView) findViewById(C0567R.C0570id.result);
  34.         this.editText = (EditText) findViewById(C0567R.C0570id.editText);
  35.         ((Button) findViewById(C0567R.C0570id.button)).setOnClickListener(new View.OnClickListener() { // from class: com.four.editor.MainActivity.1
  36.             @Override // android.view.View.OnClickListener
  37.             public void onClick(View view) {
  38.                 MainActivity mainActivity = MainActivity.this;
  39.                 mainActivity.writeFile(mainActivity.contentText.getText().toString(), MainActivity.this.editText.getText().toString());
  40.             }
  41.         });
  42.     }
  43.  
  44.     /* JADX INFO: Access modifiers changed from: private */
  45.     public void writeFile(String what, String where) {
  46.         File file = new File(getFilesDir(), where);
  47.         try {
  48.             if (!file.exists()) {
  49.                 FileWriter fileWriter = new FileWriter(file);
  50.                 fileWriter.append((CharSequence) what);
  51.                 fileWriter.flush();
  52.                 fileWriter.close();
  53.                 TextView textView = this.result;
  54.                 textView.setText("File was succesfully saved to: " + file.toString());
  55.             } else {
  56.                 TextView textView2 = this.result;
  57.                 textView2.setText("I am sorry !! the file: " + file.toString() + " already exists !");
  58.             }
  59.         } catch (IOException e) {
  60.             e.printStackTrace();
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement