Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
//noinspection ExpiredTargetSdkVersion
targetSdk 29 // 超过29后,文件权限要大改
versionCode 4
versionName '1.20.0-release'
versionName '1.20.1-release'
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "599fe3f0f0f55d42155fae05", //JPush上注册的包名对应的Appkey,与包名相关,如果修改package name,需要自行注册极光推送账号,并修改这个选项
Expand Down
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"filters": [],
"attributes": [],
"versionCode": 4,
"versionName": "1.20.0-release",
"outputFile": "hac-1.20.0-release.apk"
"versionName": "1.20.1-release",
"outputFile": "hac-1.20.1-release.apk"
}
],
"elementType": "File"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,17 @@ protected void callback(CallbackParams params) {
}
}

/**
* 将处理结果返回到WebView
* 仅支持派发到指定的异步回调
*
* @param params 参数
* @param ticket 异步回调的标识
*/
protected void callback(String ticket, CallbackParams params) {
getInterop().callback(ticket, params);
}

/**
* 将处理结果返回到WebView
* 采用简化方式完成,仅支持写入单元格
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ public void startOnKeyDownListenAsync(String ticket, String theKey) {

registryForFeatureUsageAnalyze("listen_keydown_feature", "onKeyDownAsync");

registryCallbackTicket(ticket);

getConfigManager().upsertStringEntry(ConfigManager.PREFERENCE_KEY_ON_KEY_DOWN_LISTEN, getConfigManager().getOnKeyDownListen() + theKey + ",");

startReceiver(theKey);
startReceiver(theKey, ticket);
}

@JavascriptInterface
Expand All @@ -53,7 +51,7 @@ public void stopAllOnKeyDownListen() {
getConfigManager().upsertStringEntry(ConfigManager.PREFERENCE_KEY_ON_KEY_DOWN_LISTEN, ",");
}

private void startReceiver(String theKey) {
private void startReceiver(String theKey, String ticket) {

BroadcastDispatcher.BroadcastHandler handler = new BroadcastDispatcher.BroadcastHandler() {

Expand All @@ -66,8 +64,9 @@ public String getAction() {
@Override
public boolean handle(@Nullable Bundle extras) {

// 调用注册的回调,不要自动派发的方式,需要显式设置回调的标识
callback(ticket, CallbackParams.success(this.getAction()));

callback(CallbackParams.success(this.getAction()));
return false;
}
};
Expand Down