mirror of
https://github.com/selfxyz/self.git
synced 2026-04-27 03:01:15 -04:00
Merge branch 'dev' of https://github.com/zk-passport/openpassport into dev
This commit is contained in:
@@ -85,8 +85,8 @@ android {
|
||||
applicationId "com.proofofpassportapp"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 12
|
||||
versionName "1.1"
|
||||
versionCode 13
|
||||
versionName "1.2"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cppFlags += "-fexceptions -frtti -std=c++11"
|
||||
|
||||
@@ -272,16 +272,29 @@ class RNPassportReaderModule(private val reactContext: ReactApplicationContext)
|
||||
override fun doInBackground(vararg params: Void?): Exception? {
|
||||
try {
|
||||
eventMessageEmitter(Messages.STOP_MOVING)
|
||||
isoDep.timeout = 10000
|
||||
isoDep.timeout = 20000
|
||||
Log.e("MY_LOGS", "This should obvsly log")
|
||||
val cardService = CardService.getInstance(isoDep)
|
||||
Log.e("MY_LOGS", "cardService gotten")
|
||||
cardService.open()
|
||||
val cardService = try {
|
||||
CardService.getInstance(isoDep)
|
||||
} catch (e: Exception) {
|
||||
Log.e("MY_LOGS", "Failed to get CardService instance", e)
|
||||
throw e
|
||||
}
|
||||
|
||||
try {
|
||||
cardService.open()
|
||||
} catch (e: Exception) {
|
||||
Log.e("MY_LOGS", "Failed to open CardService", e)
|
||||
isoDep.close()
|
||||
Thread.sleep(500)
|
||||
isoDep.connect()
|
||||
cardService.open()
|
||||
}
|
||||
Log.e("MY_LOGS", "cardService opened")
|
||||
val service = PassportService(
|
||||
cardService,
|
||||
PassportService.NORMAL_MAX_TRANCEIVE_LENGTH,
|
||||
PassportService.DEFAULT_MAX_BLOCKSIZE,
|
||||
PassportService.NORMAL_MAX_TRANCEIVE_LENGTH * 2,
|
||||
PassportService.DEFAULT_MAX_BLOCKSIZE * 2,
|
||||
false,
|
||||
false,
|
||||
)
|
||||
@@ -313,14 +326,39 @@ class RNPassportReaderModule(private val reactContext: ReactApplicationContext)
|
||||
}
|
||||
Log.e("MY_LOGS", "Sending select applet command with paceSucceeded: ${paceSucceeded}") // this is false so PACE doesn't succeed
|
||||
service.sendSelectApplet(paceSucceeded)
|
||||
|
||||
if (!paceSucceeded) {
|
||||
try {
|
||||
Log.e("MY_LOGS", "trying to get EF_COM...")
|
||||
service.getInputStream(PassportService.EF_COM).read()
|
||||
} catch (e: Exception) {
|
||||
Log.e("MY_LOGS", "doing BAC")
|
||||
service.doBAC(bacKey) // <======================== error happens here
|
||||
Log.e("MY_LOGS", "BAC done")
|
||||
var bacSucceeded = false
|
||||
var attempts = 0
|
||||
val maxAttempts = 3
|
||||
|
||||
while (!bacSucceeded && attempts < maxAttempts) {
|
||||
try {
|
||||
attempts++
|
||||
Log.e("MY_LOGS", "BAC attempt $attempts of $maxAttempts")
|
||||
|
||||
if (attempts > 1) {
|
||||
// Wait before retry
|
||||
Thread.sleep(500)
|
||||
}
|
||||
|
||||
// Try to read EF_COM first
|
||||
try {
|
||||
service.getInputStream(PassportService.EF_COM).read()
|
||||
} catch (e: Exception) {
|
||||
// EF_COM failed, do BAC
|
||||
service.doBAC(bacKey)
|
||||
}
|
||||
|
||||
bacSucceeded = true
|
||||
Log.e("MY_LOGS", "BAC succeeded on attempt $attempts")
|
||||
|
||||
} catch (e: Exception) {
|
||||
Log.e("MY_LOGS", "BAC attempt $attempts failed: ${e.message}")
|
||||
if (attempts == maxAttempts) {
|
||||
throw e // Re-throw on final attempt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -500,7 +500,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = OpenPassport/OpenPassportDebug.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 63;
|
||||
CURRENT_PROJECT_VERSION = 64;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = 5B29R5LYHQ;
|
||||
ENABLE_BITCODE = NO;
|
||||
@@ -615,7 +615,7 @@
|
||||
"$(PROJECT_DIR)",
|
||||
"$(PROJECT_DIR)/MoproKit/Libs",
|
||||
);
|
||||
MARKETING_VERSION = 1.9.6;
|
||||
MARKETING_VERSION = 1.9.7;
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
"-ObjC",
|
||||
@@ -639,7 +639,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = OpenPassport/OpenPassport.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 63;
|
||||
CURRENT_PROJECT_VERSION = 64;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = 5B29R5LYHQ;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
@@ -753,7 +753,7 @@
|
||||
"$(PROJECT_DIR)",
|
||||
"$(PROJECT_DIR)/MoproKit/Libs",
|
||||
);
|
||||
MARKETING_VERSION = 1.9.6;
|
||||
MARKETING_VERSION = 1.9.7;
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
"-ObjC",
|
||||
|
||||
@@ -1737,10 +1737,10 @@ CHECKOUT OPTIONS:
|
||||
SPEC CHECKSUMS:
|
||||
amplitude-react-native: 3fc003fed8453ac8131703869cc52ea626196a83
|
||||
boost: 4cb898d0bf20404aab1850c656dcea009429d6c1
|
||||
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
|
||||
DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5
|
||||
FBLazyVector: 430e10366de01d1e3d57374500b1b150fe482e6d
|
||||
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
|
||||
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
|
||||
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
|
||||
lottie-ios: a881093fab623c467d3bce374367755c272bdd59
|
||||
NFCPassportReader: a160b80e3df3b5325c13902f90405f5eef7520b3
|
||||
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
|
||||
|
||||
Reference in New Issue
Block a user