mirror of
https://github.com/nacabaro/vbhelper.git
synced 2026-07-30 00:31:54 +00:00
Delete character from app after successful HCE transfer to VitalWear watch
When sending a character to the VitalWear watch via HCE, the transfer is atomic (single NFC interaction). The character was being left in the app after transfer, allowing it to be cloned indefinitely. Delete the character from the database immediately after sendCharacterToWatch succeeds, matching the behavior of physical bracelet transfers which delete the character once both write phases complete.
This commit is contained in:
parent
81bfec5ac5
commit
07315fe11b
@ -231,7 +231,9 @@ class ScanScreenControllerImpl(
|
||||
val proto = VitalWearCharacterExporter(componentActivity, database).buildCharacterProto(characterId)
|
||||
val client = VitalWearHceReaderClient(isoDep)
|
||||
client.sendCharacterToWatch(proto)
|
||||
Log.i("NFC_WRITE", "Character sent to VitalWear via HCE")
|
||||
database.userCharacterDao().deleteCharacterById(characterId)
|
||||
pendingExportCharacterId = null
|
||||
Log.i("NFC_WRITE", "Character sent to VitalWear and deleted from app (id=$characterId)")
|
||||
componentActivity.runOnUiThread {
|
||||
Toast.makeText(componentActivity, componentActivity.getString(R.string.scan_sent_character_success), Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user