Project

General

Profile

DataPartition » History » Version 18

Denis 'GNUtoo' Carikli, 10/28/2020 05:24 PM
start adding silence and other known applications

1 1 Denis 'GNUtoo' Carikli
h1. DataPartition
2
3 2 Denis 'GNUtoo' Carikli
{{toc}}
4
5
h2. /!\ Warning: Draft
6
7
This article is in draft form and is being written:
8
* Everybody is welcome to contribute
9
* Some things might not be accurate yet, so beware before using the information contained in it.
10 1 Denis 'GNUtoo' Carikli
11 3 Denis 'GNUtoo' Carikli
h2. What does the data partition contains?
12
13 1 Denis 'GNUtoo' Carikli
It probably depends on the devices and the Android versions.
14
15 6 Denis 'GNUtoo' Carikli
On Replicant 6.0, it contains at least the application internal data: When various applications are installed, they have access to some storage where they can read and write data that is only visible to them and not to other applications. This is part of the [[ApplicationsSecurityModel|Android security model]] that doesn't trust applications even if they are fully free software. This has serious usability consequences for users as it makes backuping and restoring the application data way more complicated than it should be: this data is tied to the application signatures, so because of that it's not easily portable across different Replicant versions. When application signatures changes (like between Replicant 6.0 0003 and 6.0 0004), the data needs to be migrated from the old signatures to the new ones.
16 1 Denis 'GNUtoo' Carikli
17 5 Denis 'GNUtoo' Carikli
In addition, on some devices it also contains the users data. This location and external microSD cards is where users typically their files like Music, photos, etc. This data is made accessible to the users in various location through a mechanism called fuse. In Replicant 6, this data is stored in the media directory in the data partition. Unlike application data, this data is not tied to any Android version or application signatures, so it can be moved, backuped, restored relatively easily across different devices and operating systems. It uses a similar file permission system than with GNU/Linux (unix DAC + Selinux).
18 1 Denis 'GNUtoo' Carikli
19 16 Denis 'GNUtoo' Carikli
h2. Known data location:
20
21 14 Denis 'GNUtoo' Carikli
| Location                       | Content |
22
| /data/app/<application name>/  | Application apk, native libraries, java cache (base.odex)? |
23 1 Denis 'GNUtoo' Carikli
| /data/data/<application name>/ | Application internal data |
24 17 Denis 'GNUtoo' Carikli
| /data/media/                   | User accessible storage to store music, photos, etc
25 16 Denis 'GNUtoo' Carikli
                                   Also mounted in /storage/emulated with fuse |
26 7 Denis 'GNUtoo' Carikli
| /data/system/packages.xml      | Application and signing key, uid, etc mapping |
27 14 Denis 'GNUtoo' Carikli
| /data/system/appops.xml        | Application permissions |
28 10 Denis 'GNUtoo' Carikli
29 18 Denis 'GNUtoo' Carikli
For @/data/app/<application name>/@ :
30
| Location                                      | Content |
31
| /data/data/org.smsecure.smssecure/            | "Silence":https://f-droid.org/en/packages/org.smssecure.smssecure/ data |
32
| /data/data/org.smsecure.smssecure/messages.db | Silence messages database (sqlite3) |
33
34 10 Denis 'GNUtoo' Carikli
h2. TODO
35
36 1 Denis 'GNUtoo' Carikli
Here's where the sdcard user accessible storage comes from:
37
38
/sdcard -> /storage/self/primary [1]
39
/storage/self/primary -> /mnt/user/0/primary [2]
40
/mnt/user/0/primary -> /storage/emulated/0 [3]
41
42 9 Denis 'GNUtoo' Carikli
<pre>
43
root@i9300:/ # readlink /sdcard                                                                                                                            
44
/mnt/user/0/primary
45
root@i9300:/ # readlink /storage/self/primary                                                                                                              
46
/mnt/user/0/primary
47
root@i9300:/ # readlink /mnt/user/0/primary                                                                                                                  
48
/storage/emulated/0
49
root@i9300:/ # mount | grep "/storage/emulated"                                                                                                              
50 1 Denis 'GNUtoo' Carikli
/dev/fuse on /storage/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)</pre>
51
52
53
TODO:
54
* Explain that the user accessible storage is not always present
55
* Explain that it depends on the devices (GTA04)
56
57
h2. Concerns about the application internal data
58
59
TODO:
60
* Explain the issue about the Replicant version <-> application data