|
@@ -15,7 +15,6 @@ import android.view.WindowInsets
|
|
|
import android.view.WindowInsetsController
|
|
|
import android.view.WindowManager
|
|
|
import androidx.activity.compose.setContent
|
|
|
-import androidx.annotation.RequiresApi
|
|
|
import androidx.compose.foundation.isSystemInDarkTheme
|
|
|
import androidx.compose.runtime.getValue
|
|
|
import androidx.compose.runtime.mutableStateOf
|
|
@@ -28,6 +27,7 @@ import androidx.core.content.ContextCompat
|
|
|
import androidx.core.view.WindowCompat
|
|
|
import androidx.fragment.app.FragmentManager
|
|
|
import androidx.navigation.compose.rememberNavController
|
|
|
+import com.google.firebase.crashlytics.FirebaseCrashlytics
|
|
|
import com.vpn.fastestvpnservice.activities.DockActivity
|
|
|
import com.vpn.fastestvpnservice.activities.SplashActivity2
|
|
|
import com.vpn.fastestvpnservice.beans.isDarkTheme
|
|
@@ -104,12 +104,22 @@ open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityRecei
|
|
|
|
|
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
|
|
|
|
|
- wifiManager = applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
|
|
- wifiScanReceiver = WifiScanReceiver()
|
|
|
- intentFilter = IntentFilter()
|
|
|
- intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION)
|
|
|
+// wifiManager = applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
|
|
+// wifiScanReceiver = WifiScanReceiver()
|
|
|
+// intentFilter = IntentFilter()
|
|
|
+// intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION)
|
|
|
+//
|
|
|
+// ContextCompat.registerReceiver(applicationContext, wifiScanReceiver, intentFilter, ContextCompat.RECEIVER_NOT_EXPORTED)
|
|
|
+
|
|
|
+ val isLoggedIn = basePreferenceHelper.getLoggedInState()
|
|
|
|
|
|
- ContextCompat.registerReceiver(applicationContext, wifiScanReceiver, intentFilter, ContextCompat.RECEIVER_NOT_EXPORTED)
|
|
|
+ if (isLoggedIn) {
|
|
|
+ val email = basePreferenceHelper.getUser()?.userinfo?.email
|
|
|
+ if (email != null) {
|
|
|
+ FirebaseCrashlytics.getInstance().setUserId(email)
|
|
|
+ FirebaseCrashlytics.getInstance().setCustomKey("email", email)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
setContent {
|
|
|
val context = LocalContext.current
|