fix(apk): 清理重复的 BootReceiver 源文件并修正 keystore 别名

- 删除 com/gztbyc/sandan/BootReceiver.java(重复类导致 javac 报错)
- 别名修正为 __uni__0b3dad3(DCloud 规则:__uni__ + appid 小写)
- config/README 与 example 补充别名规则说明
This commit is contained in:
liufumingren 2026-10-02 21:36:23 +08:00
parent 3251be25a4
commit 807b545506
3 changed files with 2 additions and 36 deletions

View File

@ -1,34 +0,0 @@
package com.gztbyc.pda_wms;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/**
* 开机自启:监听系统开机完成广播,自动拉起应用。
* 说明:Android 3.1+ 要求应用至少被用户启动过一次后,BOOT_COMPLETED 才会送达。
*/
public class BootReceiver extends BroadcastReceiver {
private static final String ACTION_QUICKBOOT_POWERON = "android.intent.action.QUICKBOOT_POWERON";
@Override
public void onReceive(Context context, Intent intent) {
if (intent == null || intent.getAction() == null) {
return;
}
final String action = intent.getAction();
if (!Intent.ACTION_BOOT_COMPLETED.equals(action) && !ACTION_QUICKBOOT_POWERON.equals(action)) {
return;
}
try {
Intent launch = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
if (launch != null) {
launch.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(launch);
}
} catch (Exception e) {
// 启动失败不阻断系统广播
}
}
}

View File

@ -20,7 +20,7 @@
| `wwwSource` | App 资源目录。留空则依次尝试 `unpackage/resources/<appId>/www`、`dist/build/app-plus` |
| `runtimeVersion` | 离线 SDK 的 5+ Runtime 版本。`prepare.cjs` 会把 www 内 `manifest.json`/`app-config-service.js` 的 `compilerVersion` 对齐到该值,避免启动时弹「HBuilderX %s 编译 / 手机端 SDK %s」提示 |
| `signing.keystore` | 签名文件路径(相对项目根),放在 `android-offline/keystore/`(该目录 git 不跟踪) |
| `signing.storePassword` / `keyAlias` / `keyPassword` | 签名密码与别名,**自己填写,不要提交** |
| `signing.storePassword` / `keyAlias` / `keyPassword` | 签名密码与别名,**自己填写,不要提交**。DCloud 下发的 keystore(PKCS12)别名固定为 `__uni__` + appid 小写,本项目即 `__uni__0b3dad3`;PKCS12 的 `storePassword` 与 `keyPassword` 必须相同 |
## appKey 务必与三者一致

View File

@ -11,7 +11,7 @@
"signing": {
"keystore": "android-offline/keystore/xxx.keystore",
"storePassword": "",
"keyAlias": "",
"keyAlias": "__uni__0b3dad3",
"keyPassword": ""
}
}