melianmiko / ZeppPlayer

Unofficial ZeppOS emulator
https://melianmiko.ru/zepp_player/
GNU General Public License v3.0
41 stars 3 forks source link

settings-storage does not supported #2

Closed emircanerkul closed 1 year ago

emircanerkul commented 1 year ago

Hi @melianmiko How can I use this API? Its v1.0 this should be supported in band 7 isn't it?

index.browser.js:2194 [error] SL:1 Module start failed ReferenceError: settings is not defined

settings.settingsStorage.setItem('key', 'Hello World')
const result = settings.settingsStorage.getItem('key')

https://docs.zepp.com/docs/1.0/reference/app-settings-api/settings-storage/

melianmiko commented 1 year ago

should be supported in band 7 isn't it?

I don't know, will check in the summer, due to no time for now.

emircanerkul commented 1 year ago

@melianmiko thank you

melianmiko commented 1 year ago

Checked it out.

Settings Storage API can be accessed only from code that runs into Zepp application on your phone, eg from Side Service and Settings App API, and both of them isn't available for Mi Band 7, because they works with Mi Fitness / Zepp Life applications, both didn't support custom app features.

You can get access to all of this features If you pair Mi Band 7 with original Zepp app, I've done this by some modifications of APK-file. More information here (Russian page, use google translate, I'll create an English-language post them later)

Directly on device, properties stored in settingsStorage can't be read or written. If you need to store something, you can create a file with your data somewhere via hmFS open/seek/read/write function, or you can store it in system registry via hmFs.SysPro... functions . In docs said that data stored with them will be deleted after device reboot, but it's not. All data written with hmFS.SysPro... functions was stored into /storage/sysprop_default file on device, both with system-wide settings.

emircanerkul commented 1 year ago

@melianmiko thanks, okay I'll go with the filesystem. Don't use any modified or close-system third-party things. Gadget bridge just works great.