Remove Useless Code

This commit is contained in:
Mylloon 2021-08-28 23:44:28 +02:00
parent fd06cac442
commit 14e89f015b
2 changed files with 1 additions and 10 deletions

View file

@ -1,13 +1,10 @@
package com.mylloon.mobidl package com.mylloon.mobidl
import android.content.Context.MODE_PRIVATE import android.content.Context.MODE_PRIVATE
import android.os.Build
import android.security.keystore.KeyProperties import android.security.keystore.KeyProperties
import javax.crypto.Cipher import javax.crypto.Cipher
import android.security.keystore.KeyGenParameterSpec import android.security.keystore.KeyGenParameterSpec
import androidx.annotation.RequiresApi
import java.security.* import java.security.*
import java.util.*
class Credentials { class Credentials {
@ -17,7 +14,6 @@ class Credentials {
private val transformation = "RSA/ECB/PKCS1Padding" // 'type' of the key private val transformation = "RSA/ECB/PKCS1Padding" // 'type' of the key
private val sharedPref = "com.mylloon.MobiDL" // shared pref name private val sharedPref = "com.mylloon.MobiDL" // shared pref name
@RequiresApi(Build.VERSION_CODES.M)
fun generateKey() { // generate RSA Keys fun generateKey() { // generate RSA Keys
val keyPairGenerator = KeyPairGenerator.getInstance( val keyPairGenerator = KeyPairGenerator.getInstance(
KeyProperties.KEY_ALGORITHM_RSA, provider KeyProperties.KEY_ALGORITHM_RSA, provider
@ -96,6 +92,5 @@ class Credentials {
} }
decrypt(array) decrypt(array)
} else null } else null
} }
} }

View file

@ -4,7 +4,6 @@ package com.mylloon.mobidl
import android.Manifest import android.Manifest
import android.content.Context import android.content.Context
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.os.Build
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import android.widget.Button import android.widget.Button
@ -15,7 +14,6 @@ import android.text.TextWatcher
import android.view.MenuItem import android.view.MenuItem
import android.view.Menu import android.view.Menu
import android.widget.Toast import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import android.content.SharedPreferences import android.content.SharedPreferences
@ -23,7 +21,7 @@ import android.content.SharedPreferences
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
private var settingsButton: Menu? = null // before starting the app there is no settings button private var settingsButton: Menu? = null // before starting the app there is no settings button
private var inSettings: Boolean = false // by default your not in settings page private var inSettings: Boolean = false // by default your not in settings page
var prefs: SharedPreferences? = null // first run detection private var prefs: SharedPreferences? = null // first run detection
init { init {
instance = this instance = this
@ -42,7 +40,6 @@ class MainActivity : AppCompatActivity() {
settingsButton?.findItem(R.id.settingsButton)?.isVisible = !visibility settingsButton?.findItem(R.id.settingsButton)?.isVisible = !visibility
} }
@RequiresApi(Build.VERSION_CODES.O)
override fun onCreate(savedInstanceState: Bundle?) { // Main function override fun onCreate(savedInstanceState: Bundle?) { // Main function
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
prefs = getSharedPreferences("com.mylloon.MobiDL", MODE_PRIVATE) prefs = getSharedPreferences("com.mylloon.MobiDL", MODE_PRIVATE)
@ -100,7 +97,6 @@ class MainActivity : AppCompatActivity() {
// callScript(user, password) // call script // callScript(user, password) // call script
} }
@RequiresApi(Build.VERSION_CODES.M)
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (prefs!!.getBoolean("firstrun", true)) { if (prefs!!.getBoolean("firstrun", true)) {