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

E77b6a5f919f7366d94f21eee9a014f5?s=47 operandoOS
March 28, 2018

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

E77b6a5f919f7366d94f21eee9a014f5?s=128

operandoOS

March 28, 2018
Tweet

Transcript

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

  2. (σβΠϯΛޠΔલʹ...) 
 ΤϯδχΞͳΒ࣮૷Ͱ͖ͳ͍ͱͶʂ

  3. σβΠϯͷ࣮૷Λղମ͢Δͱ͸ʁ ৭ΜͳΞϓϦͷσβΠϯɾϨΠΞ΢τ͕
 ͲͷΑ͏ʹ૊·Ε͍ͯΔͷ͔Λௐ΂Δ

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

  5. ࿩͢಺༰͸
 ࣗ਎͕࡞͍ͬͯͳ͍ΞϓϦʹ
 ରͯ͠ͷΞϓϩʔν

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

  7. Show layout bounds

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

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

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

  11. ը໘ͷີ౓ɾจࣈͷαΠζΛ
 มߋ͢Δ Accessibility → Font size → Largest Accessibility →

    Display size → Largest or Display → Font size → Largest Display → Display size → Largest
  12. ը໘ͷີ౓ɾจࣈͷαΠζΛ
 มߋ͢Δ

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

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

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

    system font_scale 1.3
  16. ը໘ͷີ౓ɾจࣈͷαΠζΛ
 มߋ͢Δ ݶք͸ͳ͍

  17. ը໘ͷີ౓ɾจࣈͷαΠζΛ
 มߋ͢Δ ͨͩ͠ յΕͦ͏

  18. σβΠϯͷߏ଄Λղମ͢Δ • View HierarchyΛdump͢Δ • adb shell dumpsys activity top

    • dump͍ͨ͠ը໘Λ։͍࣮ͯߦ
  19. dumpsys activity top

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

    Ͱ΋ࡉ͔͍ଐੑͷઃఆ͕Θ͔Βͳ͍
  21. σβΠϯͷߏ଄Λղମ͢Δ • apkΛղମ͢Δ • ࠷ऴखஈ? • ࠷ऴฌث?

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

  23. ୺຤͔ΒapkΛͬ͘͞ͱҾͬ͜ൈ͘ • ૉ੖Β͍͠هࣄ͋Γ·͢ʂ • dumpsys activity activitiesͱpecoͰ
 ΰχϣΰχϣͯ͠୺຤͔ΒapkΛ؆୯ʹҾͬ͜ൈ͘ • https://qiita.com/operandoOS/items/

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

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

    ೉ಡԽා͘ͳ͍͍ͩ͡ΐ͏Ϳ
  26. ໨తͷϨΠΞ΢τϑΝΠϧΛௐ΂Δ ͦͷ1 • લʹ঺հͨ͠dumpsys activity topͰ
 ϦιʔεIDͷ໊લ͸Θ͔Δ • ͋ͱ͸ID͕࢖༻͞Ε͍ͯΔϨΠΞ΢τΛௐ΂Δ͚ͩ •

    grepͰ΋͍͍͠ɺΤσΟλʔͷݕࡧͰ΋͍͍
  27. ໨తͷϨΠΞ΢τϑΝΠϧΛௐ΂Δ 
 ͦͷ2 • ϦιʔεID͔Βௐ΂Δ • jarΛΰχϣΰχϣͯ͠ݟΔͱϦιʔεID͕Θ͔Δ • ίʔυ্ͷϦιʔεIDΛ16ਐ਺ʹม׵͢Δ •

    ݩ͸10ਐ਺ɻํ๏͸ԿͰ΋͍͍ͷͰม׵͢Δ • 16ਐ਺Խͨ͠IDͰݕࡧ͢Δ • res/values/public.xmlΛݕࡧ͢Δͱݟ͔ͭΔ
  28. ໨తͷϨΠΞ΢τϑΝΠϧΛௐ΂Δ 
 ͦͷ3 • ͦͷ2ͱ్த·Ͱಉ͡ • aaptΛ࢖ͬͯௐ΂Δ aapt d resources

    base.apk | grep 7f0a0020
  29. ໨తͷϨΠΞ΢τϑΝΠϧΛௐ΂Δ 
 ͦͷ3 • ͜Μͳײ͡ͰҾ͔͔ͬΔ

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

  31. σβΠϯͷߏ଄Λղମ͢Δ • ݟͨ͜ͱͳ͍σβΠϯͷ࣮૷Λґཔ͞ΕͨΒ
 ʮ͜ͷσβΠϯɺͲͷΞϓϦͱ͔Ͱ͋Γ·ͨ͠ʁʯ
 Λฉ͘ • mazikore daizi • ͔ͦ͜Βࠓ·Ͱ঺հͨ͠ղମज़Λ࢖͏

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

  33. Thanks!!