I recently soft bricked my Motorola G5s plus (sanders), and tried reinstalling the OS from here, but I failed with errors including Permission denied (while wiping partitions), preflash validation failed (on system and oem, including the latest version of Oreo, I'm running 7.1.1).
I have managed to root my phone using Magisk Manager and install TWRP. I created a program to read flashfile.xml.
While installing SANDERS_RETAIL_7.1.1_NPS26.116-45_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip I get these errors:
Executing: fastboot getvar max-sparse-size
max-sparse-size: 268435456
finished. total time: 0.000s
Executing: fastboot oem fb_mode_set
...
OKAY [ 0.001s]
finished. total time: 0.001s
Executing: fastboot flash partition gpt.bin
target reported max download size of 534773760 bytes
sending 'partition' (45 KB)...
OKAY [ 0.002s]
writing 'partition'...
(bootloader) Validating 'gpt.default.xml'
(bootloader) Security version downgrade
(bootloader) Image primary_gpt failed validation
(bootloader) Preflash validation failed
(bootloader) Cancelling 'gpt.default.xml'
FAILED (remote failure)
finished. total time: 0.057s
Executing: fastboot flash bootloader bootloader.img
target reported max download size of 534773760 bytes
sending 'bootloader' (5115 KB)...
OKAY [ 0.138s]
writing 'bootloader'...
(bootloader) Validating 'bootloader.default.xml'
(bootloader) Committing 'bootloader.default.xml'
(bootloader) - flashing 'emmc_appsboot.mbn' to 'aboot'
(bootloader) - flashing 'rpm.mbn' to 'rpm'
(bootloader) - flashing 'tz.mbn' to 'tz'
(bootloader) - flashing 'devcfg.mbn' to 'devcfg'
(bootloader) - flashing 'cmnlib.mbn' to 'cmnlib'
(bootloader) - flashing 'cmnlib64.mbn' to 'cmnlib64'
(bootloader) - flashing 'keymaster.mbn' to 'keymaster'
(bootloader) - flashing 'prov.mbn' to 'prov'
(bootloader) - flashing 'sbl1.mbn' to 'sbl1'
OKAY [ 0.533s]
finished. total time: 0.671s
Executing: fastboot flash modem NON-HLOS.bin
target reported max download size of 534773760 bytes
sending 'modem' (71925 KB)...
OKAY [ 1.860s]
writing 'modem'...
OKAY [ 1.093s]
finished. total time: 2.953s
Executing: fastboot flash fsg fsg.mbn
target reported max download size of 534773760 bytes
sending 'fsg' (3024 KB)...
OKAY [ 0.079s]
writing 'fsg'...
OKAY [ 0.115s]
finished. total time: 0.194s
Executing: fastboot erase modemst1
erasing 'modemst1'...
OKAY [ 0.032s]
finished. total time: 0.032s
Executing: fastboot erase modemst2
erasing 'modemst2'...
OKAY [ 0.030s]
finished. total time: 0.030s
Executing: fastboot flash dsp adspso.bin
target reported max download size of 534773760 bytes
sending 'dsp' (16384 KB)...
OKAY [ 0.422s]
writing 'dsp'...
OKAY [ 0.288s]
finished. total time: 0.710s
Executing: fastboot flash logo logo.bin
target reported max download size of 534773760 bytes
sending 'logo' (2192 KB)...
OKAY [ 0.055s]
writing 'logo'...
OKAY [ 0.108s]
finished. total time: 0.163s
Executing: fastboot flash boot boot.img
target reported max download size of 534773760 bytes
sending 'boot' (16384 KB)...
OKAY [ 0.463s]
writing 'boot'...
(bootloader) Image signed with key bad key
OKAY [ 0.370s]
finished. total time: 0.833s
Executing: fastboot flash recovery recovery.img
target reported max download size of 534773760 bytes
sending 'recovery' (20580 KB)...
OKAY [ 0.565s]
writing 'recovery'...
(bootloader) Image signed with key bad key
OKAY [ 0.476s]
finished. total time: 1.041s
Executing: fastboot flash system system.img_sparsechunk.0
target reported max download size of 534773760 bytes
sending 'system' (256355 KB)...
OKAY [ 6.733s]
writing 'system'...
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 6.745s
Executing: fastboot flash system system.img_sparsechunk.1
target reported max download size of 534773760 bytes
sending 'system' (262115 KB)...
OKAY [ 6.921s]
writing 'system'...
OKAY [ 3.460s]
finished. total time: 10.381s
Executing: fastboot flash system system.img_sparsechunk.2
target reported max download size of 534773760 bytes
sending 'system' (259034 KB)...
OKAY [ 6.770s]
writing 'system'...
OKAY [ 3.539s]
finished. total time: 10.309s
Executing: fastboot flash system system.img_sparsechunk.3
target reported max download size of 534773760 bytes
sending 'system' (262013 KB)...
OKAY [ 6.564s]
writing 'system'...
OKAY [ 3.574s]
finished. total time: 10.139s
Executing: fastboot flash system system.img_sparsechunk.4
target reported max download size of 534773760 bytes
sending 'system' (262142 KB)...
OKAY [ 6.464s]
writing 'system'...
OKAY [ 3.440s]
finished. total time: 9.905s
Executing: fastboot flash system system.img_sparsechunk.5
target reported max download size of 534773760 bytes
sending 'system' (262140 KB)...
OKAY [ 6.498s]
writing 'system'...
OKAY [ 3.322s]
finished. total time: 9.820s
Executing: fastboot flash system system.img_sparsechunk.6
target reported max download size of 534773760 bytes
sending 'system' (259637 KB)...
OKAY [ 6.692s]
writing 'system'...
OKAY [ 3.315s]
finished. total time: 10.007s
Executing: fastboot flash system system.img_sparsechunk.7
target reported max download size of 534773760 bytes
sending 'system' (240915 KB)...
OKAY [ 6.158s]
writing 'system'...
OKAY [ 3.688s]
finished. total time: 9.846s
Executing: fastboot flash system system.img_sparsechunk.8
target reported max download size of 534773760 bytes
sending 'system' (262142 KB)...
OKAY [ 6.482s]
writing 'system'...
OKAY [ 3.692s]
finished. total time: 10.174s
Executing: fastboot flash system system.img_sparsechunk.9
target reported max download size of 534773760 bytes
sending 'system' (233189 KB)...
OKAY [ 6.014s]
writing 'system'...
(bootloader) Invalid sparse image data
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 6.563s
Executing: fastboot flash system system.img_sparsechunk.10
target reported max download size of 534773760 bytes
sending 'system' (65436 KB)...
OKAY [ 1.614s]
writing 'system'...
(bootloader) Invalid sparse image data
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 1.615s
Executing: fastboot flash oem oem.img
target reported max download size of 534773760 bytes
sending 'oem' (145482 KB)...
OKAY [ 3.656s]
writing 'oem'...
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 3.658s
Executing: fastboot erase cache
erasing 'cache'...
OKAY [ 0.011s]
finished. total time: 0.012s
Executing: fastboot erase userdata
erasing 'userdata'...
OKAY [ 0.182s]
finished. total time: 0.182s
Executing: fastboot erase DDR
erasing 'DDR'...
OKAY [ 0.002s]
finished. total time: 0.002s
Executing: fastboot oem fb_mode_clear
...
OKAY [ 0.001s]
finished. total time: 0.002s
How do I fix these errors? I have tried many OS's and my phone will just bootloop in different forms, such as booting back into fastboot, erase loop, and hanging on the 'This device has been unlocked' screen.
Update:
When I do fastboot getvar all I get this output:
(bootloader) version: 0.5
(bootloader) version-bootloader: moto-msm8953-C2.12
(bootloader) product: sanders
(bootloader) board: sanders
(bootloader) secure: yes
(bootloader) hwrev: P4
(bootloader) radio: 1
(bootloader) storage-type: emmc
(bootloader) emmc: 32GB SAMSUNG RX1BMB RV=08 PV=07 FV=0000000000000007
(bootloader) ram: 3GB SAMSUNG LP3 DIE=6Gb M5=01 M6=05 M7=00 M8=7B
(bootloader) cpu: MSM8953
(bootloader) serialno: ZY3226ZJG4
(bootloader) cid: 0x0032
(bootloader) channelid: 0x51
(bootloader) uid: DAEA774100000000000000000000
(bootloader) securestate: flashing_unlocked
(bootloader) iswarrantyvoid: yes
(bootloader) max-download-size: 534773760
(bootloader) reason: Volume down key pressed
(bootloader) imei: 355654081635257
(bootloader) meid:
(bootloader) date: 09-16-2017
(bootloader) sku: XT1805
(bootloader) carrier_sku:
(bootloader) battid:
(bootloader) iccid:
(bootloader) cust_md5:
(bootloader) max-sparse-size: 268435456
(bootloader) current-time: "Fri Jan 2 19:36:32 UTC 1970"
(bootloader) ro.build.fingerprint[0]: samsung/sanders_n/starlte_n:7.1.1/
(bootloader) ro.build.fingerprint[1]: NPSS26.116-61-2/7:user/release-key
(bootloader) ro.build.fingerprint[2]: s
(bootloader) poweroffalarm: 0
(bootloader) ro.build.version.full[0]: Blur_Version.26.271.7.sanders.ret
(bootloader) ro.build.version.full[1]: ail.en.US
(bootloader) ro.build.version.qcom: LA.UM.5.6.r1-03800-89xx.0
(bootloader) version-baseband: M8953_27.36.07.41R SANDERS_EMEADSDS_CUST
(bootloader) kernel.version[0]: Linux version 3.18.31-perf-gaf9c281 (hud
(bootloader) kernel.version[1]: soncm@ilclbld87) (gcc version 4.9 201501
(bootloader) kernel.version[2]: 23 (prerelease) (GCC) ) #1 SMP PREEMPT T
(bootloader) kernel.version[3]: hu Jan 11 10:56:22 CST 2018
(bootloader) sbl1.git: git=MBM-NG-VC2.12-0-g698fb2f
(bootloader) rpm.git: git=MBM-NG-VC2.11-0-g92e5e21-dirty
(bootloader) tz.git: git=MBM-NG-VC2.11-1-g9a0b157
(bootloader) devcfg.git: git=MBM-NG-VC2.11-1-g9a0b157
(bootloader) keymaster.git: git=MBM-NG-VC2.11-1-g9a0b157
(bootloader) cmnlib.git: git=MBM-NG-VC2.11-1-g9a0b157
(bootloader) cmnlib64.git: git=MBM-NG-VC2.11-1-g9a0b157
(bootloader) prov.git: git=MBM-NG-VC2.11-1-g9a0b157
(bootloader) aboot.git: git=MBM-NG-VC2.12-0-g07ff23c
(bootloader) frp-state: no protection (144)
(bootloader) ro.carrier: retapac
(bootloader) current-slot:
(bootloader) slot-suffixes: _a
(bootloader) slot-count: 1
(bootloader) slot-successful:_a: INVALID
(bootloader) slot-successful:_b: INVALID
(bootloader) slot-bootable:_a: INVALID
(bootloader) slot-bootable:_b: INVALID
(bootloader) slot-retry-count:_a: unknown
(bootloader) slot-retry-count:_b: unknown
all: listed above
finished. total time: 0.007s
Update 2:
When I flash the contents of system, img_sparsechunk.0 errors out in Preflash validation error, and says Image is too large in the bootloader logs.