[SOLVED] GSI on BV 4900 Pro: "Cannot load Android system. Your data may be corrupt. " - Blackview S8 Questions & Answers

tl;dr: I followed the procedure to flash Android's Generic System Image (gsi_gms_arm64-exp-TP1A.220624.014-8819323-8a77fef1) on my Blackview BV 4900 Pro, but I am stuck in a bootloop that ends with "Cannot load Android system. Your data may be corrupt."
In details:
Prep​I made sure that my phone could support GSI​
$adb shell getprop ro.treble.enabled
true
$adb shell cat /system/etc/ld.config.29.txt | grep -A 20 "\[vendor\]"
…
namespace.default.isolated = true
…
$adb shell getprop ro.product.cpu.abi
arm64-v8a
Additional Checks​
Bootloader is unlocked.
Device was launched with Android 9 or higher (it was launched with Android 10)
Android 13 GSIs was downloaded (build Build: TP1A.220624.014) was downloaded from https://developer.android.com/topic/generic-system-image/releases and checksum for ARM64+GMS was confirmed to be 8a77fef1842da4a4cff68e36802f779d65e52ae0cfce024a33901d5dc48d47d0.
The phone has Android Verified Boot (AVB):
$adb shell getprop ro.boot.veritymode
enforcing
Flashing​
I followed the official tutorial for flashing GSIs but changed a couple of things (I may have the order wrong, but I essentially did, once I was in fastboot mode
fastboot flashing unlock # To unlock bootloader
fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img # Disable secure boot
fastboot reboot fastboot # Restart in fastbootd
fastboot delete-logical-partition product # I didn't have enough space for Resizing 'system' (I had FAILED (remote: 'Not enough space to resize partition'))
fastboot erase system
fastboot format:ext4 system # because when I tried to flash system.img the first time, I had "Invalid sparse file format at header magic"
fastboot flash system system.img
fastboot format:ext4 userdata
fastboot erase userdata
fastboot format:ext4 metadata
fastboot erase metadata
fastboot erase cache
But when I restart, I am always prompted with
Android Recovery
Blackview /BV4900Pro_US/BV4900Pro10/…
user/release-keys
Use volume up/down and power
Can't load Android system. Your data
may be corrupt. If you continue to get
this message, you may need to perform a
factory data reset and erase all user
data stored on this device
-------------------------
Try again
Factory data reset
-------------------------
Supported API:3
I have tried to reset factory data and to reboot, but I always have the same message…
$ adb --version
Android Debug Bridge version 1.0.41
Version 33.0.3-8952118

I just realized / remembered that this phone uses super.img instead of system.img, maybe I need to repack the system.img into a super.img, following this procedure?

tl;dr: Yes, repacking the system.img into a super.img and then flashing it was key to success.
I have essentially followed what I have described here: https://forum.xda-developers.com/t/...n-blackview-bv-4900-pro.4453955/post-87029001
Except that the three images I used were the original vendor.img, the original product.img, and
aosp_arm64-exp-TP1A.220624.014-8819323-996da050/system.img (available at
Generic System Images (GSIs) | Platform | Android Developers
developer.android.com
)
I used the command
python3 lpmakesimple.py lpbinary/binary/lpmake ./super_20220510.img 4294967296 system=system.img,vendor=./vendor.img,product=./product.img
(4294967296 being picked semi-randomly: it's a multiple of the block size (65536), less than the size of the super partition but more than the size of the three images combined + some more).
That's it: I flashed that super_20220510.img using fastboot flash super super_20220510.img and it was all good!

Related

Fastboot Driver

I am trying to put a ROM on the TF300. I have Unlocked the tablet and installed the ADB driver. When I boot into recovery and the USB icon it asks for a driver for fastboot. I can't seem to get that anywhere. I have the Android SDK installed and java etc. Where is the driver located? I look in the USB driver folder but its not in their...
If you need just fastboot, use this guide, that you will find in the index for tf300 (General & Dev forums)
HELP FOR FLASH MORE FASTER WHEN YOU USE FASTBOOT LINE COMMAND​
If you have got a problem with your adb or fastboot or recovery....it's very simply and faster
use this:
Download this file "fastboot.zip"
Install this file somewhere in one folder which is named "fastboot" on your PC
=> disk C: root
Unzipped this file on the folder "fastboot" and you will find 3 files:
- adb.exe
- AdbWinApi.dll
- fastboot.exe
and when you need to push something by the bootloader, you can use it.
Don't forget to push on this folder the file that you need. For exemple: boot.img or a recovery.img, etc...
The line command is :
Code:
c:\fastboot>
Enter
Code:
c:\fastboot>fastboot flash recovery recovery.img
Enter
If you want to flash the "recovery.img" file
******************************************************************
******************************************************************
If you want to know all lines of command
Code:
c:\fastboot>fastboot
Code:
usage: fastboot [ ]
commands:
update reflash device from update.zip
flashall flash boot + recovery + system
flash [ ] write a file to a flash partition
erase erase a flash partition
getvar display a bootloader variable
boot [ ] download and boot kernel
flash:raw boot [ ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message
options:
-w erase userdata and cache
-s specify device serial number
-p specify product name
-c override kernel commandline
-i specify a custom USB vendor id
-b specify a custom kernel base address
-n specify the nand page size. default: 2048
And if you have some problems with your drivers, you can use this : How to install Universal Naked Drivers
Sent from my N7 3G with DroiDevs premium between sky and earth.
I got it to work thanks!

stock recovery in fastboot menu?

Hello, if i start the phone pushing power an vol down going to fastboot theres a recovery menu, how does it work? Can i make a full backup via this stock recovery menu? Does anybody know the others fastboot menu feature?
To learn more fastboot features in cmd or terminal type fastboot. The stock recovery image is bugged,and you can't do nand backups with it. Some command you may want to become familiar with are fastboot flash (insert what you are flashing)
Sent from Sauwny the TL
can anybody explain all the feature fastboot are.. im new to bootloader..
PerKakah said:
can anybody explain all the feature fastboot are.. im new to bootloader..
Click to expand...
Click to collapse
Here is a list of fastboot functions
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
format <partition> format a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message
options:
-w erase userdata and cache (and format
if supported by partition type)
-u do not first erase partition before
formatting
-s <specific device> specify device serial number
or path to device port
-l with "devices", lists device paths
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default: 2048
-S <size>[K|M|G] automatically sparse files greater than
size. 0 to disable
thanks but wasnt this what i meant
i mean the fastboot menu that shows up pressing power and vol down when power up the phone
the menu is
aè fastboot flash mode s
normal powerup
recovery
factory
switch console
barcodes
bp tools
what is this menus?
raniero1 said:
thanks but wasnt this what i meant
i mean the fastboot menu that shows up pressing power and vol down when power up the phone
the menu is
aè fastboot flash mode s
normal powerup
recovery
factory
switch console
barcodes
bp tools
what is this menus?
Click to expand...
Click to collapse
Here is the info.
Normal power up : It simply reboots your device.
Recovery : takes you to recovery menu of your device. From here you can flash any ROM, backup or restore your device, factory reset or do any other kind of tweak.
Factory : Deletes all the user data. (I.e. all your apps)
Switch console : I don't know what it does.
Barcodes and BP tools just provide you with some info of your device.

Is It Possbile For E5 Play To Be Rooted and Encrypted At the Same Time?

Hello all,
I successfully rooted my phone, so that's good. Part of the instructions are to remove the encryption. Now that it's rooted would it be possible to turn encryption back on? What would happen if I deleted /vendor/etc/fstab.qcom? I'm sure I'd lose my /sdcard/ stuff, but I just did anyway to remove the encryption. (Magisk Manager has settings "Preserve force encryption" and "Preserve AVB 2.0/dm-verity" that I'm not sure what does, but I suspect it's something to do with encryption).
Thanks
Kinda answered my own question. I ran across a menu pick in settings somewhere and clicked on "Encrypt Phone", "note this will take an hour" or something like that. It seems that the phone is encrypted and rooted at this point. What's the old adage, "What could possibly go wrong?", "There's only one way to find out!" TWRP is still on the recovery partition, but can't decrypt the phone. So, probably no backup from TWRP. I wonder what the other drawbacks might be? Hmm.
We have posted TWRP that decrypts so you can ditch my decrypt.zip and you may stay rooted and encrypted as you wish.
Check karthick's thread here:
https://forum.xda-developers.com/moto-e5/development/recovery-twrp-3-2-3-x-moto-e5-plus-t3912189
whodat711 said:
We have posted TWRP that decrypts so you can ditch my decrypt.zip and you may stay rooted and encrypted as you wish.
Check karthick's thread here:
https://forum.xda-developers.com/moto-e5/development/recovery-twrp-3-2-3-x-moto-e5-plus-t3912189
Click to expand...
Click to collapse
Excellent. Thank you!
Well, wait a minute. I put recovery twrp-3.3.1-0-james.img on a Moto-E5 Play (XT1921-2) and it wouldn't boot into recovery. Put previous recovery on and boots into recovery, but of course no decrypt.
This talks about Hanna being updated. https://forum.xda-developers.com/showpost.php?p=79697573&postcount=56
Is twrp-3.3.1-0-james.img supposed to work?
Thanks
Successfully Updated System On Rooted, Encrypted Moto E5 Play
I'm not seeing a lot of information about my particular phone here - Moto E5 Play I bought at Target, XT1921-2. So, I'll post my notes about how I updated it. Note, these are notes - not instructions. Maybe they'll help somebody though. Also note, I'm kinda flying by the seat of my pants here. I really don't know if this is the best/easiest way to update the system. For instance, I'm using a TWRP that doesn't support encryption on this phone. I'm going to try the Hannah TWRP that claims to support encryption at some point, but I haven't yet. All that being said, here's what I did (and it worked).
Code:
# These are notes, not instructions. They assume you know stuff like power
# off before inserting or removing SD card.
# Retrieve un-encrypted SD card from hiding place unknown by adversaries and install in phone.
# Change to Swipe security in case something goes bad.
# Titanium Backup in case something goes bad.
# Copy stuff from /sdcard/ to /external_sd/ in case something goes bad.
# Following this posting:
# https://forum.xda-developers.com/moto-e5/how-to/firmware-moto-e5-xt1944-4-dual-sim-t3820901
# Getting firmware from here:
# https://mirrors.lolinet.com/firmware/moto/james/official/RETUS/
# Download XT1921-2_JAMES_RETUS_8.0.0_OPPS27.91-121-7_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
cd /space/Android/e5play/
mv ~/Downloads/XT1921-2_JAMES_RETUS_8.0.0_OPPS27.91-121-7_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip .
mkdir update
cd update/
unzip ../XT1921-2_JAMES_RETUS_8.0.0_OPPS27.91-121-7_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
# These are vim editor commands, which might be helpful to someone well versed
# in viming. The upshot is, massage update/servicefile.xml to look like the
# fastboot commands below.
# :r servicefile.xml
# Addresses from '.'. Always reset the cursor before executing.
# :.,$s/^ *<step operation="\([^"]*\)" var="\([^"]*\)"\/>/fastboot \1 \2
# :.,$s/^ *<step operation="\([^"]*\)" partition="\([^"]*\)"\/>/fastboot \1 \2/
# :.,$s/^ *<step MD5="\([^"]*\)" filename="\([^"]*\)" operation="\([^"]*\)" partition="\([^"]*\)"\/>/fastboot \3 \4 \2/
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash vendor vendor.img
fastboot flash oem oem.img
fastboot erase DDR
fastboot oem fb_mode_clear
# Note, also flashed stock recovery. Don't know if this was necessary.
# Now used the phone's system to take the security update.
# Got "bad key" when updating. Seemed to work anyway. Remembered seeing
# this. It seems like these images are unsigned, which isn't a big deal because
# the bootloader is unlocked.
# [[email protected] update]$ fastboot flash boot boot.img
# Sending 'boot' (16384 KB) OKAY [ 0.517s]
# Writing 'boot' (bootloader) Image signed with key bad key
# OKAY [ 0.565s]
# Finished. Total time: 1.085s
# [[email protected] update]$ fastboot flash recovery recovery.img
# Sending 'recovery' (16484 KB) OKAY [ 0.522s]
# Writing 'recovery' (bootloader) Image signed with key bad key
# OKAY [ 1.779s]
# Finished. Total time: 2.303s
# Used Magisk Manager to download Magisk as a zip file. Move the zip file to
# the un-encrypted SD card.
adb shell
cd sdcard/Download/
mv Magisk-v19.3\(19300\).zip /storage/04C7-5787/
cd /space/Android/e5play
fastboot flash recovery twrp_james.img
# Boot into TWRP recovery.
# Swipe to allow modifications.
# Mount Micro SD card (the un-encrypted SD card).
# Use TWRP to install /external_sd/Magisk-v19.
# Reboot system.
# Have root and updated system. Yeah!
# Remove un-encrypted SD card from phone and hide it from adversaries.

[HOW-TO] Flash A/B Treble GSI ROMs without TWRP

Android devices can have different designs, so there is no generic command or set of instructions for flashing a GSI to apply to all devices. Specially for Xperias am i writing this Guides for You. So please read carefully...
1. Ensure that You have the following before You start:
Latest Fastboot Version (Or the used fastboot commands may not work)
A Method for disabling Android Verified Boot (Part of the Guide)
An unlocked Bootloader State (Official Instructions HERE)
To Start:
Download the Basic Package from Google: https://developer.android.com/topic/generic-system-image/releases
Download the AOSP Vendor Package from Sony: https://developer.sony.com/develop/open-devices/downloads/software-binaries
Open up the Zip Files and place the 3 included Images on Your fastboot destination
Boot Your Device into Fastboot:
Code:
Turn off Your Device and hold VolumeUP while connecting via USB to a PC or use ADB to reboot to fastboot
Disable the verified booting (AVB) by flashing vbmeta.img:
Code:
fastboot --disable-verification flash vbmeta vbmeta.img
Flash the Vendor to the Primary A Slot OEM:
Code:
fastboot flash oem_a nameofthesonyoemimage.img
Repeat to flash to the B Slot OEM
Code:
fastboot flash oem_b nameofthesonyoemimage.img
Flash the GSI to the Primary A Slot System:
Code:
fastboot flash system_a system.img
Repeat to flash to the B Slot System
Code:
fastboot flash system_b system.img
Wipe the user data and clear the data from other necessary partitions (for example, user data and system partitions):
Code:
fastboot -w
Reboot:
Code:
fastboot reboot
Additional:
You can use any Android 9+ GSI out of the XDA Forum here: https://forum.xda-developers.com/project-treble/trebleenabled-device-development
To get Magisk/Root; just patch Your actual Kernel with the Magisk Manager App and flash the Boot Image together with the GSI (Example below)
Patched Boot Image for Xperia 5 Users: https://forum.xda-developers.com/xp...isk-v20-3-patched-boot-image-android-t4033547
How to force unlock bootloader?
On Sony XZ3 Unlocking Bootloader is not allowed.

How To Guide Guide to flash images in Linux

as we known, there's a famous tool called Tiny Script Tool to flash our custom systems. but i hate windows, is there a way to flash images in linux? at lease in linux there's no driver needs to all adb devices, thats perfect!
this guid will led you to do it in linux.
as Moto edge s is a dynamic partition device, these options suite to all devices with super block.
maybe YOU HAVE TO USE ROOT OR SUDO TO ACCESS YOUR DEVICE. change to root user if you can't access your device in linux.
# automatic tool:
i've wrote it as a script tool, see https://github.com/superiums/TrinyFlashScript
# manually steps:
## 刷机步骤
1. 备份app
Bash:
#!/bin/bash
backdirs='/dev/shm/app_backup/'
if [ ! -d "$backdirs" ]; then
mkdir $backdirs
fi
# user 0
backdir='/dev/shm/app_backup/0/'
if [ ! -d "$backdir" ]; then
mkdir $backdir
fi
adb shell pm list packages --user 0 -3 -f |awk '{ORS="\n";sub(/package:/,"adb pull ");sub(/apk=/,"apk '$backdir'");print($0".apk;");print("")}' >$backdir'dolist.sh'
sh $backdir'dolist.sh'
# ----------back app for user 10, if you have insular installed in your phone, this is needed!!! ********otherwise, skip.*******
backdir='/dev/shm/app_backup/10/'
if [ ! -d "$backdir" ]; then
mkdir $backdir
fi
adb shell pm list packages --user 10 -3 -f |awk '{ORS="\n";sub(/package:/,"adb pull ");sub(/apk=/,"apk '$backdir'");print($0".apk;");print("")}' >$backdir'dolist.sh'
sh $backdir'dolist.sh'
# ---------------------------------------------------------------------------------------------------------------------
2. 备份数据
Bash:
adb pull /sdcard/Downlad .
3. 重启到fastboot模式,刷写非动态分区
> **非动态分区包括**:
>
> - vbmeta
> - vbmeta_system
> - boot
> - vendor_boot
> - dtbo
Bash:
adb reboot bootloader
# 或 volumne- & power 开机
# 验证是否fastbootd模式
fastboot getvar is-userspace
# 应返回 no
fastboot flash [partition][_slot] [image]
# clear userdata and meta
fastboot -w
4. 重启到fastbootd模式,刷新动态分区
> **super分区包括**:
>
> - system
> - system_ext
> - vendor
> - product
Bash:
fastboot reboot fastboot
# 验证是否fastbootd模式
fastboot getvar is-userspace
# 应返回 yes
fastboot flash [partition][_slot] [image]
6. 双清
Bash:
fastboot erase userdata
#或
fastboot -w
#完成,重启到新系统
fastboot reboot
7. 设置系统
Bash:
#-------------for chinese users only, because they are blocked by the GFW and not able to connect to google.--------------
#Android 7及之后的版本输入如下两个命令,设置网络检测地址:
adb shell settings put global captive_portal_http_url http://www.google.cn/generate_204
adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204
#可以输入如下命令, 禁止检测网络连接状态.
adb shell settings put global captive_portal_detection_enabled 0
#---------------------------------
#---------- if you are concern to your private data, this is usefull.
#强制开启分区存储
adb shell sm set-isolated-storage on
9. 恢复软件及数据
Bash:
cd 0
ls -1 *.apk | xargs -ti -n 1 adb install --user 0 {}
#------------- after install insular--------------------
cd 10
ls -1 *.apk | xargs -ti -n 1 adb install --user 10 {}
adb push ./Downloads/* /sdcard/Downloads/
hopes this help.
the insular mentioned above is this package: com.oasisfeng.island.fdroid.apk
which will create sperate user space for your storage , called "work profile".
if you bricked your device, try these options:
(Every flash lover should backup a stock image for future!)
RSA solution, flash back to stock firmware. follow Skip to content for windows, follow these commands for Linux:
Bash:
command
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash vbmeta_system vbmeta_system.img
fastboot flash vbmeta vbmeta.img
fastboot flash radio radio.img
fastboot flash bluetooth BTFM.bin
fastboot flash dsp dspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash vendor_boot vendor_boot.img
fastboot flash dtbo dtbo.img
fastboot flash super super.img_sparsechunk.0
fastboot flash super super.img_sparsechunk.1
fastboot flash super super.img_sparsechunk.2
fastboot flash super super.img_sparsechunk.3
fastboot flash super super.img_sparsechunk.4
fastboot flash super super.img_sparsechunk.5
fastboot flash super super.img_sparsechunk.6
fastboot flash super super.img_sparsechunk.7
fastboot flash super super.img_sparsechunk.8
fastboot flash super super.img_sparsechunk.9
fastboot erase userdata
fastboot erase ddr
fastboot oem fb_mode_clear
fastboot reboot
Blank Flash, both windows and linux tools and image contained.
download stock firmware for motorola edge s (nio, XT2125) here: https://mirrors.lolinet.com/firmwar...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
download blankFlash tool here:
https://mirrors.lolinet.com/firmware/motorola/nio/blankflash/blankflash_nio_RRTS31.Q1-84-24-3-6.zip
MSM Xextend is very powerfull, so many custom settings, love and great appreciate !
I've wrote a automatic script tool for this, see
https://github.com/superiums/TrinyFlashScript

Categories

Resources