Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Android開発でmitmproxyを使った話
Search
bigbackboom
December 18, 2018
2
1.2k
Android開発でmitmproxyを使った話
bigbackboom
December 18, 2018
Tweet
Share
More Decks by bigbackboom
See All by bigbackboom
Have A Dog in CircleCI
bigbackboom
0
5
Androidエンジニアのお仕事でのショボーン
bigbackboom
0
34
解明!楽しいプレゼンする話すスキル
bigbackboom
0
26
Pay for Businessのgradle.ktsへの移行の小噺
bigbackboom
0
19
A Study in Bitmap: Is NDK the fast Processing method by CPU?
bigbackboom
0
180
Shallow Dip into Kotlin Coroutine
bigbackboom
0
120
Android Architecture Componentの Navigationで少しはまった話
bigbackboom
0
590
RecyclerViewでViewPagerっぽいの作ろうとして頓死した話
bigbackboom
0
1.4k
Featured
See All Featured
WebSockets: Embracing the real-time Web
robhawkes
59
7.3k
Building Applications with DynamoDB
mza
89
6k
Embracing the Ebb and Flow
colly
83
4.4k
Why You Should Never Use an ORM
jnunemaker
PRO
53
8.9k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
Designing for Performance
lara
604
68k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
663
120k
Navigating Team Friction
lara
183
13k
RailsConf 2023
tenderlove
27
800
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
3k
Transcript
Android։ൃͰ mitmproxyΛͬͨ
Who am I? — ٠/bigbackboom — גࣜձࣾΞΠελΠϧɹ ϝσΟΞ։ൃ౷ׅ෦ ΞϓϦάϧʔϓ —
ͳΜͪΌͬͯAndroid։ൃऀ — ࠷ۙαʔόʔαΠυ Golangʹුؾத — ҟ໊ɿ͓٠ɺ٠ɺ٠͞Μ
ܦҢ — responseͷΛॻ͖͑ͯɺຊ൪ڥͰΞϓϦͷڧ੍Ξο ϓσʔτͷςετ͕͍ͨ͠ɻ — iOSCharlesΛ͑Ͱ͖Δ͕ɺAndroidʁ — CharlesͰ͍͚Δ͚ͣͩͲɺͳΜ͔httpsΩϟονͰ͖ͳ ͍Αɾɾɾ(´ŋωŋ`) —
Charles͕ͩΊͳΒଞͷΞϓϦέʔγϣϯ୳ͯ͠ΈΑ͏ʂ
mitmproxy — Charlesͱ΄΅ಉͷػೳΛఏڙ͢ΔOSS — UIίϚϯυϕʔε — WebUIʢβʣ·Ͱ͋Δʂ
ݒ೦ — ਖ਼ίϚϯυϥΠϯϕʔε͕ɾɾɾͬͨΔ͍
ͱ͍͑ɾɾɾଞʹํ๏ͳ͍
ͱΓ͋͑ͣͬͯݟΔ͖
Πϯετʔϧ $ brew install mitmproxy
ىಈ $ mitmproxy -p ϙʔτ൪߸
ΞϓϦͷ४උ 1. pcͷipΞυϨεΛϝϞ 2. AndroidΛ༻ҙͯ͠ɺઃఆʼWi-Fiͱը໘ΛભҠ 3. ଓࡁΈͷwifiΛԡ͢͠Δͱɺ"ωοτϫʔΫΛมߋ"ͷ߲͕ग़ΔͷͰλοϓ͢Δ 4. දࣔ͞ΕͨΟϯυͷ”ৄࡉઃఆ߲"ͷϓϩΩγ߲Λखಈʹมߋ͢Δ 5.
Ճදࣔ͞Ε߲ͨͷ”ϓϩΩγͷϗετ໊”ʹᶃͷipΞυϨεΛೖྗ͢Δ 6. ”ϓϩΩγϙʔτʹ”mitmproxyىಈ࣌ʹ༻ͨ͠ϙʔτ൪߸Λೖྗ 7. อଘϘλϯΛλοϓ͢Δ(*1) 8. ϒϥβΛ։͖ɺ"mitm.it"ΛΞυϨεʹೖྗ͢Δ(࣍ϖʔδը૾ࢀর) 9. ։͍ͨϖʔδͷAndroidϩΰͷϘλϯΛԡͯ͠ɺূ໌ॻΛμϯϩʔυɾΠϯετʔϧ͢Δ
None
ͦͯ͠ɾɾɾಈ͔ͯ͠ΈΔ
Https͕औΕ͍ͯͳ͍ͩͱʁ
ͦͯ͜͠ͷ ใ Λݟ͚ͭΔ "ࣗͷΞϓϦͰड͚͚ΔΑ͏ʹ͢ΔʹωοτϫʔΫɾη ΩϡϦςΟͷઃఆΛΞϓϦʹՃ͢Δඞཁ͕͋ΔΑ͏Ͱ͢ɻ"
None
ͬͯΈΑ͏ — app/src/main/res/xmlʹnetwork_security_config.xml Λ࡞ɻҎԼͷ༰Λهड़ɻ <network-security-config> <!-- ͜͜ΛೖΕͯͳ͍ͱɺຊ൪ͷڥͰڐՄΛग़ͤͪΌ͏ͷͰҙ͕ඞཁΒ͍͠ --> <debug-overrides> <trust-anchors>
<!-- Additionally trust user added CAs --> <certificates src="user" /> </trust-anchors> </debug-overrides> </network-security-config>
— AndroidManifest.xmlʹҎԼΛه <application android:networkSecurityConfig="@xml/network_security_config" > ... </application>
τϥΠΞήΠϯ
None
࣮ɾɾɾcharlesͰ͍͚ͨ Android7͔ΒcharlesͰssl௨৴͕ݟΕͳ͘ͳͬͨ݅
·ͱΊ — charlesͷଞʹແྉͷmitmproxy͕͋Δ — ͍উखݴ͏΄Ͳѱ͘ͳ͍ — Android 7Ҏ্͔Β໌ࣔతʹূ໌ॻͷڐՄΛϓϩδΣΫτ ʹઃఆ͢Δඞཁ͕͋Δ