Clear auth credentials post restore and when a user disables backups.

This commit is contained in:
Alex Hart
2025-08-01 13:07:54 -03:00
committed by Cody Henthorne
parent 9fd9760264
commit 962375e422
9 changed files with 57 additions and 37 deletions

View File

@@ -28,4 +28,4 @@ class MainActivity : ComponentActivity() {
setupWebView(this, webview, findButton, filterLevelButton, editButton, cancelEditButton, copyButton)
}
}
}

View File

@@ -16,16 +16,16 @@ import android.widget.Button
import org.signal.debuglogsviewer.app.R
fun setupWebView(
context: Context,
webview: WebView,
findButton: Button,
context: Context,
webview: WebView,
findButton: Button,
filterLevelButton: Button,
editButton: Button,
cancelEditButton: Button,
copyButton: Button
editButton: Button,
cancelEditButton: Button,
copyButton: Button
) {
val originalContent = org.json.JSONObject.quote(getLogText(context))
var readOnly = true
var readOnly = true
webview.settings.apply {
javaScriptEnabled = true
@@ -73,7 +73,7 @@ fun setupWebView(
}
copyButton.setOnClickListener { // In Signal app, use Util.writeTextToClipboard(context, value) instead
webview.evaluateJavascript ("editor.getValue();") { value ->
webview.evaluateJavascript("editor.getValue();") { value ->
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText(context.getString(R.string.app_name), value)
clipboard.setPrimaryClip(clip)
@@ -87,4 +87,4 @@ fun getLogText(context: Context): String {
} catch (e: Exception) {
"Error loading file: ${e.message}"
}
}
}

View File

@@ -83,10 +83,10 @@ object DebugLogsViewer {
@JvmStatic
fun onCopy(webview: WebView, context: Context, appName: String) {
webview.evaluateJavascript ("editor.getValue();") { value ->
webview.evaluateJavascript("editor.getValue();") { value ->
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText(appName, value)
clipboard.setPrimaryClip(clip)
}
}
}
}