Skip to content

Commit

Permalink
[WIP]: 00
Browse files Browse the repository at this point in the history
  • Loading branch information
s1204IT committed Jun 28, 2024
1 parent 7267def commit cd2419f
Showing 1 changed file with 85 additions and 1 deletion.
86 changes: 85 additions & 1 deletion mali_shrinker_mmap32.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,49 @@ ADD_COMMIT = add x8, x8, #0x(Last 3 digits of COMMIT_CRED)
* Maintained by Syuugo
*/

// TAB-A05-BD 00.04.000
#define COMMIT_CREDS_CTX_00_04_000 0x5a120
#define AVC_DENY_CTX_00_04_000 0x35acc8
#define SEL_READ_ENFORCE_CTX_00_04_000 0x3653a8
#define SEL_READ_HANDLE_UNKNOWN_CTX_00_04_000 0x365d80
#define INIT_CRED_CTX_00_04_000 0x11553f0
#define SELINUX_ENFORCING_CTX_00_04_000 0x129d9bc
#define ADD_INIT_CTX_00_04_000 0x910fc000
#define ADD_COMMIT_CTX_00_04_000 0x91048108

// TAB-A05-BD 00.05.000
#define COMMIT_CREDS_CTX_00_05_000 0x5a120
#define AVC_DENY_CTX_00_05_000 0x35acc8
#define SEL_READ_ENFORCE_CTX_00_05_000 0x3653a8
#define SEL_READ_HANDLE_UNKNOWN_CTX_00_05_000 0x365d80
#define INIT_CRED_CTX_00_05_000 0x11553f0
#define SELINUX_ENFORCING_CTX_00_05_000 0x129d9bc
#define ADD_INIT_CTX_00_05_000 0x910fc000
#define ADD_COMMIT_CTX_00_05_000 0x91048108

// TAB-A05-BD 00.08.000
#define COMMIT_CREDS_CTX_00_08_000 0x5a120
#define AVC_DENY_CTX_00_08_000 0x35acc8
#define SEL_READ_ENFORCE_CTX_00_08_000 0x3653a8
#define SEL_READ_HANDLE_UNKNOWN_CTX_00_08_000 0x365d80
#define INIT_CRED_CTX_00_08_000 0x11553f0
#define SELINUX_ENFORCING_CTX_00_08_000 0x129d9bc
#define ADD_INIT_CTX_00_08_000 0x910fc000
#define ADD_COMMIT_CTX_00_08_000 0x91048108

// TAB-A05-BD 00.09.000
#define COMMIT_CREDS_CTX_00_09_000 0x5a120
#define AVC_DENY_CTX_00_09_000 0x35acc8
#define SEL_READ_ENFORCE_CTX_00_09_000 0x3653a8
#define SEL_READ_HANDLE_UNKNOWN_CTX_00_09_000 0x365d80
#define INIT_CRED_CTX_00_09_000 0x11553f0
#define SELINUX_ENFORCING_CTX_00_09_000 0x129d9bc
#define ADD_INIT_CTX_00_09_000 0x910fc000
#define ADD_COMMIT_CTX_00_09_000 0x91048108

// TAB-A05-BD 01.00.000
#define COMMIT_CREDS_CTX_01_00_000 0x5a120
#define AVC_DENY_CTX_01_00_000 0x35acc8
#define SELINUX_ENFORCING_CTX_01_00_000 0x129d9bc
#define SEL_READ_ENFORCE_CTX_01_00_000 0x3653a8
#define SEL_READ_HANDLE_UNKNOWN_CTX_01_00_000 0x365d80
#define INIT_CRED_CTX_01_00_000 0x11553f0
Expand Down Expand Up @@ -125,6 +164,16 @@ ADD_COMMIT = add x8, x8, #0x(Last 3 digits of COMMIT_CRED)
#define ADD_INIT_CTX_01_11_000 0x910fc000
#define ADD_COMMIT_CTX_01_11_000 0x91048108

// TAB-A05-BA1 00.03.000
#define COMMIT_CREDS_CTZ_00_03_000 0x5a120
#define AVC_DENY_CTZ_00_03_000 0x359c20
#define SEL_READ_ENFORCE_CTZ_00_03_000 0x364370
#define SEL_READ_HANDLE_UNKNOWN_CTZ_00_03_000 0x364d48
#define INIT_CRED_CTZ_00_03_000 0x11653f0
#define SELINUX_ENFORCING_CTZ_00_03_000 0x12d49bc
#define ADD_INIT_CTZ_00_03_000 0x910fc000
#define ADD_COMMIT_CTZ_00_03_000 0x91048108

// TAB-A05-BA1 01.00.000
#define COMMIT_CREDS_CTZ_01_00_000 0x5a120
#define AVC_DENY_CTZ_01_00_000 0x359c20
Expand Down Expand Up @@ -729,6 +778,34 @@ void select_offset() {
int len = __system_property_get("ro.build.fingerprint", fingerprint);
LOG("fingerprint: %s\n", fingerprint);

if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/00.04.000/00.04.000:user/release-keys")) {
selinux_enforcing = SELINUX_ENFORCING_CTX_00_04_000;
sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_00_04_000;
fixup_root_shell(INIT_CRED_CTX_00_04_000, COMMIT_CREDS_CTX_00_04_000, SEL_READ_HANDLE_UNKNOWN_CTX_00_04_000, ADD_INIT_CTX_00_04_000, ADD_COMMIT_CTX_00_04_000);
return;
}

if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/00.05.000/00.05.000:user/release-keys")) {
selinux_enforcing = SELINUX_ENFORCING_CTX_00_05_000;
sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_00_05_000;
fixup_root_shell(INIT_CRED_CTX_00_05_000, COMMIT_CREDS_CTX_00_05_000, SEL_READ_HANDLE_UNKNOWN_CTX_00_05_000, ADD_INIT_CTX_00_05_000, ADD_COMMIT_CTX_00_05_000);
return;
}

if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/00.08.000/00.08.000:user/release-keys")) {
selinux_enforcing = SELINUX_ENFORCING_CTX_00_08_000;
sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_00_08_000;
fixup_root_shell(INIT_CRED_CTX_00_08_000, COMMIT_CREDS_CTX_00_08_000, SEL_READ_HANDLE_UNKNOWN_CTX_00_08_000, ADD_INIT_CTX_00_08_000, ADD_COMMIT_CTX_00_08_000);
return;
}

if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/00.09.000/00.09.000:user/release-keys")) {
selinux_enforcing = SELINUX_ENFORCING_CTX_00_09_000;
sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_00_09_000;
fixup_root_shell(INIT_CRED_CTX_00_09_000, COMMIT_CREDS_CTX_00_09_000, SEL_READ_HANDLE_UNKNOWN_CTX_00_09_000, ADD_INIT_CTX_00_09_000, ADD_COMMIT_CTX_00_09_000);
return;
}

if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/01.00.000/01.00.000:user/release-keys")) {
selinux_enforcing = SELINUX_ENFORCING_CTX_01_00_000;
sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_01_00_000;
Expand Down Expand Up @@ -757,6 +834,13 @@ void select_offset() {
return;
}

if (!strcmp(fingerprint, "Panasonic/TAB-A05-BA1/TAB-A05-BA1:9/00.03.000/00.03.000:user/release-keys")) {
selinux_enforcing = SELINUX_ENFORCING_CTZ_00_03_000;
sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTZ_00_03_000;
fixup_root_shell(INIT_CRED_CTZ_00_03_000, COMMIT_CREDS_CTZ_00_03_000, SEL_READ_HANDLE_UNKNOWN_CTZ_00_03_000, ADD_INIT_CTZ_00_03_000, ADD_COMMIT_CTZ_00_03_000);
return;
}

if (!strcmp(fingerprint, "Panasonic/TAB-A05-BA1/TAB-A05-BA1:9/01.00.000/01.00.000:user/release-keys")) {
selinux_enforcing = SELINUX_ENFORCING_CTZ_01_00_000;
sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTZ_01_00_000;
Expand Down

0 comments on commit cd2419f

Please sign in to comment.