Remove unnecessary logging statements across various components to clean up code and improve readability. This includes removing debug, error, and warning logs from attachment handling, image processing, media loading, and profile management functionalities. Additionally, a script has been added to automate the removal of log statements from Kotlin files.
This commit is contained in:
@@ -110,7 +110,6 @@ private suspend fun performUnlock(
|
||||
name = account.name
|
||||
)
|
||||
|
||||
android.util.Log.d("UnlockScreen", "🔐 Starting connection and authentication...")
|
||||
|
||||
// Connect to server and authenticate
|
||||
ProtocolManager.connect()
|
||||
@@ -130,12 +129,10 @@ private suspend fun performUnlock(
|
||||
|
||||
kotlinx.coroutines.delay(300)
|
||||
|
||||
android.util.Log.d("UnlockScreen", "🔐 Starting authentication...")
|
||||
ProtocolManager.authenticate(account.publicKey, privateKeyHash)
|
||||
|
||||
accountManager.setCurrentAccount(account.publicKey)
|
||||
|
||||
android.util.Log.d("UnlockScreen", "✅ Unlock complete")
|
||||
onSuccess(decryptedAccount)
|
||||
} catch (e: Exception) {
|
||||
onError("Failed to unlock: ${e.message}")
|
||||
@@ -181,7 +178,6 @@ fun UnlockScreen(
|
||||
val biometricPrefs = remember { BiometricPreferences(context) }
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
android.util.Log.d("UnlockScreen", "🎬 SCREEN INITIALIZED - Activity: $activity")
|
||||
|
||||
var password by remember { mutableStateOf("") }
|
||||
var passwordVisible by remember { mutableStateOf(false) }
|
||||
@@ -203,7 +199,6 @@ fun UnlockScreen(
|
||||
|
||||
// Load accounts and pre-select last used account
|
||||
LaunchedEffect(Unit) {
|
||||
android.util.Log.d("UnlockScreen", "📦 LOADING DATA...")
|
||||
// ⚡ СИНХРОННОЕ чтение последнего аккаунта ДО загрузки списка
|
||||
val lastLoggedKey = accountManager.getLastLoggedPublicKey()
|
||||
|
||||
@@ -243,38 +238,27 @@ fun UnlockScreen(
|
||||
}
|
||||
savedPasswordsMap = passwords
|
||||
|
||||
android.util.Log.d("UnlockScreen", "🔐 Biometric available: $biometricAvailable")
|
||||
android.util.Log.d("UnlockScreen", "🔐 Biometric enabled: $isBiometricEnabled")
|
||||
android.util.Log.d("UnlockScreen", "🔐 Activity: $activity")
|
||||
android.util.Log.d("UnlockScreen", "🔐 Selected account: ${selectedAccount?.publicKey}")
|
||||
android.util.Log.d("UnlockScreen", "🔐 Saved passwords count: ${passwords.size}")
|
||||
android.util.Log.d("UnlockScreen", "🔐 Has password for selected: ${selectedAccount?.let { passwords.containsKey(it.publicKey) }}")
|
||||
|
||||
dataLoaded = true
|
||||
|
||||
android.util.Log.d("UnlockScreen", "✅ DATA LOADED")
|
||||
}
|
||||
|
||||
// Функция для запуска биометрической разблокировки
|
||||
fun tryBiometricUnlock() {
|
||||
if (selectedAccount == null || activity == null) {
|
||||
android.util.Log.d("UnlockScreen", "❌ Cannot start biometric: no account or activity")
|
||||
return
|
||||
}
|
||||
|
||||
val encryptedPassword = savedPasswordsMap[selectedAccount!!.publicKey]
|
||||
if (encryptedPassword == null) {
|
||||
android.util.Log.d("UnlockScreen", "❌ No saved password for account")
|
||||
return
|
||||
}
|
||||
|
||||
android.util.Log.d("UnlockScreen", "🔐 Starting biometric unlock...")
|
||||
|
||||
biometricManager.decryptPassword(
|
||||
activity = activity,
|
||||
encryptedData = encryptedPassword,
|
||||
onSuccess = { decryptedPassword ->
|
||||
android.util.Log.d("UnlockScreen", "✅ Biometric success, unlocking...")
|
||||
scope.launch {
|
||||
performUnlock(
|
||||
selectedAccount = selectedAccount,
|
||||
@@ -289,11 +273,9 @@ fun UnlockScreen(
|
||||
}
|
||||
},
|
||||
onError = { errorMessage ->
|
||||
android.util.Log.e("UnlockScreen", "❌ Biometric error: $errorMessage")
|
||||
error = errorMessage
|
||||
},
|
||||
onCancel = {
|
||||
android.util.Log.d("UnlockScreen", "🚫 Biometric cancelled")
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user