38 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# star_lock
A new Flutter project.
## 配置签名
为发布渠道创建JAVA密钥储存(密钥库)文件 `.jks`,或者 `.keystore` 文件。
```bash
keytool -genkey -v -keystore android/app/sky.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
```
请记住你输入的主密码和键密码
因为本项目将会发布2个以上的渠道所以密钥库也会有2个以上请注意区分 同一个发布渠道必须使用同一个密钥库,不要生成多个。
为了编译管理方便,我们将密钥库文件放在了项目代码内。
`key.properties` 文件用于存放密钥库的相关信息,但是我们不用这个文件,而是直接在 `build.gradle` 中写入密钥库的相关信息。
因为我们将密钥库文件本身都已经储存在git中了也就没必要再单独存放密钥信息了。
## 编译
```bash
flutter build apk --split-per-abi --release --flavor dev -t lib/main_dev.dart
```
## 获取编译包的签名
用于APP备案国内商店上架等
需要使用到`apksigner`工具对于Windows来说它在`C:\Users\myUser\AppData\Local\Android\Sdk\build-tools\34.0.0\lib`
`git bash` 中我需要使用 `apksigner.bat` 来使用它;在其它系统中应该可以直接使用 `apksigner` 命令即可。
参阅:[How to find signature of apk file?](https://stackoverflow.com/questions/38558623/how-to-find-signature-of-apk-file)
```bash
apksigner verify --print-certs -v build/app/outputs/flutter-apk/app-sky-release.apk
```