[Q] Is contents of Custom Recovery APK useful in obtaining custom recovery for vs985? - Verizon LG G3

So I did some exploring in the posted custom recovery by AnZhi. There was some discussion over which partitions could be accessed. There is an fstab file in there that can be modified which should allow access to other partitions...
Recovery.fstab
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
Looking further it seems this works by overwriting the files in /system/recovery. The process can't be that simple... can it?
Also there is a keys file with a bunch of cryptic hex codes....not quite sure what they're used for.... useful?
I'm a very experienced programmer, but new when it comes to android bootloader/recovery exploit development.
Any ideas guys? What can we learn by perusing this apk?
PS
Newbies.... To see the contents of an apk file just rename *.apk to *.zip and unzip it

I'm also new to bootloaders, we can probably pull a fstab from a rooted g3 and edit the existing one from there
I'm Also curious to see what's in the apk, I'll extract it to see if I can gather some more info
Sent from my VS985 4G using XDA Premium 4 mobile app

Related

[Q] Add device support to dsixda's kitchen

First off, mods, if this is in the wrong place sorry, secondly, thanks for the help in advance.
I have dsixda's kitchen set up via cygwin, but do not have the proper files in the edify_defs folder so that the kitchen knows the proper mount points. What I am talking about is in the following bit quoted from the original kitchen thread.
WARNING: If your device is not listed in post #1 of this thread, and it does NOT use a 'YAFFS'-based filesystem (e.g. usually only low-end devices use YAFFS), do not attempt to flash a ROM that you built with this kitchen. Instead, you must do the following if your device is NOT listed:
Create a file under the kitchen's /tools/edify_defs folder, with the name being the same as the value of ro.product.device (found in your device's /system/build.prop file).
If the stock ROM images for your device contain the recovery.img file, extract its files from the kitchen menu: Advanced --> Tools for boot image --> Extract from boot.img/recovery.img in any folder. Then, open up its ramdisk folder, and look for /system/etc/recovery.fstab or /etc/recovery.fstab or similar FSTAB file location. Open this file to find the mount points.
See the template file in the edify_defs folder to see how to set the mount points inside the file you created. Look at the other files in that folder for examples on how to do it.
NOTE: This method does not guarantee your device will work with your custom ROM, however. Some devices may require more steps than just the edify_defs file, but the procedure is outside the scope of this FAQ. Ask around in the XDA sub-forum for your device if you need further help.
Click to expand...
Click to collapse
The devices I would like to add are both the first gen Nexus 7 (nakasi/grouper) and second gen Nexus 7 (flo). When I follow the instructions from that quoted section I am unable to make sense of the listed mount points and how to create the proper files. Any help is appreciated, thanks!
Have u rooted???
Sent from my Micromax A30 using xda app-developers app
danger_beast said:
Have u rooted???
Sent from my Micromax A30 using xda app-developers app
Click to expand...
Click to collapse
Yes, going to sell the first gen N7, so just would like to add support for the 2nd gen (flo/razor).
dark2099 said:
Yes, going to sell the first gen N7, so just would like to add support for the 2nd gen (flo/razor).
Click to expand...
Click to collapse
would like to add support for LG-E510, I've tried many times, help
---------- Post added at 07:59 PM ---------- Previous post was at 07:38 PM ----------
here is my fstab file:
# Mount point fstype device [device2]
/ boot mtd boot
/ cache yaffs2 cache
/ data yaffs2 userdata
/ misc mtd misc
/ recovery mtd recovery
/ sdcard vfat / dev/block/mmcblk0p1 / dev/block/mmcblk0
/ system yaffs2 system
help me
danger_beast said:
Have u rooted???
Sent from my Micromax A30 using xda app-developers app
Click to expand...
Click to collapse
No one can help:good:
giltros1 said:
No one can help:good:
Click to expand...
Click to collapse
Mobile name?? version >> android
danger_beast said:
Mobile name?? version >> android
Click to expand...
Click to collapse
Mobile name: LG-E510, LG optimus Hub
Version android 2.3.6
Thanks
/boot mtd boot
/cache yaffs2 cache
/data yaffs2 userdata
/misc mtd misc
/recovery mtd recovery
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
/system yaffs2 system
giltros1 said:
/boot mtd boot
/cache yaffs2 cache
/data yaffs2 userdata
/misc mtd misc
/recovery mtd recovery
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
/system yaffs2 system
Click to expand...
Click to collapse
Create a file under the kitchen's /tools/edify_defs folder, with the name being the same as the value of ro.product.device (found in your device's /system/build.prop file).
If the stock ROM images for your device contain the recovery.img file, extract its files from the kitchen menu: Advanced --> Tools for boot image --> Extract from boot.img/recovery.img in any folder. Then, open up its ramdisk folder, and look for /system/etc/recovery.fstab or /etc/recovery.fstab or similar FSTAB file location. Open this file to find the mount points.
See the template file in the edify_defs folder to see how to set the mount points inside the file you created. Look at the other files in that folder for examples on how to do it.
So if u got the ro.product.device ID (can be found in build.prop its easy then follow the steps above.....)
This is my recovery.fstab
/boot mtd boot
/cache yaffs2 cache
/data yaffs2 userdata
/misc mtd misc
/recovery mtd recovery
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
/system yaffs2 system
---------- Post added at 06:16 PM ---------- Previous post was at 06:15 PM ----------
This is my recovery.fstab
/boot mtd boot
/cache yaffs2 cache
/data yaffs2 userdata
/misc mtd misc
/recovery mtd recovery
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
/system yaffs2 system
giltros1 said:
This is my recovery.fstab
/boot mtd boot
/cache yaffs2 cache
/data yaffs2 userdata
/misc mtd misc
/recovery mtd recovery
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
/system yaffs2 system
Click to expand...
Click to collapse
Could u upload and pm me the files??

Help (g2 mini/d620k external and internal storage swap)

hi, masters.. i just want to ask regarding my LG G2 D620K, I want to swap its internal and external storage. it's already rooted. I've read procedures for manual editing vold.fstab on root/system/etc..but i cant find such file. i've found something with "fstab" but it's "fstab.g2m". .below is what it says inside:
Android fstab file. # The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#TODO: Add 'check' as fs_mgr_flags with data partition. # Currently we dont have e2fsck compiled. So fs check would failed. # #<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags> /devices/msm_sdcc.2/mmc_host /storage/external_SD vfat nosuid,nodev wait,voldmanaged=external_SD:auto /dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1,discard wait,check /dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc,discard,data=ordered wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/encrypt #/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 nosuid,nodev,barrier=1,data=ordered,nodelalloc wait,check #/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered wait,check #/dev/block/platform/msm_sdcc.1/by-name/drm /persist-lg ext4 nosuid,nodev,barrier=1,data=ordered wait,check #/dev/block/platform/msm_sdcc.1/by-name/sns /sns ext4 nosuid,nodev,barrier=1,data=ordered wait,check #/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults #/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults #/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults
android version: 5.0.2
software version: v20b-515-03
thank you in advance for any help

Where is boot partition?

Hi, i'm searching for the boot partition on Xperia mini pro and i can't find it. On other devices it's usually '/dev/block/mtdblockx' but on this device it's not.
There is no /boot directory at all. I'm wondering why we should use fastboot to flash boot.img instead of flashing it with the device itself ? (like some other devices)
I'm using Legacy xperia cm 13.0 and i this is 'fstab.semc' file in the root directory:
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/null /boot mtd defaults defaults
/dev/null /recovery mtd defaults defaults
/dev/block/mtd/by-name/system /system yaffs2 ro wait
/dev/block/mtd/by-name/cache /cache yaffs2 rw,noatime,nosuid,nodev wait
/dev/block/mmcblk0p1 /data f2fs rw,discard,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check,formattable
/dev/block/mmcblk0p1 /data ext4 noatime,nosuid,nodev,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check
# Vold managed devices
/devices/platform/msm_hsusb_host.0* auto auto defaults voldmanaged=usb:auto
# zRAM
/dev/block/zram0 none swap defaults zramsize=134217728
How is this possible? Why it's pointing to /dev/null ?
I'm just wondering which partition fastboot uses to flash the kernel img ? And is this possible for us to find the partition and flash the kernel with phone using dd ?
Can anyone explain it to me?
Thank you.

[Q] Add EXT4 support to ROM to mount external hard drive

Hey folks.
So, I have installed a custom rom to an android box, it runs on EXT4 itself for the system but if I try to connect an external hard drive formatted as EXT4 it only says it's unsupported and will give me the option to format it, which I won't do. I don't want FAT32 or ExFAT or NTFS. I need EXT4 for reasons.
I was using this hard drive with my RaspberryPi before and it worked fine. Also this box is rooted and I can mount it manually with "mount -t ext4 /dev/block/sda /mnt/hd" or whatever and I can see the files, have read/write BUT other apps can't see it due to Android security (even messing with chown/chmod).
I'm not sure how to add EXT4 support to mountable storage at all to a ROM. The dev seems to be busy with other projects and won't help, so I have to figure it out on my own.
I have searched left and right but couldn't find any answer on how to do it myself, nothing very conclusive.
Should I just add the hdd to fstab.amlogic? Does it have anything to do with vold? I wanted the system to be able to recognize it and mount it, not mount it myself like this.
Futher info:
This is the BLKID for the hdd:
Code:
/dev/block/sda: UUID="4de...d5" TYPE="ext4"
/dev/block/vold/disk:8,0: UUID="4de...d5" TYPE="ext4"
This is the fstab.amlogic:
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/misc /misc emmc defaults defaults
/dev/block/system /system ext4 ro wait
/dev/block/data /data ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check,encryptable=footer
/dev/block/cache /cache ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check
/devices/*.sd/mmc_host/sd* auto auto defaults voldmanaged=sdcard1:auto,noemulatedsd
/devices/*dwc3/xhci-hcd.0.auto/usb?/*/host*/target*/block/sd* auto auto defaults voldmanaged=udisk:auto
/devices/*dwc3/xhci-hcd.0.auto/usb?/*/host*/target*/block/sr* auto auto defaults voldmanaged=sr0:auto
/dev/block/loop auto loop defaults voldmanaged=loop:auto
# Add for zram. zramsize can be in numeric (byte) , in percent
/dev/block/zram0 /swap_zram0 swap defaults wait,zramsize=524288000
/dev/block/tee /tee ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check
Thank you.

[Support] Perfect boot image - disable verity and forced encrypt

ive created a boot.img maybe someone can try and report back - in theory it should speed up /data /system and /cache partitions by the fstab flags set.
also uploaded the default boot.img from oxygen 4-7-5 (please make sure you're on 4-7-5) maybe someone can help fix this if it doesnt work.
please note this may wipe all storage / etc etc take all necessary precautions (external backup etc) until we get it working 100% as i havent tested
this work is open to anyone who'd like to use it.
Cliffs
- ive modified boot.img to try and disable verity and force encrypt - also enabling / disabling certain IO functions to improve throughput
- i need someone to go into twrp > flash the modifiedboot.img then format /data and check if it boots (i.e boots into OS if it does please report back)
-please make all necessary backups incase it doesnt work
-attached stock boot.img incase it doesnt work (please make external backup too)
here are my attempts:
Modified boot.img:
https://drive.google.com/open?id=154jrUAQ1oq7Fpjw7PgBKCJ_E6yBCxvaQ
stock boot.img
https://drive.google.com/open?id=17JU_OiEGdGm_9K1TcYlFtEkiiTJmODve
please report back if it works or not (i.e does it boot into OS or hang?)
background
my previous android phones ive created a perfect boot image whereby i edit the fstab in the boot.img
to disable force encryption and apply other android attributed in the fstab.
however i do not yet have my 1+5T as of yet so i can not try the edits as the boot.img is alittle different from my previous android phones.
The stock boot.img for the oneplus 5T (extracted from 4-7-5)
has two fstab files
the first fstab.qcom, and the second fstab_nodata.qcom
both these fstab are alittle different.
fstab.qcom looks like this:
Code:
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard,errors=panic wait,verify
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr wait,check,forceencrypt=footer,resize
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=panic wait,check,fileencryption=ice,resize
#/devices/soc/c0a4900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/dev/block/zram0 none swap defaults zramsize=536870912
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/bluetooth /bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,barrier=1 wait,check
/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usbotg:auto
and fstab_nodata.qcom looks like this:
Code:
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait,verify
#/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=panic wait,check,forceencrypt=footer,resize
tmpfs /data tmpfs defaults defaults
#/devices/soc/c0a4900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/dev/block/zram0 none swap defaults zramsize=536870912
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/bluetooth /bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,barrier=1 wait
/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usbotg:auto
as you can see these two files are alittle different - previous android devices have only had one fstab file.
so my first question why are there two fstab files? - anywho ive added my modifications to both where applicable.
secondly the modified fstab id like to introduce is the following:
Code:
/dev/block/bootdevice/by-name/system /system ext4 ro,noatime,noauto_da_alloc,nodev,nodiratime,barrier=0,data=writeback,nobh wait
/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,nodiratime,discard,inline_data,inline_xattr wait,check,encryptable,resize
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,nodiratime,barrier=0,data=writeback,noauto_da_alloc,discard,nobh wait,check,encryptable,resize
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,noatime,noauto_da_alloc,nodiratime,barrier=0,data=writeback,nobh wait,check
virtyx said:
Hi guys
my previous android phones ive created a perfect boot image whereby i edit the fstab in the boot.img
to disable force encryption and apply other android attributed in the fstab.
however i do not yet have my 1+5T as of yet so i can not try the edits as the boot.img is alittle different from my previous android phones.
The stock boot.img for the oneplus 5T (extracted from 4-7-5)
has two fstab files
the first fstab.qcom, and the second fstab_nodata.qcom
both these fstab are alittle different.
fstab.qcom looks like this:
and fstab_nodata.qcom looks like this:
as you can see these two files are alittle different - previous android devices have only had one fstab file.
so my first question why are there two fstab files? - anywho ive added my modifications to both where applicable.
secondly the modified fstab id like to introduce is the following:
ive created a boot.img maybe someone can try and report back - in theory it should speed up /data /system and /cache partitions by the fstab flags set.
also uploaded the default boot.img from oxygen 4-7-5 (please make sure you're on 4-7-5) maybe someone can help fix this if it doesnt work.
please note this may wipe all storage / etc etc take all necessary precautions (external backup etc) until we get it working 100% as i havent tested
this work is open to anyone who'd like to use it.
here are my attempts:
Modified boot.img:
https://drive.google.com/open?id=1BYH4J3Du9VBRyxM1hyTQhs_hKNLgOU0W
stock boot.img
https://drive.google.com/open?id=1IpByGusbuWXKOXGKamHHEwax3aSnsvfm
please report back if it works or not (i.e does it boot into OS or hang?)
Click to expand...
Click to collapse
You also need to make the kernel compatible, without verity. Otherwise won't boot
jgcaap said:
You also need to make the kernel compatible, without verity. Otherwise won't boot
Click to expand...
Click to collapse
please read OP again as ive done this
by default force encryption on /data is enabled, and dm-verify is enabled...boot.img needs to be modified to disable. also /data will have to be formatted to flash ROMS.
with dm-verify enabled, any changes to /system will cause no boot
to modify boot.img:
Code:
open /ramdisk/fstab.qcom
change:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,forceencrypt=/dev/block/bootdevice/by-name/extra
to:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,encryptable=/dev/block/bootdevice/by-name/extra
virtyx said:
If we flash the boot.Img then another kernel may it work? @jgcaap how would we get it to work?
Never needed to do that on a previous android
Click to expand...
Click to collapse
You need to compile kernel that will allow to boot without the verity and change the ram disk.
benny3 said:
by default force encryption on /data is enabled, and dm-verify is enabled...boot.img needs to be modified to disable. also /data will have to be formatted to flash ROMS.
with dm-verify enabled, any changes to /system will cause no boot
to modify boot.img:
Code:
open /ramdisk/fstab.qcom
change:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,forceencrypt=/dev/block/bootdevice/by-name/extra
to:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,encryptable=/dev/block/bootdevice/by-name/extra
Click to expand...
Click to collapse
which is why ive asked users to format /data before flashing the boot.img which should disable verity and forceencrypt
jgcaap said:
You need to compile kernel that will allow to boot without the verity and change the ram disk.
Click to expand...
Click to collapse
this is what im doing...
so if someone is brave enough to test this (as i dont have a 1+5T yet)
format /data then using mtp trasnfer the modifiedboot.img to the phone, then flash modified boot.img
and see if you can boot into OS if you can please report back.
updated the modifiedboot.img to omit discard flag - should slightly improve performance but requires a cron job to manually trim partitions, automatic trim can cause hangs upon large file deletion, plus i dont find the need to run trim on the block layer every time a file is deleted, i would rather run it daily with a cron job.
Isn't this what the disable force encryption and disable no verity zip is for? To flash over stock boot image and allow boot on a decrypted device by disabling Force encryption and no verity.?
yung40oz84 said:
Isn't this what the disable force encryption and disable no verity zip is for? To flash over stock boot image and allow boot on a decrypted device by disabling Force encryption and no verity.?
Click to expand...
Click to collapse
yes, those zips only remove verity and force encryption
this boot img includes other tweaks not found elsewhere (ie, data writeback, barrier=0, noatime, nodiratime, noautoalloc, disabling auto-trim, etc) which all theoretically should improve throughput while reducing overhead
virtyx said:
yes, those zips only remove verity and force encryption
this boot img includes other tweaks not found elsewhere (ie, data writeback, barrier=0, noatime, nodiratime, noautoalloc, disabling auto-trim, etc) which all theoretically should improve throughput while reducing overhead
Click to expand...
Click to collapse
Doesn't the auto-trim flag keeps the NAND flash healthy and prevents data corruption? ?
ground-zero said:
Doesn't the auto-trim flag keeps the NAND flash healthy and prevents data corruption? ?
Click to expand...
Click to collapse
No, doesnt prevent corruption.
we dont need the trim command to run every time a file is deleted that just causes unnecessary overhead, its better if we run the trim command daily via a cron job.
(imagine deleting files and running the trim command everytime we do so, its not needed, the OS does adequate garbage collection and the Trim command gets issued automatically from android 5 so its not needed to add it in the fstab)
for your reading
https://wiki.archlinux.org/index.php/Solid_State_Drives#Periodic_TRIM

Categories

Resources