Replace hardcoded developer public key with Amber.DEVELOPER_HEX_KEY constant

- Define `DEVELOPER_HEX_KEY` constant in `Amber.kt` to centralize the developer's public key.
- Update `EventData.kt`, `CrashReportScreen.kt`, and `Amber.kt` to use the new constant instead of the hardcoded hex string when generating Nostr URI intents, direct messages, and Git issue events.
- Suppress unused exception variable in `Amber.isSocksProxyAlive`.
This commit is contained in:
greenart7c3
2026-03-23 13:12:22 -03:00
parent c0041e87bd
commit 1a7dbdca42
3 changed files with 9 additions and 7 deletions
@@ -151,7 +151,7 @@ class Amber :
socket.connect(InetSocketAddress(proxyHost, port), 5000)
socket.close()
true
} catch (e: Exception) {
} catch (_: Exception) {
false
}
}
@@ -521,7 +521,7 @@ class Amber :
val repositoryEvent = GitRepositoryEvent(
"",
"7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19",
DEVELOPER_HEX_KEY,
TimeUtils.now(),
tags = arrayOf(arrayOf("d", "Amber")),
"",
@@ -532,7 +532,7 @@ class Amber :
subject,
body,
EventHintBundle(repositoryEvent),
listOf(PTag("7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19", null)),
listOf(PTag(DEVELOPER_HEX_KEY, null)),
listOf(if (type == FeedbackType.BUG_REPORT) "bug" else "enhancement"),
)
@@ -551,6 +551,8 @@ class Amber :
const val TAG = "Amber"
lateinit var instance: Amber
private set
const val DEVELOPER_HEX_KEY = "7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19"
}
}
@@ -137,7 +137,7 @@ fun CrashReportScreen(
ClipEntry(ClipData.newPlainText("", report)),
)
val intent = Intent(Intent.ACTION_VIEW)
val npub = Hex.decode("7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19").toNpub()
val npub = Hex.decode(Amber.DEVELOPER_HEX_KEY).toNpub()
intent.data = "nostr:$npub".toUri()
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
Amber.instance.startActivity(intent)
@@ -155,7 +155,7 @@ fun CrashReportScreen(
val template = ChatMessageEvent.build(
msg = report,
to = listOf(PTag("7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19")),
to = listOf(PTag(Amber.DEVELOPER_HEX_KEY)),
createdAt = System.currentTimeMillis() / 1000,
) {
val thirtyDaysInSeconds = 30L * 86_400
@@ -247,7 +247,7 @@ fun ReportMissingEventKindButton(account: Account, kind: Int) {
),
)
val intent = Intent(Intent.ACTION_VIEW)
val npub = Hex.decode("7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19").toNpub()
val npub = Hex.decode(Amber.DEVELOPER_HEX_KEY).toNpub()
intent.data = "nostr:$npub".toUri()
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
Amber.instance.startActivity(intent)
@@ -258,7 +258,7 @@ fun ReportMissingEventKindButton(account: Account, kind: Int) {
client.connect()
val template = ChatMessageEvent.build(
msg = text,
to = listOf(PTag("7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19")),
to = listOf(PTag(Amber.DEVELOPER_HEX_KEY)),
createdAt = System.currentTimeMillis() / 1000,
) {
val tenDaysInSeconds = 10L * 86_400