This repository has been archived by the owner on Apr 25, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/offensive-security/nethun…
- Loading branch information
Showing
87 changed files
with
476 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/sbin/sh | ||
|
||
. "$env" | ||
|
||
f2fs_system_opts="ro" | ||
f2fs_system_flags="wait" | ||
|
||
f2fs_data_opts="nosuid,nodev,noatime,nodiratime,discard,inline_xattr" | ||
f2fs_data_flags="wait,encryptable=footer" | ||
|
||
f2fs_cache_opts="nosuid,nodev,noatime,nodiratime,discard,inline_xattr" | ||
f2fs_cache_flags="wait" | ||
|
||
fstab_get_block() { | ||
awk '$2 == "/'$1'" && $3 == "'$2'" { print $1; exit; }' "$fstab" | ||
} | ||
|
||
fstab_get_line() { | ||
awk '$2 == "/'$1'" && $3 == "'$2'" { print NR; exit; }' "$fstab" | ||
} | ||
|
||
fstab_has() { | ||
[ "$(fstab_get_block $2 $1)" ] || return 1 | ||
} | ||
|
||
fstab_check() { | ||
if fstab_has f2fs $1 || ! fstab_has ext4 $1; then | ||
return 1 | ||
fi | ||
} | ||
|
||
fstab_add() { | ||
fstab_check $1 || return 0 | ||
block="$(fstab_get_block $1 ext4)" | ||
line=$(fstab_get_line $1 ext4) | ||
[ "$block" -a "$line" ] && { | ||
sed -i "${line}i$block /$1 f2fs $2 $3" "$fstab" | ||
print "Added f2fs /$1 to fstab" | ||
} | ||
} | ||
|
||
print "Patching the fstab for f2fs support..." | ||
|
||
found_fstab=false | ||
|
||
for fstab in fstab.*; do | ||
print "Found fstab: $fstab" | ||
found_fstab=true | ||
fstab_add system "$f2fs_system_opts" "$f2fs_system_flags" | ||
fstab_add data "$f2fs_data_opts" "$f2fs_data_flags" | ||
fstab_add cache "$f2fs_cache_opts" "$f2fs_cache_flags" | ||
done | ||
|
||
$found_fstab || { | ||
print "Unable to find the fstab!" | ||
} | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/sbin/sh | ||
|
||
. "$env" | ||
|
||
print "Removing Samsung secure kernel info..." | ||
rm /system/*info* | ||
|
||
print "Disabling SELinux enforcement..." | ||
setprop ro.build.selinux 1 | ||
setprop ro.build.selinux.enforce 0 | ||
setprop ro.boot.selinux permissive | ||
|
||
print "Disabling Knox..." | ||
rm -rf /system/app/SecurityLogAgent | ||
setprop ro.config.knox 0 | ||
setprop ro.config.kap false | ||
delprop ro.config.kap_default_on | ||
setprop ro.securestorage.support false | ||
|
||
print "Disabling TIMA..." | ||
setprop ro.config.tima 0 | ||
setprop ro.config.rkp false | ||
delprop ro.config.timaversion | ||
|
||
print "Disabling HDCP enforcing..." | ||
setprop wlan.wfd.hdcp disable | ||
|
||
print "Adding private mode support..." | ||
insert_after_last init.rc "import /init\\..*\\.rc" "import /init.privatemode.rc" | ||
|
||
#print "Probably unnecessary" | ||
#setprop ro.sec.fle.encryption false | ||
|
||
print "Applying MobiCore/TUI service fix..." | ||
|
||
cat <<EOF > "$tmp/keepmc" | ||
00060308060501020000000000000000.tlbin | ||
07060000000000000000000000000000.tlbin | ||
08130000000000000000000000000000.tlbin | ||
ffffffff000000000000000000000005.tlbin | ||
ffffffff00000000000000000000000e.tlbin | ||
ffffffff000000000000000000000016.tlbin | ||
ffffffff000000000000000000000019.tlbin | ||
ffffffff00000000000000000000001f.tlbin | ||
ffffffff00000000000000000000002e.tlbin | ||
ffffffff000000000000000000000042.tlbin | ||
ffffffff000000000000000000000047.tlbin | ||
ffffffffd00000000000000000000004.tlbin | ||
ffffffffd0000000000000000000000e.tlbin | ||
ffffffffd00000000000000000000014.tlbin | ||
ffffffffd00000000000000000000016.tlbin | ||
ffffffffd00000000000000000000017.tlbin | ||
ffffffffd0000000000000000000001a.tlbin | ||
EOF | ||
|
||
cd /system/app/mcRegistry | ||
for tlbin in *.tlbin; do | ||
grep -q "/^$tlbin\$/" "$tmp/keepmc" || rm "$tlbin" | ||
done | ||
|
||
rm -rf /system/app/TuiService | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/sbin/sh | ||
|
||
. "$env" | ||
|
||
print "Replacing vold/crypto daemons..." | ||
|
||
de=$ramdisk_patch/disable-encryption | ||
|
||
# remove old binaries | ||
rm -f \ | ||
/system/bin/sdp_cryptod \ | ||
/system/bin/uncrypt \ | ||
/system/bin/vold \ | ||
/system/lib/libknox_migration.so \ | ||
/system/lib64/libknox_migration.so \ | ||
/system/lib64/libsec_ode_migration.so | ||
|
||
# place new binaries | ||
mv -f \ | ||
"$de/bin/sdp_cryptod" \ | ||
"$de/bin/vold" \ | ||
"$de/bin/uncrypt" \ | ||
/system/bin/ | ||
|
||
mv -f \ | ||
"$de/lib/libknox_migration.so" \ | ||
/system/lib/ | ||
|
||
mv -f \ | ||
"$de/lib64/libknox_migration.so" \ | ||
"$de/lib64/libsec_ode_migration.so" \ | ||
/system/lib64/ | ||
|
||
rm -rf "$de" | ||
|
||
# adjust metadata | ||
chmod 0755 \ | ||
/system/bin/sdp_cryptod \ | ||
/system/bin/vold | ||
|
||
chmod 0750 \ | ||
/system/bin/uncrypt | ||
|
||
chmod 0644 \ | ||
/system/lib/libknox_migration.so \ | ||
/system/lib64/libknox_migration.so \ | ||
/system/lib64/libsec_ode_migration.so | ||
|
||
chown 0:2000 \ | ||
/system/bin/sdp_cryptod \ | ||
/system/bin/uncrypt \ | ||
/system/bin/vold \ | ||
/system/lib/libknox_migration.so \ | ||
/system/lib64/libknox_migration.so \ | ||
/system/lib64/libsec_ode_migration.so | ||
|
||
chcon -t sdp_cryptod_exec /system/bin/sdp_cryptod | ||
chcon -t uncrypt_exec /system/bin/uncrypt | ||
chcon -t vold_exec /system/bin/vold | ||
chcon -t system_library_file \ | ||
/system/lib/libknox_migration.so \ | ||
/system/lib64/libknox_migration.so \ | ||
/system/lib64/libsec_ode_migration.so | ||
|
||
print "Encryption should no longer be forced!" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/sbin/sh | ||
|
||
. "$env" | ||
|
||
print "Freeing up space..." | ||
|
||
# Stock ramdisk items | ||
rm -f \ | ||
./*.ranchu \ | ||
./*.goldfish \ | ||
sbin/dm_verity_signature_checker \ | ||
sbin/ffu \ | ||
sbin/sverifysignature | ||
|
||
# NetHunter ramdisk items | ||
rm -rf \ | ||
sbin/busybox_nh \ | ||
sbin/dvbootscript.sh \ | ||
sbin/dvmediarevert \ | ||
sbin/hostapd \ | ||
sbin/media_profiles.xml | ||
|
||
exit 0 |
Binary file added
BIN
+21.9 KB
marshmallow/gracelte/ramdisk-patch/disable-encryption/bin/sdp_cryptod
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+202 KB
marshmallow/gracelte/ramdisk-patch/disable-encryption/lib/libknox_migration.so
Binary file not shown.
Binary file added
BIN
+259 KB
marshmallow/gracelte/ramdisk-patch/disable-encryption/lib64/libknox_migration.so
Binary file not shown.
Binary file added
BIN
+86.2 KB
marshmallow/gracelte/ramdisk-patch/disable-encryption/lib64/libsec_ode_migration.so
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
on post-fs | ||
mkdir /mnt/shell/privatemode 0700 system system | ||
mkdir /storage/Private 0000 system system | ||
|
||
on post-fs-data | ||
mkdir /mnt/shell 0750 shell shell | ||
mkdir /data/privatemode 0770 system system | ||
chown system system /data/privatemode | ||
restorecon /data/privatemode | ||
|
||
service privatemode /system/bin/sdcard /data/privatemode /mnt/shell/privatemode 1000 1000 | ||
class late_start | ||
oneshot |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/sbin/sh | ||
|
||
. "$env" | ||
|
||
f2fs_system_opts="ro" | ||
f2fs_system_flags="wait" | ||
|
||
f2fs_data_opts="nosuid,nodev,noatime,nodiratime,discard,inline_xattr" | ||
f2fs_data_flags="wait,encryptable=footer" | ||
|
||
f2fs_cache_opts="nosuid,nodev,noatime,nodiratime,discard,inline_xattr" | ||
f2fs_cache_flags="wait" | ||
|
||
fstab_get_block() { | ||
awk '$2 == "/'$1'" && $3 == "'$2'" { print $1; exit; }' "$fstab" | ||
} | ||
|
||
fstab_get_line() { | ||
awk '$2 == "/'$1'" && $3 == "'$2'" { print NR; exit; }' "$fstab" | ||
} | ||
|
||
fstab_has() { | ||
[ "$(fstab_get_block $2 $1)" ] || return 1 | ||
} | ||
|
||
fstab_check() { | ||
if fstab_has f2fs $1 || ! fstab_has ext4 $1; then | ||
return 1 | ||
fi | ||
} | ||
|
||
fstab_add() { | ||
fstab_check $1 || return 0 | ||
block="$(fstab_get_block $1 ext4)" | ||
line=$(fstab_get_line $1 ext4) | ||
[ "$block" -a "$line" ] && { | ||
sed -i "${line}i$block /$1 f2fs $2 $3" "$fstab" | ||
print "Added f2fs /$1 to fstab" | ||
} | ||
} | ||
|
||
print "Patching the fstab for f2fs support..." | ||
|
||
found_fstab=false | ||
|
||
for fstab in fstab.*; do | ||
print "Found fstab: $fstab" | ||
found_fstab=true | ||
fstab_add system "$f2fs_system_opts" "$f2fs_system_flags" | ||
fstab_add data "$f2fs_data_opts" "$f2fs_data_flags" | ||
fstab_add cache "$f2fs_cache_opts" "$f2fs_cache_flags" | ||
done | ||
|
||
$found_fstab || { | ||
print "Unable to find the fstab!" | ||
} | ||
|
||
exit 0 |
Oops, something went wrong.