TARGET_PREBUILT_KERNEL := device/Mattel/NabiSE/kernel
BOARD_MKBOOTIMG_ARGS := --base 80000000 --pagesize 2048 --kernel_offset 00008000 --ramdisk_offset 04000000 --tags_offset 06900000 --board 3.0.10
+#Dem magic numbers tho.
#MTK common twrp flags
TW_NO_EXFAT := true
TWHAVE_SELINUX := true
#TW_USE_TOOLBOX := true
TW_NO_EXFAT_FUSE := true
-TW_THEME := landscape_mdpi
+TW_THEME := portrait_mdpi
#RECOVERY_SDCARD_ON_DATA := true
# Max brightness to prevent display damage
TW_MAX_BRIGHTNESS := 160
TW_DEFAULT_BRIGHTNESS := 120
TW_INCLUDE_FB2PNG := true
TWRP_INCLUDE_LOGCAT := true
-#DEVICE_RESOLUTION := 1024x600
-RECOVERY_TOUCHSCREEN_SWAP_XY := true
+DEVICE_RESOLUTION := 600x1024
+#RECOVERY_TOUCHSCREEN_SWAP_XY := true
#RECOVERY_TOUCHSCREEN_FLIP_X := true
-RECOVERY_TOUCHSCREEN_FLIP_Y := true
+#RECOVERY_TOUCHSCREEN_FLIP_Y := true
TWRP_EVENT_LOGGING := true
+#The SE comes with encryption permanently enabled by default.
+#Perhaps patching the kernel to defeat forced decrypt would do the trick
+#Problem is whilst Magisk has that ability, it is seemingly unable to edit boot.img for whatever reason
+#Magisk Manager churns out an apparently corrupted image
+TW_INCLUDE_CRYPTO := true
TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID := true
TARGET_USE_CUSTOM_LUN_FILE_PATH := "/sys/devices/platform/mt_usb/gadget/lun%d/file"
BOARD_CUSTOM_BOOTIMG_MK := device/Mattel/NabiSE/boot.mk
-# mount point fstype device [device2]
+#fstab stuff taken off neporood's RCA recovery, lulz
+#Had to enable TW_INCLUDE_CRYPTO for password-based decrypt to work
+# mount point fstype device [device2] TWRP Flag
-/boot emmc /dev/bootimg
-/recovery emmc /dev/recovery
-/system ext4 /dev/block/mmcblk0p3
-/cache ext4 /dev/block/mmcblk0p4
-/data ext4 /dev/block/mmcblk0p5
-/emmc vfat /dev/block/mmcblk0p6 flags=display="Phone Storage";settingsstorage
-/sdcard vfat /dev/block/mmcblk1p1 flags=display="SD Card";storage;removable
-/sd-ext auto /dev/block/mmcblk1p2
-/nvram emmc /dev/nvram flags=display="Nvram";backup=1
-/uboot emmc /dev/uboot flags=display="Uboot";backup=1
+/nvram emmc /dev/nvram flags=display="Nvram";backup=1
+#/logo emmc /dev/logo flags=display="Logo";backup=0
+#/uboot emmc /dev/uboot flags=display="Uboot";backup=0
+#/emmc vfat /dev/block/mmcblk0p8 flags=display="Internal SDcard";storage;wipeingui;backup=0
-#/boot emmc /dev/block/platform/mtk-msdc.0/by-name/boot flags=display="Boot";backup=1
-#/recovery emmc /dev/block/platform/mtk-msdc.0/by-name/recovery flags=display="Recovery";backup=1
-#/system ext4 /dev/block/platform/mtk-msdc.0/by-name/system flags=display="System";backup=1
-#/cache ext4 /dev/block/platform/mtk-msdc.0/by-name/cache flags=display="Cache"
-#/data ext4 /dev/block/platform/mtk-msdc.0/by-name/userdata flags=encryptable=/dev/block/platform/mtk-msdc.0/by-name/metadata
-#/nvram emmc /dev/block/platform/mtk-msdc.0/by-name/nvram flags=display="Nvram";backup=1;flashimg=1
-#/external_sd auto /dev/block/mmcblk1p1 flags=display="External SDcard";storage;wipeingui;removable;backup=0
-#/usbotg auto /dev/block/sda1 flags=display="Usb-Otg";storage;removable;backup=0
-
-#/boot mtd boot
-#/recovery mtd recovery
-#/cache yaffs2 cache
-#/data yaffs2 userdata
-#/misc mtd misc
-#/system yaffs2 system
-#/sdcard vfat /dev/block/mmcblk0p1
-#/sd-ext ext4 /dev/block/mmcblk0p2
+/boot emmc /dev/bootimg flags=display="Boot";backup=1
+/recovery emmc /dev/recovery flags=display="Recovery";backup=1
+/system ext4 /dev/block/mmcblk0p7 flags=display="System";backup=1;wipeingui
+/cache ext4 /dev/block/mmcblk0p8 flags=display="Cache";backup=1;wipeingui;wipeduringfactoryreset
+/data ext4 /dev/block/mmcblk0p9 flags=encryptable=footer #flags=display="Data";backup=1;wipeingui;wipeduringfactoryreset
+/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1