Git Product home page Git Product logo

Comments (18)

shwenzhang avatar shwenzhang commented on July 17, 2024 6

@kongnanlive ,并没有冒犯你的意思。如果让你觉得不舒服,这里我道歉。只是个人认为任何的提问都是建立在自己已经充分研究的基础上。对于为什么不同的target编译出来的包不一样大小,也是非常好理解的

from tinker.

dodola avatar dodola commented on July 17, 2024 3

@kongnanlive 这个问题是因为assembleDebug和AndroidStudio直接运行生成出来的包不一致造成的。。。。

from tinker.

dodola avatar dodola commented on July 17, 2024 1

@411370845 你需要指定r.txt路径

from tinker.

shwenzhang avatar shwenzhang commented on July 17, 2024

resources.arsc改变,请先仔细查看文档与使用说明

from tinker.

411370845 avatar 411370845 commented on July 17, 2024

@dodola 知道了,tinkerPatchDebug成功了,谢谢两位大神

from tinker.

kongnanlive avatar kongnanlive commented on July 17, 2024

@shwenzhang 你好,看了你的这篇博客https://my.oschina.net/shwenzhang/blog/751618,你们是怎么做到补丁包10K的?按教程打补丁tinker-sample-android都要有166kb(仅仅打开一句log),差太多了吧?补丁包里面多了很多并没有改变过的图片,是因为你们微信res资源混淆过了吗?

from tinker.

shwenzhang avatar shwenzhang commented on July 17, 2024

@kongnanlive ,你看看补丁包具体的内容,只改变一句log,补丁包是在4k以内的。

from tinker.

shwenzhang avatar shwenzhang commented on July 17, 2024

如果使用了资源混淆需要保证两次混淆的时候使用同一份mapping,请根据教程配置

from tinker.

kongnanlive avatar kongnanlive commented on July 17, 2024

@shwenzhang 没用mapping我是debug模式,日子发你看下。
log.txt

from tinker.

shwenzhang avatar shwenzhang commented on July 17, 2024

日志你自己也可以看到,不是说的很清楚,找到很多新增的资源?你自己解压两个安装包就知道是否是真的新增了?

from tinker.

kongnanlive avatar kongnanlive commented on July 17, 2024

@shwenzhang 问题是这些图片为什么会是新增的?
add resource: res/drawable-xxxhdpi-v4/abc_btn_check_to_on_mtrl_000.png, oldSize=0, newSize=295
add resource: res/drawable-xxxhdpi-v4/abc_btn_check_to_on_mtrl_015.png, oldSize=0, newSize=551
add resource: res/drawable-xxxhdpi-v4/abc_btn_radio_to_on_mtrl_000.png, oldSize=0, newSize=1014
add resource: res/drawable-xxxhdpi-v4/abc_btn_radio_to_on_mtrl_015.png, oldSize=0, newSize=1226
add resource: res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png, oldSize=0, newSize=3524
add resource: res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png, oldSize=0, newSize=3853
add resource: res/drawable-xxxhdpi-v4/abc_ic_ab_back_mtrl_am_alpha.png, oldSize=0, newSize=240
add resource: res/drawable-xxxhdpi-v4/abc_ic_clear_mtrl_alpha.png, oldSize=0, newSize=566
add resource: res/drawable-xxxhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png, oldSize=0, newSize=418
add resource: res/drawable-xxxhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png, oldSize=0, newSize=1253
add resource: res/drawable-xxxhdpi-v4/abc_ic_menu_moreoverflow_mtrl_alpha.png, oldSize=0, newSize=378
add resource: res/drawable-xxxhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png, oldSize=0, newSize=680
add resource: res/drawable-xxxhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png, oldSize=0, newSize=390
add resource: res/drawable-xxxhdpi-v4/abc_ic_menu_share_mtrl_alpha.png, oldSize=0, newSize=1559
add resource: res/drawable-xxxhdpi-v4/abc_ic_search_api_mtrl_alpha.png, oldSize=0, newSize=1571
add resource: res/drawable-xxxhdpi-v4/abc_ic_voice_search_api_mtrl_alpha.png, oldSize=0, newSize=1291
add resource: res/drawable-xxxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png, oldSize=0, newSize=666
add resource: res/drawable-xxxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png, oldSize=0, newSize=959
add resource: res/drawable-xxxhdpi-v4/abc_spinner_mtrl_am_alpha.9.png, oldSize=0, newSize=617
add resource: res/drawable-xxxhdpi-v4/abc_switch_track_mtrl_alpha.9.png, oldSize=0, newSize=1025
add resource: res/drawable-xxxhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png, oldSize=0, newSize=208

这明明是support库里面自带的,gradle我又没改什么东西。

from tinker.

shwenzhang avatar shwenzhang commented on July 17, 2024

你解压两个安装包,确认一下旧的apk是否真的没有这些资源?

from tinker.

kongnanlive avatar kongnanlive commented on July 17, 2024

@shwenzhang 确实是新增的,原包1.3M新包1.5M,我服Android Studio,还好问过你,不然就误会tinker了。

from tinker.

shwenzhang avatar shwenzhang commented on July 17, 2024

事实上,日志已经写的很清楚,不应该来问的。热补丁并不简单,还是建议多浏览一下大致框架代码

from tinker.

kongnanlive avatar kongnanlive commented on July 17, 2024

@shwenzhang "不应该来问的"这句话不喜欢听,但我还是礼貌的把步骤重现下,设备三星Galaxy J3 Android 5.1.1多次运行都是1.3M,换台魅族M351 Android4.4.4 Flyme os 4.2.8.1A,任何代码不动编译运行后变成1.5M。谢谢的回答!
image

from tinker.

icespring avatar icespring commented on July 17, 2024

这里确实不是tinker的问题,但是想问一下,为什么直接运行和执行assembleXXX运行出来的包是不一样的呢? @dodola

from tinker.

kongnanlive avatar kongnanlive commented on July 17, 2024

@icespring shwenzhang 已经说过了“不同的target编译出来的包不一样大小”

from tinker.

dodola avatar dodola commented on July 17, 2024

@icespring 怀疑是AndroidStudio针对你选择的Device进行了资源上的优化,但是这个没有找到相关资料说明,只是猜测

from tinker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.