Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7zip打包后AssetManager#list(String path) 返回数组第一个索引为空字符串 #162

Open
c86y opened this issue Jun 7, 2017 · 14 comments

Comments

@c86y
Copy link

c86y commented Jun 7, 2017

#125 曾经提到过这个问题,没看到解决方案。
在1.2.3上我复现了此问题,目前发现只有7zip打包后才会出现,调用AssetManager#list(String path)返回如下的数组,首个元素为空字符串。
[, Info, Resource]
而且经过验证7zip无论是使用plugin内部artifact配置的,还是使用mac自带的都有问题。
gradle 配置如下

sevenzip {
        artifact = "com.tencent.mm:SevenZip:${ANDRESGUARD_VERSION}"
        //path = "/usr/local/bin/7za"
}
@simpleton
Copy link
Collaborator

@c86y 可否提供一份7zip的安装包和andresguard之前的安装包让我debug下呢?

@c86y c86y closed this as completed Jun 7, 2017
@c86y
Copy link
Author

c86y commented Jun 7, 2017

@simpleton
zip里放了三个包:
andresguard之前的包:app-ax-ay-universal-release.apk
andresguard没用7zip的包:app-ax-ay-universal-release_signed_aligned.apk
andresguard用了7zip的包:app-ax-ay-universal-release_signed_7zip_aligned.apk

issue#162.zip

@simpleton simpleton reopened this Jun 7, 2017
@simpleton
Copy link
Collaborator

收到,我稍晚排查一下。

@c86y
Copy link
Author

c86y commented Jun 7, 2017

@simpleton
这个问题应该比较好复现,我随手写个demo也有这个问题

@simpleton
Copy link
Collaborator

simpleton commented Jun 7, 2017 via email

@c86y
Copy link
Author

c86y commented Jun 7, 2017

AndResGuard-example.zip
@simpleton
这个是基于example改的,app做了修改,可以试试看

我用的开发机是Moto G

目前看是只有7zip包有问题

@c86y
Copy link
Author

c86y commented Jun 13, 2017

hi,这个问题最近有什么进展吗?

@simpleton
Copy link
Collaborator

@c86y 不好意思,debug下来还没有什么解决的思路。 @shwenzhang

@c86y
Copy link
Author

c86y commented Jun 13, 2017

建议先在README里加下7zip的这个issue,免得其他人再踩坑。微信确实在使用这套7zip的压缩方案吗?之前没有遇到问题?另外gradle plugin对flavor dimension也不支持,我自己稍作修改支持了这个功能,待验证ok后提个PR。

@simpleton
Copy link
Collaborator

simpleton commented Jun 13, 2017

@c86y 我现在没有在微信团队了,当时是采用了7zip的方案的。现在tinker也在引这边的7zip的jcenter repo。 不过后来有了v2签名,是无法再试用7zip压缩了。所以我现在不知道采用了什么方案。
@shwenzhang 来解答下?

另外flavor是支持的,dimension没有支持。欢迎pr

simpleton added a commit that referenced this issue Jun 13, 2017
@c86y
Copy link
Author

c86y commented Jun 14, 2017

OK

@zhenghuiguo
Copy link

gradle版本是2.3.3 AndResGuard-gradle-plugin:1.2.6 同步后在gradle -tasks 中没有生成andresproruard 文件夹是什么原因呢?

@simpleton
Copy link
Collaborator

@zhenghuiguo 不要再不相关的issue下跟帖提问。
PS: 现在的task group叫做andresguard

@wangankang
Copy link

@c86y 请问dimension怎么支持的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants