Unsetting the "claimed" flag on device from an app

I’m working on an Android app, but from the app alone I can’t unset the “claimed” flag.

The device unclaim() method only unclaims the device in Particle Cloud. It doesn’t actually remove the claimed status on the device, which means that no user will be able to claim the device again until the claimed flag is reset. It will say that it’s already owned by another user, asking if I want to set the owner to “null”. I faced this issue here: Failing to Setup Product that has previously been claimed

The flag can be reset to false (c=0) either by reflashing the firmware as described here, with this command

dfu-util -d 2b04:d006 -a 1 -s 1762:64 -D clear_claim.bin

I don’t think we can use the particle firmware api for this, though, as it relies on the ability to flash at specific device address offset. Am I wrong, or is there a way to do this with the Particle firmware API here? https://docs.particle.io/reference/device-cloud/api/#flash-a-device-with-a-pre-compiled-binary

We can also manually set the claim code through the softap api described here, but there’s no way to do this through the mobile SDK at the moment. I made issue for it here.

It’d be really nice if unclaiming a device from the Particle Cloud API actually unset this flag on device (when connected) without needing to go through another step. How do those with production apps do this?

Particle devices don’t really care whether they are claimed or not - if it is unclaimed in the cloud, you can claim it to another account from the CLI/Web IDE/CloudAPI.

The only stumbling block I can think of is if you need to setup WiFi again - then you can use listening mode.

Maybe I’m understanding your problem wrong though - I don’t have knowledge of creating new apps to go through these steps.

Also, please note that creating github issues is not considered a bug report internally, the only process for submitting bugs is by creating a ticket through support.particle.io