Files
Amber/app/src/main/java/com/greenart7c3/nostrsigner/SignerProvider.kt
T
Claude 296805ed03 Gate all logcat output behind BuildConfig.DEBUG
Route every android.util.Log call through a new AmberLog wrapper that
only emits when BuildConfig.DEBUG is true. Release builds now produce no
logcat output, keeping potentially sensitive data (npubs, relay URLs,
event payloads) out of device logs.

The debug gate lives in a single place (AmberLog), replacing the
scattered inline `if (BuildConfig.DEBUG)` guards in
NostrClientLoggerListener.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B4FaZsFdswYa1F2jTy4HLN
2026-06-19 09:12:54 +00:00

60 lines
1.6 KiB
Kotlin

package com.greenart7c3.nostrsigner
import android.content.ContentProvider
import android.content.ContentValues
import android.database.Cursor
import android.net.Uri
class SignerProvider : ContentProvider() {
override fun delete(
uri: Uri,
selection: String?,
selectionArgs: Array<String>?,
): Int = 0
override fun getType(uri: Uri): String? = null
override fun insert(
uri: Uri,
values: ContentValues?,
): Uri? = null
override fun onCreate(): Boolean = true
override fun query(
uri: Uri,
projection: Array<String>?,
selection: String?,
selectionArgs: Array<String>?,
sortOrder: String?,
): Cursor? {
val ctx = context
if (ctx == null) {
AmberLog.d(Amber.TAG, "No context")
return null
}
// External apps are always attributed to their own Android package. The
// requester identity is taken from the binder's calling package, never from
// caller-supplied query arguments, so an app cannot impersonate another one.
val caller = callingPackage
if (caller == null) {
AmberLog.d(Amber.TAG, "No calling package")
return null
}
return SignerProviderQuery.query(
context = ctx,
requesterId = caller,
callerPackageName = caller,
operationUri = uri,
arguments = projection,
)
}
override fun update(
uri: Uri,
values: ContentValues?,
selection: String?,
selectionArgs: Array<String>?,
): Int = 0
}