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
BluetoothDevice.getName()に裏切られた話
Search
Moyuru Aizawa
September 01, 2023
Programming
0
310
BluetoothDevice.getName()に裏切られた話
Moyuru Aizawa
September 01, 2023
Tweet
Share
More Decks by Moyuru Aizawa
See All by Moyuru Aizawa
BLUETOOTH_SCAN and iBeacon
lvla
1
66
graphicsLayer
lvla
0
190
Jetpack Composeで画像クロップ機能を実装する
lvla
0
1.1k
Jetpack Compose drag gesture and pinch gesture
lvla
1
3.6k
Jetpack Compose Layout API
lvla
1
630
BLEを使ったアプリを継続的に開発するために
lvla
0
970
RecyclerView.ItemAnimator
lvla
1
300
RecycledViewPool
lvla
1
190
CameraX
lvla
2
2.3k
Other Decks in Programming
See All in Programming
CTFのWebにおける⾼難易度問題について
hamayanhamayan
1
1k
本当だってば!俺もTRICK 2022に入賞してたんだってば!
jinroq
0
270
php-fpm がリクエスト処理する仕組みを追う / Tracing-How-php-fpm-Handles-Requests
shin1x1
5
890
リアクティブシステムの変遷から理解するalien-signals / Learning alien-signals from the evolution of reactive systems
yamanoku
2
1.2k
Signal-Based Data FetchingWith the New httpResource
manfredsteyer
PRO
0
120
Fluent UI Blazor 5 (alpha)の紹介
tomokusaba
0
160
Do Dumb Things
mitsuhiko
0
370
今から始めるCursor / Windsurf / Cline
kengo_hayano
0
110
Agentic Applications with Symfony
el_stoffel
1
170
Firebase Dynamic Linksの代替手段を自作する / Create your own Firebase Dynamic Links alternative
kubode
0
200
PHPer's Guide to Daemon Crafting Taming and Summoning
uzulla
2
1.1k
データベースエンジニアの仕事を楽にする。PgAssistantの紹介
nnaka2992
9
4.4k
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
Statistics for Hackers
jakevdp
798
220k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.4k
We Have a Design System, Now What?
morganepeng
51
7.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
102
19k
KATA
mclloyd
29
14k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
Designing for Performance
lara
606
69k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
31
4.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
177
52k
Code Review Best Practice
trishagee
67
18k
Transcript
BluetoothDevice.getName()ʹ ཪΒΕͨ @MoyuruAizawa
Moyuru Aizawa Software Engineer of Catlog, RABO. Previously at Azit,
CyberAgent, and Eureka. Love Metal, Hardcore and EDM. MoyuruAizawa
ಛʹΦνͷͳ͍Λ͠·͢
None
͜ΕΒͷϋʔυΣΞͷηοτΞοϓ Android͔ΒBluetoothܦ༝Ͱߦͬͯ·͢
ϋʔυΣΞͱ BluetoothDevice/BluetoothGatt ͱ͍͏APIΛ௨ͯ͡௨৴͠·͢
BluetoothDevice.getName()Ͱ ϋʔυΣΞͷnameΛऔಘͰ͖·͢
AndroidͷBluetoothLeScannerΛ ͔ͭͬͯपғͷσόΠεΛݕࡧ͢Ε Θ͔Γ·͕͢
CatlogͷϋʔυΣΞʹͯ͢ ݸମݻ༗ͷname͕ઃఆ͞Ε͍ͯ·͢
BluetoothDevice.getName()ͷ ฦΓnullableͷStringͰ͕͢
CatlogͷϋʔυΣΞ૬खͳΒ ඞͣString͕ฦͬͯ͘Δ͜ͱ͕ ظ͞Ε·͢
None
14 betaΛೖΕͯࢼͨ݁͠Ռ BluetoothDevice.getName()ͷڍಈ͕ ͓͔͍͜͠ͱ͕໌
Catlog HomeͷWi-FiઃఆͷͨΊʹ पғͷCatlog HomeΛscan ͜ͷ࣌ͰCatlog Homeͷname͕औಘͰ͖͍ͯΔ
ઃఆϑϩʔΛਐΊͯߦͬͯ ͜ͷը໘Ͱprimary buttonΛԡ͢ͱ ͏ҰBluetoothDevice.getName()Λ͠·͢
͵ΔΆ
લͷը໘Ͱname͕ظ௨Γʹฦͬ ͖͍͕ͯͯͨŊͳ͔ͥnull͕ฦͬͯ͘Δ
ͳͥ…?
ͨΊ͠ʹ͜ͷը໘ͰLaunchedEffectΛ͔ͭͬͯ BluetoothDevice.getName()Λ࣮ߦ͢Δͱ…
ͪΌΜͱname͕ฦͬͯ͘Δ!!
🤔
ࢼ͠ʹŊ͜ͷը໘ΑΓલͷը໘ͰߦΘ Ε͍ͯΔBluetoothGattʹΑΔຊ֨త ͳ௨৴Λͯ͢ল͍ͯΈΔ
primary buttonΛԡͯ͠ BluetoothDevice.getName()Λ࣮ߦ͢Δͱ…
ͪΌΜͱname͕ฦ͖ͬͯͨ!!
ŪƄŴƄŧƄũƄ….
‣ ࠷ॳͷBluetoothDevice.getName()ਖ਼ৗ ‣ ී௨ʹύεϫʔυೖྗը໘ʹભҠ͖ͯͯ͠ŊଓϘλϯԡ͞Εͯ getName -> null ‣ ී௨ʹύεϫʔυೖྗը໘ʹભҠ͖ͯͯ͠ŊLaunchedEffectͰ͍͖ͳ ΓgetName
-> ͱΕΔ ‣ લը໘ΛͿͬͱͯ͠ύεϫʔυೖྗը໘ʹભҠŊ͡Ίͯ BluetoothDeviceͱconnect͢ΔλΠϛϯάͰgetName -> ͱΕΔ ͜͜·ͰͰΘ͔͍ͬͯΔ͜ͱ
BluetoothDevice.getNameͷ υΩϡϝϯτͱ࣮ΛΈͯΈΑ͏
None
None
BluetoothDevice.getName Ωϟογϡͨ͠nameΛଈ࣌ฦ͢ Ωϟογϡ͕ͳ͔ͬͨΒnullʹͳΓ͑ΔŇ ͦΕͦ͏Ň
͍··Ͱ(Android 13·Ͱ)Ͱ؍ଌͨ͜͠ͱͳ͔͕ͬͨ APIͷ༷ͱͯ͠ى͖ಘΔ (ͱ͍͑όάͩͱࢥ͏Μ͚ͩͲ)
ΑʔΘ͔ΒΜ͔Βਖ਼ࣜϦϦʔεΛ·ͪ ͭͭŊͱΓ͋͑ͣҰͱΕͨnameେ ࣄʹେࣄʹը໘ؒΛӪ͖ճ͠ͱ͘
͓͠·͍