forked from Android4Lumia/android_external_libinit_dpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dpp.h
109 lines (99 loc) · 2.78 KB
/
dpp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#include <string>
#include <map>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
#define DPP_PARTITION "/dev/block/mmcblk0p1"
#define DPP_MOUNTPOINT "/dpp"
#define DPP_FS "vfat"
#define DPP_FLAGS MS_RDONLY|MS_NOATIME|MS_NODEV|MS_NODIRATIME|MS_NOEXEC|MS_NOSUID
#define DPP_DATA "shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0"
#define PRODUCT_DAT "/dpp/Nokia/product.dat"
void property_override(char const prop[], char const value[])
{
prop_info *pi;
pi = (prop_info*) __system_property_find(prop);
if (pi)
__system_property_update(pi, value, strlen(value));
else
__system_property_add(prop, strlen(prop), value, strlen(value));
}
namespace dpp {
typedef struct device {
std::string device;
std::string family;
std::string description;
} device;
int mount(void);
dpp::device get_device(void);
dpp::device unknown = {
.device = "unknown",
.family = "unknown",
.description = "Unknown or not supported device",
};
std::map<std::string, dpp::device> devices = {
{
"RM-885",
{
.device = "zeal_row",
.family = "zeal",
.description = "Lumia 720 (RM-885)",
}
},
{
"RM-887",
{
.device = "zeal_cmcc",
.family = "zeal",
.description = "Lumia 720T (RM-887)",
}
},
{
"RM-913",
{
.device = "fame_cmcc",
.family = "fame",
.description = "Lumia 520 (RM-913)",
}
},
{
"RM-914",
{
.device = "fame_row",
.family = "fame",
.description = "Lumia 520 (RM-914)",
}
},
{
"RM-915",
{
.device = "fame_lta",
.family = "fame",
.description = "Lumia 520 (RM-915)",
}
},
{
"RM-917",
{
.device = "fame_tmo",
.family = "fame",
.description = "Lumia 521 (RM-917)",
}
},
{
"RM-997",
{
.device = "glee_cmcc",
.family = "glee",
.description = "Lumia 526 (RM-997)",
}
},
{
"RM-998",
{
.device = "glee_row",
.family = "glee",
.description = "Lumia 525 (RM-998)",
}
},
};
}