diff --git a/app/src/main/java/com/mylloon/mobidl/Credentials.kt b/app/src/main/java/com/mylloon/mobidl/Credentials.kt index c0002be..eb7169a 100644 --- a/app/src/main/java/com/mylloon/mobidl/Credentials.kt +++ b/app/src/main/java/com/mylloon/mobidl/Credentials.kt @@ -1,13 +1,10 @@ package com.mylloon.mobidl import android.content.Context.MODE_PRIVATE -import android.os.Build import android.security.keystore.KeyProperties import javax.crypto.Cipher import android.security.keystore.KeyGenParameterSpec -import androidx.annotation.RequiresApi import java.security.* -import java.util.* class Credentials { @@ -17,7 +14,6 @@ class Credentials { private val transformation = "RSA/ECB/PKCS1Padding" // 'type' of the key private val sharedPref = "com.mylloon.MobiDL" // shared pref name - @RequiresApi(Build.VERSION_CODES.M) fun generateKey() { // generate RSA Keys val keyPairGenerator = KeyPairGenerator.getInstance( KeyProperties.KEY_ALGORITHM_RSA, provider @@ -96,6 +92,5 @@ class Credentials { } decrypt(array) } else null - } } diff --git a/app/src/main/java/com/mylloon/mobidl/MainActivity.kt b/app/src/main/java/com/mylloon/mobidl/MainActivity.kt index 6631ac8..5fe484f 100644 --- a/app/src/main/java/com/mylloon/mobidl/MainActivity.kt +++ b/app/src/main/java/com/mylloon/mobidl/MainActivity.kt @@ -4,7 +4,6 @@ package com.mylloon.mobidl import android.Manifest import android.content.Context import android.content.pm.PackageManager -import android.os.Build import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.widget.Button @@ -15,7 +14,6 @@ import android.text.TextWatcher import android.view.MenuItem import android.view.Menu import android.widget.Toast -import androidx.annotation.RequiresApi import androidx.core.content.ContextCompat import android.content.SharedPreferences @@ -23,7 +21,7 @@ import android.content.SharedPreferences class MainActivity : AppCompatActivity() { 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 - var prefs: SharedPreferences? = null // first run detection + private var prefs: SharedPreferences? = null // first run detection init { instance = this @@ -42,7 +40,6 @@ class MainActivity : AppCompatActivity() { settingsButton?.findItem(R.id.settingsButton)?.isVisible = !visibility } - @RequiresApi(Build.VERSION_CODES.O) override fun onCreate(savedInstanceState: Bundle?) { // Main function super.onCreate(savedInstanceState) prefs = getSharedPreferences("com.mylloon.MobiDL", MODE_PRIVATE) @@ -100,7 +97,6 @@ class MainActivity : AppCompatActivity() { // callScript(user, password) // call script } - @RequiresApi(Build.VERSION_CODES.M) override fun onResume() { super.onResume() if (prefs!!.getBoolean("firstrun", true)) {