Browse Source
* modify strings * move update public to android app * modify tx list UI * modify UI * fix read firmware version code timeout * modify version code * fix some UI issue * fix some UI issueV1.1.0-release
JunZhang
5 years ago
committed by
GitHub
18 changed files with 81 additions and 88 deletions
@ -1,47 +0,0 @@ |
|||
/* |
|||
* Copyright (c) 2020 Cobo |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* in the file COPYING. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.cobo.cold.callables; |
|||
|
|||
import com.cobo.cold.encryption.interfaces.CONSTANTS; |
|||
import com.cobo.cold.encryptioncore.base.Packet; |
|||
import com.cobo.cold.encryptioncore.base.Payload; |
|||
|
|||
import java.util.concurrent.Callable; |
|||
|
|||
public class GetUpdateKeyCallable implements Callable<String> { |
|||
@Override |
|||
public String call() { |
|||
try { |
|||
|
|||
final Packet packet = new Packet.Builder(CONSTANTS.METHODS.GET_UPDATE_KEY) |
|||
.addBytePayload(CONSTANTS.TAGS.UPDATE_KEY_OPERATION, CONSTANTS.VALS.READ_UPDATE_KEY) |
|||
.build(); |
|||
final Callable<Packet> callable = new BlockingCallable(packet); |
|||
final Packet result = callable.call(); |
|||
final Payload payload = result.getPayload(CONSTANTS.TAGS.UPDATE_KEY); |
|||
|
|||
if (payload != null) { |
|||
return payload.toHex(); |
|||
} |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
} |
Loading…
Reference in new issue