How to install OS in Samsung smg531f which is without OS?



  • I have a samsung SMG531f Grand Prime. I accidentially deleted my OS in Team Win by selecting the System option coming under Wipe option in the main menu. Now when I switch on the phone it will show only the startup screen. I can only go to the TeamWin by pressing Volume up Home and power button. But when I try to go to odin mode by clicking on volume down power and home button it doesn't work. How can I overcome this problem and reinstall os to this phone.

    Volume up key doesn't work in this phone.

    Prefer a solution which can be configured in Windows environment as I don't have access to an open source OS.



    1. download and extract ROM from https://www.xda-developers.com/samloader-download-updates-samsung-galaxy

      cd /media/xubuntu/1234567890ABCDEF
      sudo apt update
      sudo apt install android-sdk-ext4-utils android-sdk-libsparse-utils android-sdk-platform-tools-common android-tools-adb android-tools-fastboot f2fs-tools git python3.8 python3-pip
      

      git clone https://github.com/nlscc/samloader

      cd samloader
      pip3 install .
      cd ..
      sudo cp -av ~/.local/bin/samloader /usr/local/bin

      mkdir Android
      cd Android

      samloader -m SM-G531F -r SLK checkupdate
      samloader -m SM-G531F -r SLK download -v G531FDDU1APJ2/G531FODD1APJ2/G531FDDU1APJ2/G531FDDU1APJ2 -O .
      samloader -m SM-G531F -r SLK decrypt -v G531FDDU1APJ2/G531FODD1APJ2/G531FDDU1APJ2/G531FDDU1APJ2 -V 4 -i SM-G531F_1_20161116150254_w0xdzpk60j_fac.zip.enc4 -o SM-G531F_1_20161116150254_w0xdzpk60j_fac.zip

      unzip SM-G531F*.zip
      tar -vxf AP_G531F*.tar*

    2. convert https://github.com/anestisb/android-simg2img into mountable disk image

      mv -v system.img system.sparse.img
      file system.sparse.img
      simg2img system.sparse.img system.img
      file system.img
      

      (optional) check if mountable

      mkdir system
      sudo mount -vo loop,ro,noexec,noload,noatime -t ext4 system.img system
      ls -a system
      sudo umount -v system
      
    3. copy file to MicroSD Card

      adb push system.img /external_sd
      

      (optional) compare digest

      md5sum system.img
      adb shell md5sum /external_sd/system.img
      
    4. write disk image from terminal dd

      adb shell
      find /dev/block -name by-name
      ls -l /dev/block/bootdevice/by-name/system
      dd if=/external_sd/system.img of=/dev/block/bootdevice/by-name/system
      reboot recovery
      
    5. disable dm-verity and recovery-from-boot.p (necessary for TWRP)

      adb disable-verity
      adb shell
      mount -w /system
      mv -v /system/recovery-from-boot.p /system/recovery-from-boot.bak
      



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2