mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Clear auth credentials post restore and when a user disables backups.
This commit is contained in:
committed by
Cody Henthorne
parent
9fd9760264
commit
962375e422
@@ -28,4 +28,4 @@ class MainActivity : ComponentActivity() {
|
||||
|
||||
setupWebView(this, webview, findButton, filterLevelButton, editButton, cancelEditButton, copyButton)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user