Skip to content

Commit

Permalink
fix: v1 签名状态下读取渠道信息为空(根据上游 repo 的 PR Tencent#158
Browse files Browse the repository at this point in the history
  • Loading branch information
dandycheung committed Feb 6, 2025
1 parent fb668cd commit 083e950
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions command/src/main/java/com/tencent/vasdolly/command/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static String getSignMode(File apkFile) {
*/
public static String readChannel(File apkFile) {
String channel = ChannelReader.getChannelByV2(apkFile);
if (channel == null) {
if (channel.isEmpty()) {
channel = ChannelReader.getChannelByV1(apkFile);
}
return channel;
Expand Down Expand Up @@ -185,7 +185,7 @@ private static void generateV1ChannelApk(File baseApk, List<String> channelList,
//判断基础包是否已经包含渠道信息

String testChannel = ChannelReader.getChannelByV1(baseApk);
if (testChannel != null) {
if (!testChannel.isEmpty()) {
System.out.println("baseApk : " + baseApk.getAbsolutePath() + " has a channel : " + testChannel + ", only ignore");
return;
}
Expand Down Expand Up @@ -240,7 +240,7 @@ private static void generateV1ChannelApkMultiThread(File baseApk, List<String> c
String apkName = baseApk.getName();
//判断基础包是否已经包含渠道信息
String testChannel = ChannelReader.getChannelByV1(baseApk);
if (testChannel != null) {
if (!testChannel.isEmpty()) {
System.out.println("baseApk : " + baseApk.getAbsolutePath() + " has a channel : " + testChannel + ", only ignore");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ChannelReaderUtil {
public static String getChannel(Context context) {
if (mChannelCache == null) {
String channel = getChannelByV2(context);
if (channel == null) {
if (channel.isEmpty()) {
channel = getChannelByV1(context);
}
mChannelCache = channel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ abstract class BaseTask : DefaultTask() {

// 检查是否已经有渠道信息
val apkChannel = ChannelReader.getChannelByV1(baseApk)
if (apkChannel != null && apkChannel.isNotEmpty())
if (apkChannel.isNotEmpty())
throw GradleException("baseApk $baseApk.getAbsolutePath() has channel already")

channelList.forEach { channel ->
Expand Down

0 comments on commit 083e950

Please sign in to comment.