Hello
I want to know when we extract payload
Then its have img files like this
System
System_ext
Vendor
Product
So my question is it this possible to unpack modify and repack and flash back?
Is there any window or linux tool?
Or easy way to done my jon?
Thanks
Not possible?
Google search "repack payload.bin" to start with....
TheGhost1951 said:
Google search "repack payload.bin" to start with....
Click to expand...
Click to collapse
Ahh i think i never explain it very well but let me tell
I dont need to repack as payload.bin
I need to unpack vendor and system to modify and repack
Then Google "unpack repack .img file"....
Maybe something like this?
Editing system.img inside super.img and flashing our modifications
I'm trying to modify my system.img (/system/build.prop) to include support for multi users. After struggling a lot, I've succeeded following your guide (that's an awesome work btw) to unpack, mount, modify, umount and repack super.img. Then...
forum.xda-developers.com
from oxygen 12 oneplus uses the EROFS
[GUIDE] Universal guide for making your partitions inside super read-writable again.
Disclaimer: I'm not responsible for any result of these operations. Please be careful and well prepared. Always have your important data backed up safely on other place. Hello everyone! As far as 2022 and Xiaomi gets their new phones updated...
forum.xda-developers.com
ChrisFeiveel84 said:
from oxygen 12 oneplus uses the EROFS
[GUIDE] Universal guide for making your partitions inside super read-writable again.
Disclaimer: I'm not responsible for any result of these operations. Please be careful and well prepared. Always have your important data backed up safely on other place. Hello everyone! As far as 2022 and Xiaomi gets their new phones updated...
forum.xda-developers.com
Click to expand...
Click to collapse
getting error already tired this
Mr Hassan said:
getting error already tired this
Click to expand...
Click to collapse
You have used the super Partition or the images from the payload.bin ?
ChrisFeiveel84 said:
You have used the super Partition or the images from the payload.bin ?
Click to expand...
Click to collapse
Ofcourse backup super part
But in payload its not super
Its all one by one like system
System_ext vendor odm
So backup make its whole super.img
I already make details thread about this
But not get any help
Mr Hassan said:
Ofcourse backup super part
But in payload its not super
Its all one by one like system
System_ext vendor odm
So backup make its whole super.img
I already make details thread about this
But not get any help
Click to expand...
Click to collapse
From oos 11 or oos 12 ?
ChrisFeiveel84 said:
From oos 11 or oos 12 ?
Click to expand...
Click to collapse
Bro os12
even not able to convert in raw
simg2img.exe super.img super.raw
Invalid sparse file format at header magic
Failed to read sparse file
Related
Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research about modifying your android system before flashing this!
* YOU are choosing to make these modifications, and if you point the finger at
* me for messing up your device, I will laugh at you. Hard. A lot.
*/
(if you expected the Resident Evil references to stop, you just got gnomed)
What is this?
T-Virus (for treble-virus) is a tool that takes a stock Nokia 8 firmware and "infects" it with various parts from the Nokia 8 Sirocco firmware, generating a firmware bundle that is compilant with Project Treble and that can be flashed to a Nokia 8 using NOST.
Firmware Sources
The base of T-Virus is the stock Nokia 8 firmware image (5150 / April Security patch at the time of writing). When being run, the build script takes those files and replaces the partition table with the one from Nokia 8 Sirocco. This required for creating a vendor partition that the stock Nokia 8 does not have. The vendor image is taken from the Sirocco firmware as well. During the build, the vendor image is mounted as rw, and various files are copied over from the stock Nokia 8 system image, or get patched to properly support the minor hardware differences between the two phones. Those actions are defined through very basic scripts inside of the vendor folder in the repository.
The boot image is a modified version of my umbrella kernel, which has support for early mounting vendor. It also includes a TWRP build with full support for Project Treble.
SELinux Hell
Because Android does some very weird stuff with SELinux contexts, you cannot launch a service file when it has an unknown context. We have to fix that by force-setting the SELinux context manually, but due to how SELinux works, this is only possible on a Linux system without SELinux. This means, that you cannot build this on a distribution with SELinux (Fedora in my case). I fixed the problem by building the images in a Ubuntu VM.
How to build?
First you have to download the latest firmware image from https://tmsp.io/fs/xda/nb1/firmware, and the exdupe tool from https://www.quicklz.com/exdupe
Extract the firmware into a folder and then clone the repository, like this:
Code:
$ mkdir firmware
$ ./exdupe -R ~/Downloads/NB1-5150-0-00WW-B03.qlz firmware/
$ git clone https://github.com/resident-nokia/t-virus
$ cd t-virus
The build script has two options you have to set: a version and the path to the extracted firmware. This means you have to run it like this:
Code:
$ ./build.sh --version v0.1 --firmware ../firmware
Leave it running and when it asks you, enter your sudo password. This is required to mount the Android ext4 partitions and edit the files that are only accessable by the (Android) root user, and retain their permissions.
When the script has finished the flashable firmware image will be inside of the out folder. You can optionally package this as a .qlz file again using exdupe.
What works?
It boots
Data decryption in recovery
Flashing GSIs / OpenGApps in recovery
WiFi
Mobile Data
Bluetooth
Sound
Vibration
Calling
Hardware buttons
Fingerprint
Camera
GPS
NFC
SDCard
Multi SIM
4k Video
What doesn't work, or isn't tested
Haptic feedback for Hardware buttons
Bluetooth headphones don't get registered properly
Nokia OZO audio support is missing
Fingerprint sensor is reported as being on the back of the phone
There might be issues with USB transfer under Windows
VoLTE (untested)
How to install?
WARNING: This might not be useable as a daily driver. Continue only if you are able to troubleshoot things if neccessary (bootloops, bricking the phone, causing the alarm app to declare nuclear war)
You can download the latest release from the releases page on the repository. It is a .qlz firmware, so you will have to flash it through NOST. You will need a completely unlocked bootloader. When flashing, make sure to select the "Erase Userdata" option, not doing this will most certainly bootloop the phone.
After the installation completed, your phone will reboot into phh's AOSP GSI. If you want to use a different GSI (you most likely will), follow these steps:
Download your favorite GSI
Unpack every form of compression, so you end up with a .img file
Boot into recovery
Copy the .img to the internal storage of your phone, or to your SDCard
Select "Install" -> "Install .img", select the image file you copied and flash it to your system partition
Then install OpenGApps or any other modifications you like.
Wipe /data to allow the new system image to boot properly and then reboot
To update to a newer version without having to erase userdata, download the zipped vendor image from the release page, and flash the image inside in TWRP.
If you want to go back to stock, simply download the 5150-revert firmware and flash it with NOST, with the "Erase Userdata" option enabled. It will revert all changes T-Virus made to your phone. Firmwares from https://tmsp.io/fs/xda/nb1 will not work.
Links?
Repository: https://github.com/resident-nokia/t-virus
Download: https://github.com/resident-nokia/t-virus/releases
Reverting to stock: https://github.com/resident-nokia/t-virus/releases/tag/5150-revert
What if I have a bug?
Upload a proper bugreport. This means logcat and dmesg. If you don't know how to get them, google it. Also, describe the issue and provide steps to replicate it. Everything else will be ignored.
I don't daily drive this phone anymore. I am doing this just because it is an interesting technical challenge. I don't have as much motivation to fix bugs than someone who daily drives it.
I want to say thank you!
I usually don't do this, but since this involved a lot of work on my side, I would be grateful if you would want to say thank you by buying me a coffee (or two): https://paypal.me/thmsp
Ok. After the flashing we have a phone "infected" by the Project Treble. But what it gives to end-user? What is profit of this?
kosmatyj said:
Ok. After the flashing we have a phone "infected" by the Project Treble. But what it gives to end-user? What is profit of this?
Click to expand...
Click to collapse
The ability to install GSIs (Generic System Images). Basically everything from here: https://forum.xda-developers.com/project-treble/trebleenabled-device-development
Oh! Sounds pretty good! Thanks. Will think about it. Really expands posiibilities and needs to be tested.
---------- Post added at 10:54 ---------- Previous post was at 10:29 ----------
Q: Should Ihave an Android Pie be installed first or it can be flashed over ony ROM version (I currently have Nougat ROM installerd on my Nokia 8)?
kosmatyj said:
Q: Should Ihave an Android Pie be installed first or it can be flashed over ony ROM version (I currently have Nougat ROM installerd on my Nokia 8)?
Click to expand...
Click to collapse
It could work, since it is a modified firmware for reflashing, but just to be sure, update to Pie through OTA. That's what this has been tested with and you won't update your bootloader in the process which eliminates some possible incompatibilities.
What is password for t-virus-20190703.qlz? Should I flash the TV-20190703-vendor.zip before or t-virus-20190703.qlz is all I need?
kosmatyj said:
What is password for t-virus-20190703.qlz? Should I flash the TV-20190703-vendor.zip before or t-virus-20190703.qlz is all I need?
Click to expand...
Click to collapse
It's all in the instructions. There is no password on the qlz file. You can't extract it, you have to flash it using NOST. The zip is for updating from previous versions and not for the initial installation.
Oh, I understood. No need to unpack, just download and flash over NOST, right? Thanks ones more. It is new for me, that`s why I have so much questions.
kosmatyj said:
Oh, I understood. No need to unpack, just download and flash over NOST, right? Thanks ones more. It is new for me, that`s why I have so much questions.
Click to expand...
Click to collapse
Yes. Just follow the instructions in NOST and select the T-Virus .qlz when it asks you to. Also, make sure you select the "Erase Userdata" option in the drop down menu that appears after selecting the .qlz.
Thank you for this - hope you enjoy the couple of coffee's
Amazing work. Can the current Android Q GSI be used?
comatrices said:
Amazing work. Can the current Android Q GSI be used?
Click to expand...
Click to collapse
When I tried it it didn't boot. Your mileage may vary, but you probably have to wait until the source code for Q has been published and people can build real phh GSIs from it.
Hello! Author, don`t you planning to build the same but for Android 8.1? Your work is great anyway but would be just amazing to have an Oreo in this appearance. Thank you.
kosmatyj said:
Hello! Author, don`t you planning to build the same but for Android 8.1? Your work is great anyway but would be just amazing to have an Oreo in this appearance. Thank you.
Click to expand...
Click to collapse
Just flash an Oreo GSI? I know you can run Pie GSIs on Oreos vendor, so it should work fine the other way around.
Nah! Didn`t work. After "android" logo it drops into download mode. AOSP 32 (last version of A 8.1 GSI).
kosmatyj said:
Nah! Didn`t work. After "android" logo it drops into download mode. AOSP 32 (last version of A 8.1 GSI).
Click to expand...
Click to collapse
I am not exactly sure if I understand you correctly, but Nokia 8 is not an A-only device, it is an AB device. You need to flash the AB image of AOSP, not the A one.
Right, I did exactly like you said. system-arm64-ab-vanilla-nosu - image that I flashed couple minutes ago. Downloaded from here: https://github.com/phhusson/treble_experimentations/releases/tag/v32
I`m sorry about my English. I`m Russian.
kosmatyj said:
Right, I did exactly like you said. system-arm64-ab-vanilla-nosu - image that I flashed couple minutes ago. Downloaded from here: https://github.com/phhusson/treble_experimentations/releases/tag/v32
I`m sorry about my English. I`m Russian.
Click to expand...
Click to collapse
Ok, then it probably doesn't work the other way around (Oreo with Pie vendor). An Oreo-based T-Virus is unlikely to happen though, because Siroccos Oreo vendor has some problems (calls not going through properly), and I dont want to maintain two versions of it because, as said in the OP, I don't use my Nokia 8 anymore. It seems like Pie is all you can get with this for now, sorry.
Hi all. Just to make it clear. The procedure for the Nokia 8 is:
1. Unlock Bootloader
2. Do "critical unlock" (fastboot flashing unlock_critical)
3. Flash "t-virus-20190703.qlz" with NOST?
Did i miss something? Whats with Security Enabled Linux?
just4me12 said:
Hi all. Just to make it clear. The procedure for the Nokia 8 is:
1. Unlock Bootloader
2. Do "critical unlock" (fastboot flashing unlock_critical)
3. Flash "t-virus-20190703.qlz" with NOST?
Did i missed something? Whats with Security Enabled Linux?
Click to expand...
Click to collapse
That's right. Don't forget to add "erase data" option while flashing t virus with NOST otherwise you'll end up in a bootloop.
Hi everyone,
I been trying to edit, unpack and repack vendor.img and vbmeta.img (or make a new one) but having trouble making the changes. After some hours of Googling, I was able to mount vendor.img in Ubuntu but it was mount in a read only state and as not being the owner I was unable to make changes.
I am attempting to enable my phone to work in China. The files exist on the phone but are not being pointed to by vendor/.../mbn_sw.txt
There doesn't seem to be any good guides for packing and unpacking these image files. I don't mind what OS I must use to do so just would like to figure this out.
Thanks in advance!
jkoch3 said:
Hi everyone,
I been trying to edit, unpack and repack vendor.img and vbmeta.img (or make a new one) but having trouble making the changes. After some hours of Googling, I was able to mount vendor.img in Ubuntu but it was mount in a read only state and as not being the owner I was unable to make changes.
I am attempting to enable my phone to work in China. The files exist on the phone but are not being pointed to by vendor/.../mbn_sw.txt
There doesn't seem to be any good guides for packing and unpacking these image files. I don't mind what OS I must use to do so just would like to figure this out.
Thanks in advance!
Click to expand...
Click to collapse
Got solution?
Hello fellas,
I would like to inscrease the system partition size so i can be able to flash some gsi roms that are larger than my device's system partiton, sush as pixel experience 11 gsi rom.
I know there is way using parted and gdisk but i'm not really familiar with linux and i'm afraid i can do something stupid and brick my device.
Does anyone with knowledge could please make a detailed tutoral teaching how to to that? 4 gb is a new good size for it. Thanks in advance, cheers.
my device is ARM64 AB Motorola Moto G8 Plus 3gb system partition
daniel_lvs said:
Hello fellas,
I would like to inscrease the system partition size so i can be able to flash some gsi roms that are larger than my device's system partiton, sush as pixel experience 11 gsi rom.
I know there is way using parted and gdisk but i'm not really familiar with linux and i'm afraid i can do something stupid and brick my device.
Does anyone with knowledge could please make a detailed tutoral teaching how to to that? 4 gb is a new good size for it. Thanks in advance, cheers.
my device is ARM64 AB Motorola Moto G8 Plus 3gb system partition
Click to expand...
Click to collapse
Your best bet is to flash product partition with a blank image and then to extend the system partition to occupy the new free space
thanks for your reply. I'll look forward to it.
daniel_lvs said:
thanks for your reply. I'll look forward to it.
Click to expand...
Click to collapse
I know the fastboot commands on how to resize system partition on dynamic partition devices, so, I'll post them below,( I don't know the commands for devices with non-dynamic partitions....)
fastboot flash product product.img
fastboot erase system
fastboot resize-logical-partition system 3940000000 (if this number doesn't work, decrease it slowly until it says successful) (also, keep in mind that you have to use the latest platform tools from Google for these to work)
daniel_lvs said:
thanks for your reply. I'll look forward to it.
Click to expand...
Click to collapse
And also, grab a blank product.img from Google, it'll work...
thanks man! when you say flash product product.img, you mean the blankflash.we can download from here? https://mirrors.lolinet.com/firmware/motorola/doha/blankflash/
After i extract the .rar file, one of the files i get is singleimage.bin. Is that the file you mean to flash on fastboot flash product product.img ?
thanks again!
daniel_lvs said:
thanks man! when you say flash product product.img, you mean the blankflash.we can download from here? https://mirrors.lolinet.com/firmware/motorola/doha/blankflash/
After i extract the .rar file, one of the files i get is singleimage.bin. Is that the file you mean to flash on fastboot flash product product.img ?
thanks again!
Click to expand...
Click to collapse
I just get them usually from aosp website, wait I'll attach one here that I have
daniel_lvs said:
thanks man! when you say flash product product.img, you mean the blankflash.we can download from here? https://mirrors.lolinet.com/firmware/motorola/doha/blankflash/
After i extract the .rar file, one of the files i get is singleimage.bin. Is that the file you mean to flash on fastboot flash product product.img ?
thanks again!
Click to expand...
Click to collapse
fastboot delete-logical-partition product_#
Actually try this and replace hash with a or b and then try flashing gsi
This apparently works for moto devices
Blank product.img
i'll try that tonight, thank you for the support and tips. cheers!
daniel_lvs said:
i'll try that tonight, thank you for the support and tips. cheers!
Click to expand...
Click to collapse
Your welcome! (I'm actually happy that you're actively replying, that's quite rare on posts that went unanswered for a long while)
P.S: please make sure to keep a copy of stock rom in hand just in case something goes wrong before trying any of these...
Hausemaster said:
Your welcome! (I'm actually happy that you're actively replying, that's quite rare on posts that went unanswered for a long while)
P.S: please make sure to keep a copy of stock rom in hand just in case something goes wrong before trying any of these...
Click to expand...
Click to collapse
My product partition size is 181 MB, so this can't be helped. Anyway, Is there a way to extend system partition like an AROMA script?
Hello have a Samsung SM-X200 with a small system partition size.
Any tips for Samsung users to resize?
Hello, this sounds a little bit impossible but i made some progress with my friend. We made a vendor partition, edited the TWRP but we stuck at the part of making a vendor. Can the g4 community do it? I think you can, especially @steadfasterX. UsU, FWUL and SALT were masterpieces.
Also, it looks so hard. Because there is no phone with S808 and A9.
If you need to know how did i made the vendor partiton, i can help.
I use H815TR UsU'd. If that helps.
You should describe much more detailed what you did and what problems you have after that.
steadfasterX said:
You should describe much more detailed what you did and what problems you have after that.
Click to expand...
Click to collapse
First i put the parted file on the phone and run it via terminal in TWRP.
cp /sdcard/parted /sbin/ && chmod 755 /sbin/parted was the command i used.
Second, i unmounted every partition and wrote the command: parted /dev/block/mmcblk0
After, I wrote p to see what number was my userdata (it was 50) and i wrote rm 50.
After i deleted the userdata, i wrote
mkpart userdata ext4 6359MB 30GB
mkpart vendor ext4 30GB 31.3GB
to make a vendor partiton.
Finally, i did a format data and @MeizuM6T edited the TWRP.
I did everything with @MeizuM6T .
Now i need vendor files.
The easiest way is to simply copy /system/vendor from an existing ROM tbh.
steadfasterX said:
The easiest way is to simply copy /system/vendor from an existing ROM tbh.
Click to expand...
Click to collapse
Most roms contain system-as root, obviously this is where @Emo19 and me get stuck.
Would connecting the vendor via FSTAB be enough to boot?
MeizuM6T said:
Most roms contain system-as root, obviously this is where @Emo19 and me get stuck.
Would connecting the vendor via FSTAB be enough to boot?
Click to expand...
Click to collapse
Well then i don't get the problem.
We mimic a vendor partition since (iirc) pie and to follow android standards we already moved everything needed to /system/vendor including config updates where needed pointing to /vendor. I would say 98% of this move is done already for the rest see e.g: https://github.com/LGgFour/android_device_lge_g4-common/search?q=System/vendor
Ofc currently /vendor is just a symlink to /system/vendor but for the system it feels like it has a separate vendor partition already.
So my guess was you just copy everything from /system/vendor and put that in your /vendor partition and if we made everything right and you fix the rest of the few /system/vendor paths it should just boot. Ofc you would need to update fstab to point to the dedicated vendor partition then. Does that help?
steadfasterX said:
Well then i don't get the problem.
Click to expand...
Click to collapse
The vendor has successfully connected but the treble support is still not visible.
Vendor is connected to the system and is working now, how should we arrange for treble?
MeizuM6T said:
The vendor has successfully connected but the treble support is still not visible.
Vendor is connected to the system and is working now, how should we arrange for treble?
Click to expand...
Click to collapse
no idea really. I have never ported anything to treble. just the other way around
steadfasterX said:
no idea really. I have never ported anything to treble. just the other way around
Click to expand...
Click to collapse
Thanks, I think we need to write "ro.treble.enabled = true" via build.prop. then we will try to install some GSI Roms.
MeizuM6T said:
Thanks, I think we need to write "ro.treble.enabled = true" via build.prop. then we will try to install some GSI Roms.
Click to expand...
Click to collapse
well I dont think its THAT easy. I was serious about the other way around so take a look at what I did for another device:
https://code.binbash.rocks:8443/MVA-VoLTE/android_device_samsung_j5y17lte/commits/branch/eos-q/search?q=treble&all=true
https://code.binbash.rocks:8443/MVA-VoLTE/android_device_samsung_exynos7870-common/commit/ab2567dc82fbdb2a21aa3ea28572dd18e5b7fb79
https://code.binbash.rocks:8443/MVA-VoLTE/android_kernel_samsung_exynos7870/commit/b8e2cf570dfd383fb3a4497d6b53d51c9226ca7b
Ofc you would do the opposite then what the commits showing and ofc I dunno if thats enough and haven't checked what needs to be adapted etc but it should give you an idea
steadfasterX said:
well I dont think its THAT easy. I was serious about the other way around so take a look at what I did for another device:
Click to expand...
Click to collapse
I doubt it will open either, it shouldn't be that simple. I will look at what you have thrown
I downloaded a samsung galaxy s22 Odin firmware and unpacked the zip and the AP tar file and then I un lz4'd the super.img, unsparsed it and then I ran lpunpack on the unsparsed image to get unreadable images
Have you used one of the following?
Extract system.img,vendor.img and product.img from super.img
After lots of search i found a way to extract those img file from super.img What is need? 1.Computer with linux os. extract zip file from this post and place your super.img in same location where you extract.. then run below cmd... simg2img...
forum.xda-developers.com
super_img_lpmake_lpunpack.zip | by MrWaehere for Utilities
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
androidfilehost.com
ze7zez said:
Have you used one of the following?
Extract system.img,vendor.img and product.img from super.img
After lots of search i found a way to extract those img file from super.img What is need? 1.Computer with linux os. extract zip file from this post and place your super.img in same location where you extract.. then run below cmd... simg2img...
forum.xda-developers.com
super_img_lpmake_lpunpack.zip | by MrWaehere for Utilities
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
androidfilehost.com
Click to expand...
Click to collapse
I have. I can get system.img out but I can't open it. I think it's a f2fs partition but I haven't found any tools that can extract files from it
It seems on newer firmware this method of unpacking and extracting system.img out of super.img no longer works. It seems now that when you extract system.img from super.img.raw it gives you a file that reads just as data and does not have the ext4 filesystem magic header bytes.
Have uploaded two screenshots to show how super.img.raw looks and how system.img looks after extraction from super.img. Any thoughts on this?
This firmware is being pulled from latest tar files for SM-S901U
Update, am working on a way and almost got it now. Will probably create a post on this once done and link from here. If you dont hear back from me, i failed. :'(
UPDATE: had some luck following this guys tutorial although a little different was able to extract files. Still cant mount but much closer. Device is f2fs file system. The reason it's not working is most methods on xda are for ext4
How to Extract F2FS Image from Android Device Flash - Baremetallics
How to Extract F2FS Image from Android Device Flash
baremetallics.com
kalexander7 said:
Update, am working on a way and almost got it now. Will probably create a post on this once done and link from here. If you dont hear back from me, i failed. :'(
UPDATE: had some luck following this guys tutorial although a little different was able to extract files. Still cant mount but much closer. Device is f2fs file system. The reason it's not working is most methods on xda are for ext4
How to Extract F2FS Image from Android Device Flash - Baremetallics
How to Extract F2FS Image from Android Device Flash
baremetallics.com
Click to expand...
Click to collapse
Is this also work for other's like erofs?
Mr Hassan said:
Is this also work for other's like erofs?
Click to expand...
Click to collapse
I doubt it although it may be alike using same linux tools like fsck. Erm I'm still stuck on trying to get this f2fs image too mount. It seems corrupt and although I was able to extract libs and apks they're coming out corrupted. Anyone in the community have any knowledge in this area?
kalexander7 said:
I doubt it although it may be alike using same linux tools like fsck. Erm I'm still stuck on trying to get this f2fs image too mount. It seems corrupt and although I was able to extract libs and apks they're coming out corrupted. Anyone in the community have any knowledge in this area?
Click to expand...
Click to collapse
Bro samsung have many dev's to mount fsf2 and already many dude done
The erofs not possible
Mr Hassan said:
Bro samsung have many dev's to mount fsf2 and already many dude done
The **** is erofs
Click to expand...
Click to collapse
what?