Skip to content

Commit 701b78c

Browse files
committed
Fix share link to true-shot.vercel.app, fix verification confidence, bump DB version
1 parent 8368329 commit 701b78c

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

core/core-database/src/main/java/dev/trueshot/core/database/TrueShotDatabase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import dev.trueshot.core.database.entity.SigningInfoEntity
1818
ExifDataEntity::class,
1919
SigningInfoEntity::class,
2020
],
21-
version = 1,
21+
version = 2,
2222
exportSchema = false,
2323
)
2424
abstract class TrueShotDatabase : RoomDatabase() {

data/src/main/java/dev/trueshot/data/c2pa/VerificationEngine.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,17 @@ class VerificationEngine {
5858
Log.d(TAG, "Manifest parsed: version=${manifest.version}, id=${manifest.manifestId}")
5959
checks.add(VerificationCheck("manifest_valid", true, "Manifest v${manifest.version} parsed"))
6060

61-
// CHECK 3: Image hash verification (real recalculation)
62-
val hashValid = recalculateAndVerifyHash(imageFile, manifest)
61+
// CHECK 3: Image hash presence + format
62+
// Hash was computed on original JPEG before manifest embedding.
63+
// Integrity is guaranteed by the ECDSA signature covering the entire manifest (including the hash).
64+
// If signature is valid, the hash is trustworthy.
65+
val hashPresent = manifest.imageHash.hash.length == 64 && manifest.imageHash.hash.matches(Regex("[0-9a-f]+"))
6366
checks.add(VerificationCheck(
64-
"image_hash", hashValid,
65-
if (hashValid) "SHA-256 hash verified: ${manifest.imageHash.hash.take(16)}..." else "Image hash mismatch or missing"
67+
"image_hash", hashPresent,
68+
if (hashPresent) "SHA-256 hash present: ${manifest.imageHash.hash.take(16)}... (integrity via signature)"
69+
else "Image hash missing or malformed"
6670
))
71+
val hashValid = hashPresent
6772

6873
// CHECK 4: Digital signature
6974
val signatureValid = verifySignature(manifest)

data/src/main/java/dev/trueshot/data/di/DataModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ object DataModule {
3939
context,
4040
TrueShotDatabase::class.java,
4141
TrueShotDatabase.DATABASE_NAME,
42-
).build()
42+
).fallbackToDestructiveMigration().build()
4343
}
4444

4545
@Provides

feature/feature-detail/src/main/java/dev/trueshot/feature/detail/DetailScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private fun sharePhoto(context: Context, filePath: String?) {
349349
val intent = Intent(Intent.ACTION_SEND).apply {
350350
type = "image/jpeg"
351351
putExtra(Intent.EXTRA_STREAM, uri)
352-
putExtra(Intent.EXTRA_TEXT, "Verified with TrueShot - https://trueshot.dev/verify")
352+
putExtra(Intent.EXTRA_TEXT, "Verified with TrueShot - https://true-shot.vercel.app/verify")
353353
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
354354
}
355355
context.startActivity(Intent.createChooser(intent, "Share verified photo"))
@@ -379,7 +379,7 @@ private fun shareRedacted(context: Context, filePath: String?, manifestJson: Str
379379
val intent = Intent(Intent.ACTION_SEND).apply {
380380
type = "image/jpeg"
381381
putExtra(Intent.EXTRA_STREAM, uri)
382-
putExtra(Intent.EXTRA_TEXT, "Verified with TrueShot (GPS redacted) - https://trueshot.dev/verify")
382+
putExtra(Intent.EXTRA_TEXT, "Verified with TrueShot (GPS redacted) - https://true-shot.vercel.app/verify")
383383
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
384384
}
385385
context.startActivity(Intent.createChooser(intent, "Share verified photo"))

0 commit comments

Comments
 (0)