Android Tools (ADB, Fastboot, etc) on Ubuntu Linux


  1. How to install Android Tools:
  2. ADB
  3. Fastboot (is not supported by Samsung, use heimdall instead.)
  4. heimdall on Ubuntu20.04LTS. (use this binary)
    It is buggy. Use Ubuntu 20.04LTS which seems most stable.
    Windows Version gives you an error.
    Ubuntu18.04LTS gives you a nightmere as well.

TWRP


  1. Get Logs of patch, eg. Magisk, no-verity-opt-encryption and so on.
    1. Insert sdcard.
    2. Tap advanced -> Copy Log
    3. The recovery log will be saved to /external_sd/recovery.log.
    4. download it to your pc by $ adb pull /external_sd/recovery.log.
  2. How to extract boot.img
    1. Get a recovery log.
    2. Install TWRP and boot to TWRP. You need to find where is /boot.
      1. open the log and find /boot.
        	      Partition Logs:
        /boot | /dev/block/sda17 | Size: 64MB
           Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img 
           Primary_Block_Device: /dev/block/sda17
           Display_Name: Boot
           Storage_Name: boot
           Backup_Path: /boot
           Backup_Name: boot
           Backup_Display_Name: Boot
           Storage_Path: /boot
           Current_File_System: emmc
           Fstab_File_System: emmc
           Backup_Method: dd 
        	      
    3. # dd if=/dev/block/sda17 of=/external_sd/boot_extracted.img
    4. (PC) adb pull /external_sd/boot_extracted.img

Reference:
Since 20231013