[Bugfix] encode device_key