Skip to content

Commit

Permalink
类型回退
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Dec 2, 2024
1 parent 2287913 commit 24bb904
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public String generateLocalLicense() throws Exception {
System.currentTimeMillis(),
LocalDateTime.now().plusDays(15).atOffset(ZoneOffset.UTC).toInstant().toEpochMilli(),
tlUI(Lang.FREE_LICENSE_DESCRIPTION),
"Local License", true);
"Local License", "local");
var encrypted = (RSAUtils.encryptByPrivateKey(new Gson().toJson(key).getBytes(StandardCharsets.UTF_8),
Base64.getEncoder().encodeToString(getLocalKeyPair().getKey().getEncoded())));
return Base64.getEncoder().encodeToString(encrypted);
Expand Down Expand Up @@ -134,7 +134,8 @@ public static class KeyData {
// 隐藏字段,主要是为了改变 KEY,PBH 并不关心这个字段
@Nullable
private String hidden;
private boolean localLicense;
@Nullable
private String type = "afdian"; // 默认字段
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ public boolean isActivated() {
}

public boolean isLocalLicense() {
return this.keyData != null && this.keyData.isLocalLicense();
return this.keyData != null && "local".equals(this.keyData.getType());
}
}
12 changes: 10 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ config-version: 26
# en_us English (US)
# zh_cn Chinese Simplified (简体中文)
language: default
# PBH Plus 捐赠密钥 (https://afdian.com/a/Ghost_chu),如果你有的话,就填在这里吧
# PBH Plus donation key, if you have one, please fill to there
# PBH Plus 的捐赠密钥,填写后将激活捐赠功能。
# PeerBanHelper 是一个非营利、开放源代码的免费软件。维护 PeerBanHelper 是一项持续的任务,
# 我们的团队成员每个月在上面花费大量的时间与恶意Peer进行技术对抗,因此你的支持对我们来说至关重要。
# 如果您不想捐赠 PeerBanHelper,请通过 WebUI 创建本地免费许可证,它与通过捐赠获取的捐赠密钥在功能上相同。
# A donation key for PBH Plus, which when filled out will activate the donation feature.
# PeerBanHelper is a non-profit, open source, freeware program. Maintaining PeerBanHelper is an ongoing task,
# and our team members spend a lot of time on it each month in technical confrontations with malicious Peers,
# so your support is vital to us.
# If you don't want to donate PeerBanHelper, please create a local free license via WebUI,
# which is functionally identical to the donation key obtained via donation.
pbh-plus-key: ''
# Http 服务器设置
# Http Server Settings
Expand Down

0 comments on commit 24bb904

Please sign in to comment.