Updated on 2026-08-14
This commit is contained in:
parent
94d03fa010
commit
f8819c1235
4 changed files with 26 additions and 5 deletions
|
|
@ -278,7 +278,21 @@ class VerifyCard : androidx.fragment.app.Fragment(), NfcAdapter.ReaderCallback {
|
|||
else
|
||||
tvReusable.setText(R.string.one_off_banknote)
|
||||
|
||||
tvSigningMethod.text = ctx.card!!.signingMethod.description
|
||||
var s=""
|
||||
for(signingM in ctx.card!!.allowedSigningMethod) {
|
||||
s += if(signingM==ctx.card!!.signingMethod) {
|
||||
", <b>${signingM.description}</b>"
|
||||
} else {
|
||||
", <small>${signingM.description}</small>"
|
||||
}
|
||||
}
|
||||
s=s.substring(2,s.length)
|
||||
@Suppress("DEPRECATION")
|
||||
tvSigningMethod.text = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
Html.fromHtml(s, Html.FROM_HTML_MODE_LEGACY)
|
||||
else
|
||||
Html.fromHtml(s)
|
||||
|
||||
|
||||
if (ctx.card!!.status == TangemCard.Status.Loaded || ctx.card!!.status == TangemCard.Status.Purged) {
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ buildscript {
|
|||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.3.1'
|
||||
classpath 'com.android.tools.build:gradle:3.3.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ fun TangemCard.loadFromBundle(B: Bundle) {
|
|||
if (B.containsKey("settingsMask")) settingsMask = B.getInt("settingsMask")
|
||||
pauseBeforePIN2 = B.getInt("pauseBeforePIN2")
|
||||
if (B.containsKey("signingMethod"))
|
||||
setSigningMethod(TangemCard.SigningMethod.valueOf(B.getString("signingMethod")!!).ID)
|
||||
setSigningMethod(B.getInt("signingMethod"))
|
||||
if (B.containsKey("Manufacturer"))
|
||||
setManufacturer(Manufacturer.valueOf(B.getString("Manufacturer")!!), B.getBoolean("ManufacturerConfirmed", false))
|
||||
if (B.containsKey("EncryptionMode"))
|
||||
|
|
@ -108,7 +108,14 @@ fun TangemCard.saveToBundle(B: Bundle) {
|
|||
B.putInt("Health", health)
|
||||
if (settingsMask != null) B.putInt("settingsMask", settingsMask)
|
||||
B.putInt("pauseBeforePIN2", pauseBeforePIN2)
|
||||
if (signingMethod != null) B.putString("signingMethod", signingMethod.name)
|
||||
if( allowedSigningMethod!=null ){
|
||||
var iSigningMethod=0x80
|
||||
for(sM in allowedSigningMethod)
|
||||
{
|
||||
iSigningMethod=iSigningMethod.or(0x01.shl(sM.ID))
|
||||
}
|
||||
B.putInt("signingMethod", iSigningMethod)
|
||||
}
|
||||
if (manufacturer != null) B.putString("Manufacturer", manufacturer.name)
|
||||
if (encryptionMode != null) B.putString("EncryptionMode", encryptionMode.name)
|
||||
if (issuer != null) B.putString("Issuer", issuer.getID())
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ public class TangemCard {
|
|||
|
||||
private SigningMethod signingMethod;
|
||||
|
||||
private EnumSet<SigningMethod> allowedSigningMethod = EnumSet.noneOf(SigningMethod.class);
|
||||
public EnumSet<SigningMethod> allowedSigningMethod = EnumSet.noneOf(SigningMethod.class);
|
||||
|
||||
public void setSigningMethod(int signingMethodID) {
|
||||
allowedSigningMethod.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue