particle-iot / spark-setup-android

Former home of the Particle Device Setup library for Android
Apache License 2.0
23 stars 30 forks source link

SDK attempts to set claim code on unclaimed devices in `setupOnly` mode #69

Closed brahma-dev closed 5 years ago

brahma-dev commented 5 years ago

This seems to be the offending code. https://github.com/particle-iot/spark-setup-android/blob/master/devicesetup/src/main/java/io/particle/android/sdk/devicesetup/ui/DiscoverProcessWorker.java#L84

When c=0 it attempts to set null as claim code which crashes the app (here). I believe this is unintended behaviour because older versions of stock exampleapp (in initWithSetupOnly mode) still work for me.

jensck commented 5 years ago

Thanks for the heads up! I'll look at this sometime this week.

jensck commented 5 years ago

Looks like this is a simple fix, but the Photon I brought with me while working out of state got damaged along the way, so I can't smoke test today. I'll have access to more test devices next week, so at that point I can test and do a new setup lib release with this fix.