Skip to content

Commit 7151531

Browse files
committed
Remove Android 14 warning, since we now have working ADB setup for this
Fixed in server v1.14.2
1 parent 6da0ddc commit 7151531

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

app/src/main/java/tech/httptoolkit/android/HttpToolkitApplication.kt

-12
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private const val VPN_START_TIME_PREF = "vpn-start-time"
2626
private const val LAST_UPDATE_CHECK_TIME_PREF = "update-check-time"
2727
private const val APP_CRASHED_PREF = "app-crashed"
2828
private const val FIRST_RUN_PREF = "is-first-run"
29-
private const val SEEN_ANDROID_14_WARNING_PREF = "seen-android-14-warning"
3029

3130
private val isProbablyEmulator =
3231
Build.FINGERPRINT.startsWith("generic")
@@ -97,17 +96,6 @@ class HttpToolkitApplication : Application() {
9796
}
9897
}
9998

100-
/**
101-
* Check if the Android 14 warning has already been seen. This returns the value,
102-
* and sets it to true if it was not already, so this will only return 'false'
103-
* the first time it is ever called.
104-
*/
105-
fun popAndroid14WarningState(): Boolean {
106-
val hasSeenWarning = prefs.getBoolean(SEEN_ANDROID_14_WARNING_PREF, false)
107-
prefs.edit().putBoolean(SEEN_ANDROID_14_WARNING_PREF, true).apply()
108-
return hasSeenWarning
109-
}
110-
11199
/**
112100
* Grab any first run params, drop them for future usage, and return them.
113101
* This will return first-run params at most once (per install).

app/src/main/java/tech/httptoolkit/android/MainActivity.kt

-29
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,6 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
105105

106106
Log.i(TAG, "Main activity created")
107107

108-
if (
109-
// Should be the real value later on
110-
Build.VERSION.RELEASE == "14" ||
111-
Build.VERSION.RELEASE == "15" || // Reasonable guess for the future
112-
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R &&
113-
// Or, while it's still in beta:
114-
Build.VERSION.RELEASE_OR_CODENAME == "UpsideDownCake"
115-
)
116-
) {
117-
val hasSeenWarningAlready = app.popAndroid14WarningState()
118-
if (!hasSeenWarningAlready) showAndroid14Alert()
119-
}
120-
121108
// Are we being opened by an intent? I.e. a barcode scan/URL elsewhere on the device
122109
if (intent != null) {
123110
onNewIntent(intent)
@@ -950,22 +937,6 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
950937
.show()
951938
}
952939

953-
private fun showAndroid14Alert() {
954-
MaterialAlertDialogBuilder(this)
955-
.setTitle("System interception is not available on Android 14+")
956-
.setIcon(R.drawable.ic_exclamation_triangle)
957-
.setMessage(
958-
"Android 14 includes some changes which make system interception impossible." +
959-
"\n\n" +
960-
"This is a general issue that blocks system interception by HTTP Toolkit and all " +
961-
"similar tools." +
962-
"\n\n" +
963-
"To use system interception, you will need to use Android 13 or older."
964-
)
965-
.setNeutralButton("Ok") { _, _ -> }
966-
.show()
967-
}
968-
969940
private fun tryStartActivity(intent: Intent): Boolean {
970941
return try {
971942
startActivity(intent)

0 commit comments

Comments
 (0)