Upgrade to Pro — share decks privately, control downloads, hide ads and more …

デザインの実装を解体する技術

operandoOS
March 28, 2018

 デザインの実装を解体する技術

operandoOS

March 28, 2018
Tweet

More Decks by operandoOS

Other Decks in Technology

Transcript

  1. σβΠϯͷ࣮૷Λ
    ղମ͢Δٕज़
    AndroidΤϯδχΞ σβΠϯ෦ #1

    View full-size slide

  2. (σβΠϯΛޠΔલʹ...) 

    ΤϯδχΞͳΒ࣮૷Ͱ͖ͳ͍ͱͶʂ

    View full-size slide

  3. σβΠϯͷ࣮૷Λղମ͢Δͱ͸ʁ
    ৭ΜͳΞϓϦͷσβΠϯɾϨΠΞ΢τ͕

    ͲͷΑ͏ʹ૊·Ε͍ͯΔͷ͔Λௐ΂Δ

    View full-size slide

  4. ղମ͢ΔͨΊʹ
    • ೔ࠒ͔Β৭ΜͳΞϓϦʹ৮ΕΔ
    • ৭ΜͳδϟϯϧͷΞϓϦʹ৮ΕΔ
    • ղମಓ۩Λͯͳ͚ͣΔ

    View full-size slide

  5. ࿩͢಺༰͸

    ࣗ਎͕࡞͍ͬͯͳ͍ΞϓϦʹ

    ରͯ͠ͷΞϓϩʔν

    View full-size slide

  6. σβΠϯͷߏ଄Λղମ͢Δ
    • Show layout bounds
    • ϨΠΞ΢τͷڥքΛදࣔ͢Δ
    • ϨΠΞ΢τͷߏ଄͕ͳΜͱͳ͘Θ͔Δ

    View full-size slide

  7. Show layout bounds

    View full-size slide

  8. Show layout bounds
    • adb͔Β༗ޮʹ͢Δ
    adb shell setprop debug.layout true

    View full-size slide

  9. Show layout bounds
    • ϨΠΞ΢τͷߏ଄͕ͳΜͱͳ͘Θ͔ΔͷͰศར
    • Ͱ΋ӅΕͯΔView΍ࡉ͔͍ߏ଄͕Θ͔Βͳ͍
    • Android Device MonitorͷLayout Inspectorͷศརʂ

    View full-size slide

  10. σβΠϯͷߏ଄Λղମ͢Δ
    • ը໘ͷີ౓Λมߋ͢Δ
    • จࣈͷαΠζΛมߋ͢Δ
    • ͋͑ͯϨΠΞ΢τ่͕Εͦ͏ͳ͜ͱΛ΍ͬͯΈΔ
    • ૝ఆ֎ͷը໘΍จࣈαΠζʹͲ͏ରԠ͍ͯ͠Δ͔ݟΔ

    View full-size slide

  11. ը໘ͷີ౓ɾจࣈͷαΠζΛ

    มߋ͢Δ
    Accessibility → Font size → Largest
    Accessibility → Display size → Largest
    or
    Display → Font size → Largest
    Display → Display size → Largest

    View full-size slide

  12. ը໘ͷີ౓ɾจࣈͷαΠζΛ

    มߋ͢Δ

    View full-size slide

  13. ը໘ͷີ౓Λมߋ͢Δ
    • adb shell͔Β΋มߋͰ͖ΔΑʂ
    • ઃఆ஋ͷ্ݶ͕ͳ͍ͷͰɺ΍͹͍ੈք͕ݟΕΔ
    • Լݶ஋͸͋Δʂ → 72

    View full-size slide

  14. ը໘ͷີ౓Λมߋ͢Δ
    // ີ౓Λมߋ͢Δ
    adb shell wm density 800
    // ݩʹ໭͢
    adb shell wm density reset

    View full-size slide

  15. จࣈͷαΠζΛมߋ͢Δ
    • adb shell͔Β΋มߋͰ͖ΔΑʂ
    • ઃఆ஋ͷ্ݶ͕ͳ͍ͷͰɺ΍͹͍ੈք͕ݟΕΔ
    adb shell settings put system font_scale 1.3

    View full-size slide

  16. ը໘ͷີ౓ɾจࣈͷαΠζΛ

    มߋ͢Δ
    ݶք͸ͳ͍

    View full-size slide

  17. ը໘ͷີ౓ɾจࣈͷαΠζΛ

    มߋ͢Δ
    ͨͩ͠
    յΕͦ͏

    View full-size slide

  18. σβΠϯͷߏ଄Λղମ͢Δ
    • View HierarchyΛdump͢Δ
    • adb shell dumpsys activity top
    • dump͍ͨ͠ը໘Λ։͍࣮ͯߦ

    View full-size slide

  19. dumpsys activity top

    View full-size slide

  20. dumpsys activity top
    • View.GONEͱ͔ͰݟΕͳ͍View΋Θ͔Δ
    • ಈతʹView͕มΘͬͨΓ͠ͳ͚Ε͹ؙݟ͑
    • Viewͷid͕Θ͔ΔͷͰΰχϣΰχϣͰ͖Δ
    • Ͱ΋ࡉ͔͍ଐੑͷઃఆ͕Θ͔Βͳ͍

    View full-size slide

  21. σβΠϯͷߏ଄Λղମ͢Δ
    • apkΛղମ͢Δ
    • ࠷ऴखஈ?
    • ࠷ऴฌث?

    View full-size slide

  22. apkΛղମ͢Δπʔϧ
    • apktool ⚡
    • dex2jar
    • aapt

    View full-size slide

  23. ୺຤͔ΒapkΛͬ͘͞ͱҾͬ͜ൈ͘
    • ૉ੖Β͍͠هࣄ͋Γ·͢ʂ
    • dumpsys activity activitiesͱpecoͰ

    ΰχϣΰχϣͯ͠୺຤͔ΒapkΛ؆୯ʹҾͬ͜ൈ͘
    • https://qiita.com/operandoOS/items/
    6fa77037560e52d11352

    View full-size slide

  24. apkΛղମ͢Δπʔϧ
    ղମํ๏͸…
    Ͷʁ

    View full-size slide

  25. ղମ͢ΔͱखʹೖΔ΋ͷ
    • ϦιʔεҰࣜ
    • ϨΠΞ΢τϑΝΠϧ΋ؚΉ
    • jar
    • ೉ಡԽ͞Εͯͳ͍ͱؙݟ͑
    • ೉ಡԽා͘ͳ͍͍ͩ͡ΐ͏Ϳ

    View full-size slide

  26. ໨తͷϨΠΞ΢τϑΝΠϧΛௐ΂Δ
    ͦͷ1
    • લʹ঺հͨ͠dumpsys activity topͰ

    ϦιʔεIDͷ໊લ͸Θ͔Δ
    • ͋ͱ͸ID͕࢖༻͞Ε͍ͯΔϨΠΞ΢τΛௐ΂Δ͚ͩ
    • grepͰ΋͍͍͠ɺΤσΟλʔͷݕࡧͰ΋͍͍

    View full-size slide

  27. ໨తͷϨΠΞ΢τϑΝΠϧΛௐ΂Δ 

    ͦͷ2
    • ϦιʔεID͔Βௐ΂Δ
    • jarΛΰχϣΰχϣͯ͠ݟΔͱϦιʔεID͕Θ͔Δ
    • ίʔυ্ͷϦιʔεIDΛ16ਐ਺ʹม׵͢Δ
    • ݩ͸10ਐ਺ɻํ๏͸ԿͰ΋͍͍ͷͰม׵͢Δ
    • 16ਐ਺Խͨ͠IDͰݕࡧ͢Δ
    • res/values/public.xmlΛݕࡧ͢Δͱݟ͔ͭΔ

    View full-size slide

  28. ໨తͷϨΠΞ΢τϑΝΠϧΛௐ΂Δ 

    ͦͷ3
    • ͦͷ2ͱ్த·Ͱಉ͡
    • aaptΛ࢖ͬͯௐ΂Δ
    aapt d resources base.apk | grep 7f0a0020

    View full-size slide

  29. ໨తͷϨΠΞ΢τϑΝΠϧΛௐ΂Δ 

    ͦͷ3
    • ͜Μͳײ͡ͰҾ͔͔ͬΔ

    View full-size slide

  30. apkΛղମ͢Δ
    • ϨΠΞ΢τϑΝΠϧ͕ݟΕΔͷͰͺͳ͍
    • ೉ಡԽ͞Εͯͳ͚Ε͹Custom View΋Θ͔Δ

    View full-size slide

  31. σβΠϯͷߏ଄Λղମ͢Δ
    • ݟͨ͜ͱͳ͍σβΠϯͷ࣮૷Λґཔ͞ΕͨΒ

    ʮ͜ͷσβΠϯɺͲͷΞϓϦͱ͔Ͱ͋Γ·ͨ͠ʁʯ

    Λฉ͘
    • mazikore daizi
    • ͔ͦ͜Βࠓ·Ͱ঺հͨ͠ղମज़Λ࢖͏

    View full-size slide

  32. ·ͱΊ
    • ղମͯ͠σβΠϯͷ࣮૷ͷࢀߟʹ͢Δ
    • ؾʹͳͬͨσβΠϯΛղମͯ͠ΈͯͶʂ
    • ղମ͜Θ͘ͳ͍ʂ

    View full-size slide