我使用AppSignatureHelper
该类生成了11个字符哈希.但是在将apk上传到Play商店后,他们的哈希不再起作用了.我发现Play用另一个替换了密钥,这也是哈希变化的原因.现在我无法获得11个字符的哈希密钥.
我不知道如何使用Google提供的命令.我从这里找到了这个命令
keytool -exportcert -alias MyAndroidKey -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11
因为,我的应用程序启用了Play App签名,我将不得不使用此命令,
keytool -exportcert -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11
我keytool
从JDK的bin文件夹中替换了它的路径,但后来它说不xxd
被识别所以我从网站上下载它现在说它tr
不被识别,我想它也会说cut …
我正在使用Kafka和Spring-boot:
卡夫卡制片人班:
@Service
public class MyKafkaProducer {
@Autowired
private KafkaTemplate<String, String> kafkaTemplate;
private static Logger LOGGER = LoggerFactory.getLogger(NotificationDispatcherSender.class);
// Send Message
public void sendMessage(String topicName, String message) throws Exception {
LOGGER.debug("========topic Name===== " + topicName + "=========message=======" + message);
ListenableFuture<SendResult<String, String>> result = kafkaTemplate.send(topicName, message);
result.addCallback(new ListenableFutureCallback<SendResult<String, String>>() {
@Override
public void onSuccess(SendResult<String, String> result) {
LOGGER.debug("sent message='{}' with offset={}", message, result.getRecordMetadata().offset());
}
@Override
public void onFailure(Throwable ex) {
LOGGER.error(Constants.PRODUCER_MESSAGE_EXCEPTION.getValue() + " : " + ex.getMessage());
}
}); …
Run Code Online (Sandbox Code Playgroud) apache-kafka kafka-consumer-api kafka-producer-api spring-kafka
我正在尝试从Java 7调用Kotlin函数.我正在使用协同程序,这个被调用的函数正在挂起,例如:
suspend fun suspendingFunction(): Boolean {
return async { longRunningFunction() }.await()
}
suspend fun longRunningFunction() : Boolean {
delay(400)
return true
}
Run Code Online (Sandbox Code Playgroud)
我在版本0.25.3中使用协同程序,我可以通过将Continuation<U>
实例作为参数传递给挂起函数来模拟简单的Java回调样式,例如
CoroutinesKt.suspendingFunction(new Continuation<Boolean>() {
@Override
public CoroutineContext getContext() {
return EmptyCoroutineContext.INSTANCE;
}
@Override
public void resume(Boolean value) {
doSomethingWithResult(value);
}
@Override
public void resumeWithException(@NotNull Throwable throwable) {
handleException(throwable);
}
});
Run Code Online (Sandbox Code Playgroud)
但是,在更新到完全稳定的1.0.1版本后,我认为它已不再可能.假设暂停函数的更新版本如下所示:
suspend fun suspendingFunction(): Boolean {
return GlobalScope.async { longRunningFunction() }.await()
}
Run Code Online (Sandbox Code Playgroud)
Continuation<U>
现在使用Result
类,它似乎无法从Java中使用(这是有意义的,因为它是内联类).我试图使用Continuation
协同程序的一些子类,但它们都是内部或私有的.
我知道通常建议将协程转换为CompletableFuture
,但我在Android上,这意味着只有Java 7.Future
另一方面,简单是太愚蠢,因为我不想定期检查函数是否完成 …
android ×2
apache-kafka ×1
command-line ×1
coroutine ×1
google-play ×1
java ×1
keytool ×1
kotlin ×1
spring-kafka ×1