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

你有哪些经过验证的APK瘦身方法? #119

Open
zmywly8866 opened this issue Apr 3, 2015 · 6 comments
Open

你有哪些经过验证的APK瘦身方法? #119

zmywly8866 opened this issue Apr 3, 2015 · 6 comments

Comments

@zmywly8866
Copy link

APK如何瘦身?有哪些方法?

@lonelee
Copy link

lonelee commented Apr 4, 2015

  1. 图片文件压缩;
  2. 功能模块插件化;
  3. 删减引用库中不需要的部分,例如减少support-v4中一些目前不需要用到的类;

补充,刚看到一个不错的链接,可以参考下:
http://www.jianshu.com/p/bd90dee57ad0

@tian9246
Copy link

tian9246 commented Apr 5, 2015

如果是不是目标版本的so 可以用7z进行压缩,然后解压

@Rowandjj
Copy link

Rowandjj commented Apr 5, 2015

1.图片压缩;
2.精简jar包;
3.lint检查,去掉没有引用的资源;
4.部分资源文件、数据库文件可从网络获取;
5.开启proguard压缩优化;
6.持续优化代码;
7.资源适配重点关注xhdpi和hdpi

@QichaoChen
Copy link

Android Studio的Gradle构建系统支持自动移除无用的资源,基本配置如下

android {
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

更多详细内容参考http://tools.android.com/tech-docs/new-build-system/resource-shrinking

@tim1004457
Copy link

7zip压缩优化,这一步在gradle中如何使用?

@farmerjohngit
Copy link

可以通过删除R.class文件来达到减少apk大小和dex数量
https://github.com/mogujie/ThinRPlugin

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

7 participants