diff --git a/OrbotLib/OrbotLib.aar b/OrbotLib/OrbotLib.aar index fd87d16db..3b4747682 100644 Binary files a/OrbotLib/OrbotLib.aar and b/OrbotLib/OrbotLib.aar differ diff --git a/app-tv/build.gradle b/app-tv/build.gradle index 69b39ef4f..63bb459d7 100644 --- a/app-tv/build.gradle +++ b/app-tv/build.gradle @@ -5,7 +5,7 @@ android { defaultConfig { applicationId "org.torproject.android.tv" minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 } buildTypes { @@ -22,7 +22,7 @@ android { dimension "teevee" minSdkVersion 23 applicationId 'org.torproject.android.tv' - compileSdkVersion 33 + compileSdkVersion 34 versionCode 10020000 versionName 'orbot-tv-1.0.1-tor-0.4.7.14' archivesBaseName = "Orbot-TV-$versionName" diff --git a/app/build.gradle b/app/build.gradle index e7f27be76..00b5c470c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,8 +21,8 @@ android { applicationId "org.torproject.android" versionName getVersionName() minSdkVersion 23 - compileSdkVersion 33 - targetSdkVersion 33 + compileSdk 34 + targetSdkVersion 34 multiDexEnabled true testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' archivesBaseName = "Orbot" @@ -47,7 +47,7 @@ android { fullperm { dimension "free" applicationId 'org.torproject.android' - versionCode 1721300100 + versionCode 1722300100 versionName getVersionName() archivesBaseName = "Orbot-${versionName}" } @@ -103,14 +103,14 @@ android { namespace 'org.torproject.android' } dependencies { - implementation "androidx.core:core-ktx:1.8.0" + implementation "androidx.core:core-ktx:1.13.1" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' // Kotlin - implementation "androidx.navigation:navigation-fragment-ktx:2.5.3" - implementation "androidx.navigation:navigation-ui-ktx:2.5.3" + implementation "androidx.navigation:navigation-fragment-ktx:2.7.7" + implementation "androidx.navigation:navigation-ui-ktx:2.7.7" //root detection implementation 'com.scottyab:rootbeer-lib:0.1.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 955d04100..f4576c9da 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -19,9 +19,11 @@ - + + + @@ -40,8 +42,7 @@ android:theme="@style/DefaultTheme" tools:replace="android:allowBackup" android:hasFragileUserData="false" - android:taskAffinity="" - > + android:taskAffinity=""> doLayoutOff() OrbotConstants.STATUS_STARTING -> doLayoutStarting(requireContext()) @@ -88,7 +88,6 @@ class ConnectFragment : Fragment(), ConnectionHelperCallbacks, doLayoutOff() } } - } @@ -97,37 +96,6 @@ class ConnectFragment : Fragment(), ConnectionHelperCallbacks, return view } - private fun isNetworkAvailable(context: Context?): Boolean { - if (context == null) return false - val connectivityManager = - context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - val capabilities = - connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork) - if (capabilities != null) { - when { - capabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> { - return true - } - - capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> { - return true - } - - capabilities.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET) -> { - return true - } - } - } - } else { - val activeNetworkInfo = connectivityManager.activeNetworkInfo - if (activeNetworkInfo != null && activeNetworkInfo.isConnected) { - return true - } - } - return false - } - private fun stopTorAndVpn() { sendIntentToService(OrbotConstants.ACTION_STOP) sendIntentToService(OrbotConstants.ACTION_STOP_VPN) diff --git a/app/src/main/java/org/torproject/android/OrbotActivity.kt b/app/src/main/java/org/torproject/android/OrbotActivity.kt index 514f581ec..20473e017 100644 --- a/app/src/main/java/org/torproject/android/OrbotActivity.kt +++ b/app/src/main/java/org/torproject/android/OrbotActivity.kt @@ -215,21 +215,20 @@ class OrbotActivity : BaseActivity() { allCircumventionAttemptsFailed = false return } - var shouldDoOffLayout = true - if (Prefs.getConnectionPathway().equals(Prefs.PATHWAY_SMART)) { - shouldDoOffLayout = false + if (!Prefs.getConnectionPathway().equals(Prefs.PATHWAY_SMART) && fragConnect.isAdded && fragConnect.context != null) { + fragConnect.doLayoutOff() } - if (shouldDoOffLayout && fragConnect.isAdded) fragConnect.doLayoutOff() - } else fragConnect.doLayoutOff() + } else if (fragConnect.isAdded && fragConnect.context != null) { + fragConnect.doLayoutOff() + } } - OrbotConstants.STATUS_STARTING -> fragConnect.doLayoutStarting(this@OrbotActivity) - OrbotConstants.STATUS_ON -> fragConnect.doLayoutOn(this@OrbotActivity) + OrbotConstants.STATUS_STARTING -> if (fragConnect.isAdded && fragConnect.context != null) fragConnect.doLayoutStarting(this@OrbotActivity) + OrbotConstants.STATUS_ON -> if (fragConnect.isAdded && fragConnect.context != null) fragConnect.doLayoutOn(this@OrbotActivity) OrbotConstants.STATUS_STOPPING -> {} } previousReceivedTorStatus = status - } OrbotConstants.LOCAL_ACTION_LOG -> { diff --git a/app/src/main/java/org/torproject/android/ui/LogBottomSheet.kt b/app/src/main/java/org/torproject/android/ui/LogBottomSheet.kt index 614355d22..69b8f5cd4 100644 --- a/app/src/main/java/org/torproject/android/ui/LogBottomSheet.kt +++ b/app/src/main/java/org/torproject/android/ui/LogBottomSheet.kt @@ -7,9 +7,11 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.Button import android.widget.TextView import android.widget.Toast + +import com.google.android.material.floatingactionbutton.FloatingActionButton + import org.torproject.android.OrbotBottomSheetDialogFragment import org.torproject.android.R @@ -25,7 +27,7 @@ class LogBottomSheet : OrbotBottomSheetDialogFragment() { tvLog = v.findViewById(R.id.orbotLog) tvLog.text = buffer.toString() - v.findViewById