Browse Source

show se update fail page

V1.1.0-btc-release
ZhangJun 5 years ago
parent
commit
3a348a2ddf
  1. 3
      app/src/main/java/com/cobo/cold/selfcheck/SecurityCheck.java
  2. 8
      app/src/main/java/com/cobo/cold/ui/fragment/AttackWarningFragment.java
  3. 2
      app/src/main/res/values-zh-rCN/strings.xml
  4. 2
      app/src/main/res/values/strings.xml

3
app/src/main/java/com/cobo/cold/selfcheck/SecurityCheck.java

@ -52,6 +52,7 @@ public class SecurityCheck {
private static final int CODE_FW_STATUS_NOT_FOUND = 0x0200;
private static final int CODE_FW_STATUS_ATTACKED = 0x0300;
private static final int CODE_FW_ERT_ATTACKED = 0x0400;
public static final int CODE_FW_IN_BOOTMODE = 0x0500;
public CheckResult doSelfCheck(AppCompatActivity context) {
Log.i(TAG, "start self checking...");
@ -124,7 +125,7 @@ public class SecurityCheck {
}
} else {
// has not 0102 tag ,is in boot mode
return CODE_FW_OK;
return CODE_FW_IN_BOOTMODE;
}
} catch (EncryptionCoreException e) {
Log.e(TAG, e.toString());

8
app/src/main/java/com/cobo/cold/ui/fragment/AttackWarningFragment.java

@ -34,6 +34,7 @@ import java.util.Locale;
import java.util.Objects;
import java.util.concurrent.Executors;
import static com.cobo.cold.selfcheck.SecurityCheck.CODE_FW_IN_BOOTMODE;
import static com.cobo.cold.ui.fragment.setting.MainPreferenceFragment.removeAllFingerprint;
public class AttackWarningFragment extends BaseFragment<AttackWarningBinding> {
@ -54,6 +55,13 @@ public class AttackWarningFragment extends BaseFragment<AttackWarningBinding> {
Bundle data = Objects.requireNonNull(getArguments());
mBinding.hint.setText(getString(R.string.attack_warning,
formatErrorCode(data)));
int firmware = data.getInt("firmware");
if (firmware == CODE_FW_IN_BOOTMODE) {
mBinding.text1.setText(R.string.update_failed);
mBinding.hint.setText(getString(R.string.contact_cobo_service,formatErrorCode(data)));
}
mBinding.powerOff.setOnClickListener(v -> handleAttack(mActivity));
mBinding.serialno.setText(getString(R.string.serialno, SystemProperties.get("persist.sys.serialno")));
mBinding.icon.setOnClickListener(new AboutFragment.ExportLogHandler(mActivity, Executors.newSingleThreadExecutor()));

2
app/src/main/res/values-zh-rCN/strings.xml

@ -308,4 +308,6 @@
<string name="electrum_compatibility">适配 Electrum</string>
<string name="identification_failed">交易识别失败</string>
<string name="from_electrum">来自Electrum</string>
<string name="update_failed">升级失败</string>
<string name="contact_cobo_service">您可邮件联系客服:support@cobo.com\n 状态码:%s</string>
</resources>

2
app/src/main/res/values/strings.xml

@ -332,4 +332,6 @@
<string name="electrum_compatibility">Electrum Compatibility</string>
<string name="identification_failed">Identification Failed</string>
<string name="from_electrum">From Electrum</string>
<string name="update_failed">Update failed</string>
<string name="contact_cobo_service">contact us: support@cobo.com\n Status Code:%s</string>
</resources>

Loading…
Cancel
Save