fix(auto_updater): cpu arch deprecated method

- remove unused import
This commit is contained in:
rhunk
2023-08-07 00:58:36 +02:00
parent 0bfb75d00c
commit a1e7f234f9
2 changed files with 6 additions and 24 deletions

View File

@ -7,6 +7,7 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.IntentFilter import android.content.IntentFilter
import android.net.Uri import android.net.Uri
import android.os.Build
import android.os.Environment import android.os.Environment
import com.google.gson.JsonParser import com.google.gson.JsonParser
import me.rhunk.snapenhance.Logger import me.rhunk.snapenhance.Logger
@ -41,11 +42,6 @@ class AutoUpdater : Feature("AutoUpdater", loadParams = FeatureLoadParams.ACTIVI
} }
} }
@Suppress("DEPRECATION")
private fun getCPUArchitecture(): String {
return Build.CPU_ABI
}
@SuppressLint("UnspecifiedRegisterReceiverFlag") @SuppressLint("UnspecifiedRegisterReceiverFlag")
fun checkForUpdates(): String? { fun checkForUpdates(): String? {
val endpoint = Request.Builder().url("https://api.github.com/repos/rhunk/SnapEnhance/releases").build() val endpoint = Request.Builder().url("https://api.github.com/repos/rhunk/SnapEnhance/releases").build()
@ -61,10 +57,10 @@ class AutoUpdater : Feature("AutoUpdater", loadParams = FeatureLoadParams.ACTIVI
val latestVersion = latestRelease.getAsJsonPrimitive("tag_name").asString val latestVersion = latestRelease.getAsJsonPrimitive("tag_name").asString
if (latestVersion.removePrefix("v") == BuildConfig.VERSION_NAME) return null if (latestVersion.removePrefix("v") == BuildConfig.VERSION_NAME) return null
val architectureName = when (getCPUArchitecture()) { val architectureName = Build.SUPPORTED_ABIS.let {
"armeabi-v7a", "armeabi" -> "armv7" if (it.contains("arm64-v8a")) return@let "armv8"
"arm64-v8a" -> "armv8" if (it.contains("armeabi-v7a") || it.contains("armeabi")) return@let "armv7"
else -> { throw Throwable("Failed getting architecture") } throw Throwable("Failed getting architecture")
} }
val releaseContentBody = latestRelease.getAsJsonPrimitive("body").asString val releaseContentBody = latestRelease.getAsJsonPrimitive("body").asString

View File

@ -1,24 +1,10 @@
package me.rhunk.snapenhance.ui.menu.impl package me.rhunk.snapenhance.ui.menu.impl
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.AlertDialog
import android.graphics.Color
import android.graphics.Typeface
import android.text.InputType
import android.view.View import android.view.View
import android.widget.Button import android.widget.Button
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.Switch
import android.widget.TextView
import me.rhunk.snapenhance.config.ConfigProperty
import me.rhunk.snapenhance.config.impl.ConfigIntegerValue
import me.rhunk.snapenhance.config.impl.ConfigStateListValue
import me.rhunk.snapenhance.config.impl.ConfigStateSelection
import me.rhunk.snapenhance.config.impl.ConfigStateValue
import me.rhunk.snapenhance.config.impl.ConfigStringValue
import me.rhunk.snapenhance.ui.menu.AbstractMenu
import me.rhunk.snapenhance.ui.ViewAppearanceHelper import me.rhunk.snapenhance.ui.ViewAppearanceHelper
import me.rhunk.snapenhance.ui.menu.AbstractMenu
class SettingsMenu : AbstractMenu() { class SettingsMenu : AbstractMenu() {
//TODO: quick settings //TODO: quick settings