I am trying out new jetpack DataStore library . I saved data using the library . This created a file settings.preferences_pb
in app data directory (/data/data/my.package.name/files/datastore/settings.preferences_pb) . setting
is the file name given by me . The data doesn't show properly with a text viewer . I can make out Key name but the value is garbage . How do I open this file and view it ?
Here is the drive link for file settings.preferences_pb
Reference: https://medium.com/swlh/get-your-hand-dirty-with-jetpack-datastore-b1f1dfb0a5c1
The protobuf files will be located in /data/data/{application.package}/files/datastore/ . These are the protobuf formatted files, so we can not read them with an ordinary editor. To decode the files, we can use protoc command line.
To be able to use protoc command, we have to pull these files to our workstation’s space using adb command
For preference datastore
protoc --decode_raw < app_name.preferences_pb
The result will be similar to this:
1 {
1: "app_name"
2 {
5: "Datastore sample"
}
}
1 {
1: "is_demo_mode"
2 {
1: 1
}
}
Note: value 1 of is_demo_mode represents a true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With