VoLte Patch - Xiaomi Redmi 8A Questions & Answers

I just Made Vo patch From My Stock Redmi 8a , for GSi Roms , just Somebody Try Who Using GSi . Then Say Does This Working or Not
#backup everything before doing this

I have 7A with the same CPU ... i'm dev and I know what I do . You make simple script :
Code:
ui_print("volte patch redmi 8a");
ui_print("test #1");
ui_print("by Vinay Durva");
ui_print("Mounting system and vendor...");
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/vendor", "/vendor");
ui_print("Extracting Files...");
package_extract_dir("system", "/system");
ui_print("Unmounting system and vendor...");
unmount("/system");
show_progress(0.2, 10);
Where is chmod ???? If you don't add chmod's system have 3 options: 1.Not boot 2.Bootloop 3.total crash
I make patche's to some system's variants and my script maybe help you some :
Code:
ui_print("------------HALF GSI PATCHER-------------");
ui_print("------------XDA: MAREK10747--------------");
ui_print("------------Installing Updates-----------");
ui_print("------------Mounting System--------------");
run_program("/sbin/busybox", "mount", "/system");
ui_print("------------Updating system-----------");
ui_print("-----------------------------------------");
ui_print("------------Deleting files---------------");
ui_print("-------Deleting app and priv-app---------");
delete_recursive("/system/app");
delete_recursive("/system/priv-app");
delete_recursive("/system/framework");
ui_print("---------Repleacing build.prop-----------");
ui_print("-----------------------------------------");
ui_print("----Extracting and Installing updates----");
ui_print("-----------------------------------------");
ui_print("--------Extracting deodexed files--------");
ui_print("-----------------------------------------");
package_extract_dir("system", "/system");
ui_print("-----------------------------------------");
ui_print("------------Setting Permissions----------");
ui_print("-----------------------------------------");
ui_print(" Restoreing Permissions for deodexed files");
set_metadata_recursive("/system/framework", "uid", 0, "gid", 0, "dmode", 0777, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/app", "uid", 0, "gid", 2000, "dmode", 0777, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/priv-app", "uid", 0, "gid", 2000, "dmode", 0777, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/build.prop", "uid", 0, "gid", 0, "dmode", 0777, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
ui_print("-----------------------------------------");
ui_print(" Updates and deodex installed sucess !! ");
ui_print("-----------------------------------------");
ui_print("-----------------------------------------");
ui_print("----------------Please wipe--------------");
ui_print("-------------cache and dalvik------------");
ui_print("------------and reboot device ;)---------");
ui_print("-----------------------------------------");
ui_print("-------------Unmounting System-----------");
unmount("/system");
Please add chmod if your patch must work without any bugs or bricks . My script is for you only sample for do that correct . If you have problem's with do a correct zip write to me pm .

Related

[Q] forcing a cwm zip rom file to skip modem flashing

i want to install RGUI rom but i need it to skip the modem flashing so my current modem will remain untouched
when i flashed Omega for example i just deleted the modem.bin file from inside the zip file and the installation completed anyway
i tried the same method on RGUI but when it got to the modem installlation i get some error "assert extracting failed modem.bin" or something and then i get installation aborted
how can i make it skip the modem.bin installation ? do i need to edit updater-script inside meta-inf ?
AzurA86 said:
do i need to edit updater-script inside meta-inf ?
Click to expand...
Click to collapse
Yes
qwerty12 said:
Yes
Click to expand...
Click to collapse
thanks for replying
what do i need to delete from it ?
this is whats inside the updater-script file
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print("************************************************");
ui_print(" RGUI S3 ICS DEVELOPMENT ");
ui_print(" http://forum.xda-developers.com ");
ui_print("************************************************");
ui_print("* Phone : SAMSUNG GALAXY S III *");
ui_print("* MIUI VERSION : 2.9.28 *");
ui_print("* RGUI VERSION : V12 *");
ui_print("* Developed By : gh.rohit *");
ui_print("************************************************");
show_progress(0.500000, 0);
ui_print("Formatting system...");
unmount("/system");
format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0");
ui_print("Installing system files...");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_dir("system", "/system");
ui_print("Creating system links...");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("debuggerd", "/system/bin/csview");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chmod",
"/system/bin/chown", "/system/bin/cmp", "/system/bin/date",
"/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
"/system/bin/getevent", "/system/bin/getprop", "/system/bin/hd",
"/system/bin/id", "/system/bin/ifconfig", "/system/bin/iftop",
"/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",
"/system/bin/kill", "/system/bin/ln", "/system/bin/log",
"/system/bin/ls", "/system/bin/lsmod", "/system/bin/lsof",
"/system/bin/mkdir", "/system/bin/mount", "/system/bin/mv",
"/system/bin/nandread", "/system/bin/netstat",
"/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
"/system/bin/ps", "/system/bin/reboot", "/system/bin/renice",
"/system/bin/rm", "/system/bin/rmdir", "/system/bin/rmmod",
"/system/bin/route", "/system/bin/schedtop", "/system/bin/sendevent",
"/system/bin/setconsole", "/system/bin/setprop", "/system/bin/sleep",
"/system/bin/smd", "/system/bin/start", "/system/bin/stop",
"/system/bin/sync", "/system/bin/top", "/system/bin/touch",
"/system/bin/umount", "/system/bin/uptime", "/system/bin/vmstat",
"/system/bin/watchprops",
"/system/bin/wipe");
ui_print("Set permission...");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm_recursive(0, 0, 0777, 0777, "/system/etc/init.d");
set_perm_recursive(0, 0, 0711, 0644, "/system/bin/.ext");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 0, 0644, "/system/vendor/lib/drm/libdrmwvmplugin.so");
set_perm(0, 0, 0644, "/system/vendor/lib/libwvm.so");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/left_eye-y0-yi45-p0-pi45-r0-ri20.2d_n2/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/left_eye-y0-yi45-p0-pi45-rn7-ri20.2d_n2/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/left_eye-y0-yi45-p0-pi45-rp7-ri20.2d_n2/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/nose_base-y0-yi45-p0-pi45-r0-ri20.2d_n2/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/nose_base-y0-yi45-p0-pi45-rn7-ri20.2d_n2/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/nose_base-y0-yi45-p0-pi45-rp7-ri20.2d_n2/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/right_eye-y0-yi45-p0-pi45-r0-ri20.2d_n2/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/right_eye-y0-yi45-p0-pi45-rn7-ri20.2d_n2/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/right_eye-y0-yi45-p0-pi45-rp7-ri20.2d_n2/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/yaw_roll_face_detectors.3/head-y0-yi45-p0-pi45-r0-ri30.4a/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/yaw_roll_face_detectors.3/head-y0-yi45-p0-pi45-rn30-ri30.5/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/detection/yaw_roll_face_detectors.3/head-y0-yi45-p0-pi45-rp30-ri30.5/full_model.bin");
set_perm(0, 0, 0644, "/system/vendor/pittpatt/models/recognition/face.face.y0-y0-22-b-N/full_model.bin");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/busybox");
set_perm(0, 2000, 06755, "/system/xbin/insecure");
set_perm(0, 0, 06755, "/system/xbin/invoke-as");
set_perm(0, 0, 06755, "/system/xbin/su");
ui_print("Update Boot image...");
show_progress(0.200000, 0);
show_progress(0.200000, 10);
package_extract_file("boot.img", "/dev/block/mmcblk0p5");
package_extract_file("flash_image", "/tmp/flash_image");
set_perm(0, 0, 0777, "/tmp/flash_image");
assert(package_extract_file("modem.bin", "/tmp/modem.bin"),
run_program("/tmp/flash_image", "/dev/block/mmcblk0p7", "/tmp/modem.bin"),
delete("/tmp/modem.bin"));
delete("/tmp/flash_image");
show_progress(0.100000, 0);
unmount("/system");
Removing this should be enough:
Code:
package_extract_file("flash_image", "/tmp/flash_image");
set_perm(0, 0, 0777, "/tmp/flash_image");
assert(package_extract_file("modem.bin", "/tmp/modem.bin"),
run_program("/tmp/flash_image", "/dev/block/mmcblk0p7", "/tmp/modem.bin"),
delete("/tmp/modem.bin"));
delete("/tmp/flash_image");
In addition, you can also remove the line "package_extract_file("boot.img", "/dev/block/mmcblk0p5");" if you don't want your kernel being replaced
thank you very much, il give it a try
i get an error when trying to flash it through cwm
e:error in /emmc/rgui_miui......zip (status 6)
installation aborted
Use an editor that understands UNIX line endings like Notepad2, not Wordpad or Windows Notepad
qwerty12 said:
Use an editor that understands UNIX line endings like Notepad2, not Wordpad or Windows Notepad
Click to expand...
Click to collapse
ah alright
now its working flawlessly thank you for your help !
Just replace the modem in the zip file with the one you want .
Then flash .
jje
i could do that but the last time i touched my modem my SN ressetted and could only be repaired with NSPRO
and reverting back to my original modem didnt work
since then ive decided to just avoid from changing my current modem.

[Q] extract file to sdcard with updater-script

Hi
I'm trying to extract some files and folders into the internal sdcard from recovery.
To start I inserted in the updater-script something like that:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data");
package_extract_file("data/tool.zip", "/data/media/0/tool.zip");
set_perm(0, 0, 0777, "/data/media/0/tool.zip");
but what I get it's a tool.zip file in internal sdcard of 0 byte that I cannot open or even delete.
How can I solve?
I'm on galaxy s5
intxeon said:
Hi
I'm trying to extract some files and folders into the internal sdcard from recovery.
To start I inserted in the updater-script something like that:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data");
package_extract_file("data/tool.zip", "/data/media/0/tool.zip");
set_perm(0, 0, 0777, "/data/media/0/tool.zip");
but what I get it's a tool.zip file in internal sdcard of 0 byte that I cannot open or even delete.
How can I solve?
I'm on galaxy s5
Click to expand...
Click to collapse
Try this instead of set_perm:
Code:
set_metadata("/data/media/0/tool.zip", "uid", 1023, "gid", 1023, "mode", 0777, "capabilities", 0x0, "selabel", "u:object_r:media_rw_data_file:s0");
_alexndr said:
Try this instead of set_perm:
Code:
set_metadata("/data/media/0/tool.zip", "uid", 1023, "gid", 1023, "mode", 0777, "capabilities", 0x0, "selabel", "u:object_r:media_rw_data_file:s0");
Click to expand...
Click to collapse
Yeah works well
I can use this string also to set permission on a folder?
Thank you
intxeon said:
Yeah works well
I can use this string also to set permission on a folder?
Thank you
Click to expand...
Click to collapse
Of course
But it's better idea to use set_metadata_recursive:
Code:
set_metadata_recursive("/data/media/0/folder_name", "uid", 1023, "gid", 1023, "dmode", 0777, "fmode", 0777, "capabilities", 0x0, "selabel", "u:object_r:media_rw_data_file:s0");
You can set permissions for folder and files inside by one command this way

[Q][SOLVED] Need some assistance with a broken edify script.

EDIT2: So it turns out that I'm an idiot, I hadn't noticed that the basketbuild GApps script I was using had been using the set_perm function rather than set_metadata, since set_perm no longer exists in the latest update-binary it kept failing. I'm solved.
I've been working on a script that takes an OTA zip file, adds GApps and some other modifications (including those to the updater-script) and then zips the ROM back up so that I could provide an easy OTA solution for my home devices that won't take me 45 minutes waiting on them to finish flashing. (in total, the script is supposed to cut down my update time by cutting out the copy/paste).
That part of my script seems to work perfectly, however update-binary throws a syntax error on the automatically compiled updater-script. Can anyone tell me what I'm doing wrong based on the update script below? I've wracked my brain for hours trying to figure out what's wrong here and have played around with line endings in case that was the cause but nothing.
Code:
assert(getprop("ro.product.device") == "x5" || getprop("ro.build.product") == "x5" || getprop("ro.product.device") == "ls740" || getprop("ro.build.product") == "ls740" || abort("This package is for device: x5,ls740; this device is " + getprop("ro.product.device") + "."););
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_dir("install", "/tmp/install");
set_metadata_recursive("/tmp/install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644);
set_metadata_recursive("/tmp/install/bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755);
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
mount("f2fs", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data", "");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/platform/msm_sdcc.1/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
show_progress(0.020000, 10);
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
show_progress(0.200000, 10);
ui_print("***********************************************");
ui_print(" Google Apps for Android 5.0");
ui_print("***********************************************");
ui_print("Installing files...");
run_program("/sbin/busybox", "mount", "/system");
show_progress(1, 15);
delete("/system/app/Provision.apk","/system/app/QuickSearchBox.apk","/system/app/priv-app/SetupWizard.apk","/system/app/priv-app/Velvet.apk","/system/app/Vending.apk","/system/app/BrowserProviderProxy.apk","/system/app/PartnerBookmarksProvider.apk");
package_extract_dir("system", "/system");
set_perm(0, 0, 0755, "/system/addon.d/70-gapps.sh");
package_extract_dir("optional", "/tmp");
package_extract_file("install-optional.sh", "/tmp/install-optional.sh");
set_perm(0, 0, 0777, "/tmp/install-optional.sh");
run_program("/tmp/install-optional.sh", "");
show_progress(1, 15);
ui_print("Cleaning up and setting metadata...");
set_metadata_recursive("/system/addon.d", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/app", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/priv-app", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/permissions", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/preferred-apps", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/g.prop", "uid", 0, "gid", 0, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/framework", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/lib", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/usr/srec/en-US", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/pittpatt", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Installation complete!");
The above only has one modification to it since I was toying around trying to fix this. The line break before the Google Apps was something I was inserting for a delineation of where the scripts combine at. That said, both ZIPs unmodified flash correctly and I have removed the signature from the ZIP file before re-compressing with modifications as well. I've written an edify script by hand before, but hadn't had this problem then, only when programatically creating an updater-script am I running into this.
EDIT: Sorry about the weird code block if you saw this before my update, that's what I get from copy/pasting from PuTTY.

[Developer Discussion] flashing vendor.img in cooked rom

Ok, so as there is no developer discussion thread in this forum, I thought I'd start a thread here.
Now with the Nexus 6P Google have changed things a bit from the Nexus 6. The vendor folder has been moved from /system/vendor to /vendor This poses a few issues with DEV's who are trying to build ROM's, On the Nexus 6 it was easy to include with the rom, you just simply added the symlink's and set_metadata tags in your updater-script.
Now that we have the vendor folder moved out of system and put into its own root partition, we have to do things a bit differently. The current method of thinking is to get users to flash the vendor.img separately using fastboot. This is not overly ideal as users do not always have access to a PC to flash the image using fastboot.
There are two ways I can see to include the vendor.img in a cooked ROM.
Solution #1 Extract the vendor image the same way as you do with the system.img and use package_extract_dir("vendor", "/vendor"); This does work, I have tested this. The problem is there are issues IE camera crashes etc. If you flash the vendor.img using fastboot, without making any other changes the camera works.
So I thought that dedicated symlink's and set_metadata tags would need to be added to the updater-script to set the permissions. Problem is, currently I do not know how to do this.
Solution #2 include the vendor.img in the ROM and use the updater-script to extract it during boot, theory is you do not need to then worry about creating the symlink's and set_metadata tags. So far I can not get the ROM to boot when I try this. So far I have tried:
format("ext4", "EMMC", "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor", "0", "/vendor");
mount("ext4", "EMMC", "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor", "/vendor");
package_extract_file("vendor.img", "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor");
I have also tried:
format("ext4", "EMMC", "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor", "0", "/vendor");
mount("ext4", "EMMC", "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor", "/vendor");
package_extract_file("vendor.img", "/dev/block/mmcblk0p37");
Neither of these two scripts work. Results in the phone stuck at Google screen, if I go into TWRP, I can't even mount the vendor partition. I have to flash the vendor.img via fastboot to fix it.
Pining some of the devs on the forum to see if we can try and get this issue resolved: @mrjaydee82 @zephiK @fhem @BeansTown106 @vomer
Reserved
On aosp roms we can just create a vendor. IMG and have it flash with the rom but it's cumbersome making a second proprietary vendor.. I have been debating taking the task and just doing it.
An easier way I think would be like you are saying just make a flashable of the vendor. IMG do we have access to any ota update.zips? I'm curious if they ship with a full vendor or are just patching the vendor
Sent from my Nexus 6P using Tapatalk
I haven't seen any ota's yet. I could downgrade my phone and see if I can get the ota. If anybody has it, would you mind positing a link here.? I would assume it would have to be included. The vendor folder has to match the ROM version, or you get system is corrupted message.
@BeansTown106 Hey got an updater-script from an OTA and found the following:
ui_print("Patching vendor image after verification.");
show_progress(0.100000, 0);
block_image_update("/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor", package_extract_file("vendor.transfer.list"), "vendor.new.dat", "vendor.patch.dat");
As you can see they are using block_image_update("/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor" so in theory package_extract_file("vendor.img", "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor"); should be working. I dont understand why it isnt!
Ok so I have gone down the route of using package_extract_dir("vendor", "/vendor"); this at least works and phone boots. I have noticed two problems with it so far.
1: If I try to un-install any app, the phone simply reboots.
2: Camera FC
I have started to create the metadata script for this and making good progress. I was wondering if somebody would mind having a look and seeing if I am missing anything.
Code:
ui_print(" ");
ui_print("Test Script");
assert(getprop("ro.product.device") == "angler" || getprop("ro.build.product") == "angler" ||
abort("This package is for "angler" devices; this is a "" + getprop("ro.product.device") + "".");
unmount("/system");
unmount("/data");
mount("ext4", "EMMC", "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor", "/vendor");
show_progress(0.500000, 0);
set_progress(0.05);
package_extract_dir("vendor", "/vendor");
ui_print("Setting metadata tags");
set_metadata_recursive("/vendor", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata("/vendor/app", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata("/vendor/app/ims", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata("/vendor/app/ims.apk", "uid", 0, "gid", 2000, "dmode", 0644, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata("/vendor/app/ims/lib", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/app/ims/lib/arm64", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/bin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/etc", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/firmware", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/lib", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/lib/egl", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/lib/hw/", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/lib/mediadrm", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/lib64", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/lib64/egl", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/lib64/hw/", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/lib64/mediadrm", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/lost+found", "uid", 0, "gid", 2000, "dmode", 0770, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/media", "uid", 0, "gid", 2000, "dmode", 0770, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata("/vendor/pittpatt", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata("/vendor/pittpatt/models", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata("/vendor/pittpatt/models/detection", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.8", "uid", 0, "gid", 2000, "dmode", 0770, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
set_metadata_recursive("/vendor/pittpatt/models/detection/yaw_roll_face_detectors.7.1", "uid", 0, "gid", 2000, "dmode", 0770, "fmode", 0644, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
unmount("/system");
ui_print("Test Completed");
ui_print(" ");
show_progress(1, 0);
Click to expand...
Click to collapse
I have uploaded a test script:
https://www.androidfilehost.com/?fid=24269982086995317
7a50ae497a676e5f075e65ef0e2bd52e
Note this will break functionality on your phone. Please only install if you are willing to help me get the vendor folder setup.
I am no developer but using flashify from the playstore to flash .img works great.
anglerstock said:
I am no developer but using flashify from the playstore to flash .img works great.
Click to expand...
Click to collapse
Do I flash it to boot or recovery with flashify?
holic_2 said:
Do I flash it to boot or recovery with flashify?
Click to expand...
Click to collapse
You flash vendor.img to the vendor partition. I do not think flashify flashes to that partition. The OP is trying to get the vendor.img to flash along with a ROM so it is easier on everyone.
nrage23 said:
You flash vendor.img to the vendor partition. I do not think flashify flashes to that partition. The OP is trying to get the vendor.img to flash along with a ROM so it is easier on everyone.
Click to expand...
Click to collapse
Yes this is exactly the idea. I am not looking for other ways to flash the vendor image, I am looking to include it into a cooked rom, so users don't have to flash it separately.
Stephen said:
Yes this is exactly the idea. I am not looking for other ways to flash the vendor image, I am looking to include it into a cooked rom, so users don't have to flash it separately.
Click to expand...
Click to collapse
i have successfully been able to trick my aosp environment into making a vendor image and vendor.dat by including all the files from the stock vendor in it. however no matter what time i include the files during the build.process it still overwrites the stock build.prop in the vendor.img and like 3 of the other proprietary files with source built versions. i do however have an idea how to solve this and should at least be able to make a flashable vendor zip for all of us. gonna play with it more tonight also flashing said zip retained permissions and worked fine but no matter what would give the vendor out of date error(manufacturer error) i also changed the text of this error to make it more descriptive on the end user https://github.com/PureNexus/android_frameworks_base/commit/6f98a63a83d01c88ddeaa3a6e86846eef8d36b6b
once i get this done, i know you want to include in your rom zip that should be fine just take the files from my zip and the extraction part of the script and add to yours
ok figured out the vendor build.prop issue, now i just need to get it to stop building drmclearkeyplugin.so and libbt-vendor.so and i will have a 100% flashable stock vendor.img
got it will be uploading shortly :good:
BeansTown106 said:
got it will be uploading shortly :good:
Click to expand...
Click to collapse
Beans:laugh::laugh: You are definately the best:good::good::good: You think the same approach will work on the N9??
Nexus 6P angler vendor make files
Hi,
I am trying to make a build for Nexus 6P. What make files do I need . How can I see the lunch option to build angler image.
what does the vendor img contain? what is it used for?
theone_s_me said:
what does the vendor img contain? what is it used for?
Click to expand...
Click to collapse
i am curious to know the answer to this question as well..
lazarus2297 said:
i am curious to know the answer to this question as well..
Click to expand...
Click to collapse
I guess nobody knows
@Stephen could we not just skip building the vendor.img in the ROM build, so as to not overwrite the existing /vendor? Or would this cause incompatibilities with build fingerprint etc?
The vendor image was the old system/vendor folder found in previous phones. For some odd reason, they moved it to its own partition /vendor. If you want to build a rom which includes the vendor partition I would really recommend looking at [KITCHEN][LINUX] SuperR's Kitchen (v0.9.7.7 - 12/23/15) All you have to do is, extract the system.img and vendor.img from the factory image, it will then decompress and create a flashable zip with both. It works perfectly.
However, I have seen the light and moved from android and bought the Microsoft Lumia 950xl, this is a killer phone that runs Windows 10. It works brilliantly with my Windows 10 PC! I can even send text messages from my PC with out having any 3rd party software installed on PC or phone! You guys should really check it out.
In case anyone runs into this question in the future, or is just curious how it's done, you simply have aosp make you a vendor from the stock vendor imgs decompiled decompiled files. You can also make it flash with your rom zip (as how I chose to do it) or make it it's own flashable. I didn't have any issues with the prop files or system and vendor symlinks, but I can't say that will always be the case.
The trick Is to make the build system move the files to $(TARGET_OUT_ROOT)/vendor and then have the tools given in the releasetools dir do the rest.
It's a not the most elaborate trick, but it gets the job done.

[HELP] Creating/Modifying a ROM based on stock, is it as easy as it sounds?

I've been searching for a way to create a debloated ROM based on stock, since there are no developers working on any type of custom ROM based on AOSP or any type of ports.
It's too complicated for me to understand really (port a custom ROM based on AOSP/Lineage OS) since I have no knowledge of any type of code.
What I have been able to learn, however, is to modify a flashable zip to add/remove/delete anything you want by modifying the "updater-script" file and flashing it via TWRP (a custom recovery)
With this, I have been able to remove bloatware that really slowed down the device and I am loving it
But now, what I want to do is to create a flashable zip, debloated ROM based on stock, not just have a flashable zip to remove apps that you add via an Odin flash (I have a Samsung device)
Is it as easy as extracting all the contents of system.img (done), removing the folder of the apps you don't want and add the following commands in the updater-script?
Code:
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
run_program("/sbin/busybox", "umount", "/system");
Or is there more to it than that? I feel like it's way too easy to be the case.
I know there's ASSAYYED's KITCHEN to ease up on making a debloated stock ROM, but the PC I use detects it as malware and eliminates the exe file, I do not have administrator rights on this PC.
Everywhere I search all point towards ASSAYYED's Kitchen, unfortunately and I really want to learn a bit more and maybe create a flashable ROM based on stock
Went ahead and tried it...
Sooo... I've been downloading various debloated ROMs based on stock from various Samsung devices and I've gotten a general idea of how to edit my code... a little bit.
I'm having a bit of trouble getting it to run and I think it has to do with permissions... because when I remove the ones I have added it doesn't boot at all it just stays on the initial screen but when I add them I atleast get to the Samsung logo.
Would anyone take a look at my updater-script and let me know if I'm missing something?
Code:
unmount("/system");
ui_print("Let's beggin!");
sleep(1);
ui_print("Formatting /system...");
format("ext4", "EMMC", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system", "0", "/system");
sleep(1);
ui_print("Mounting /system...");
mount("ext4", "EMMC", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system", "/system");
sleep(1);
ui_print("Installing debloated ROM!");
package_extract_dir("system", "/system");
ui_print("Done!...");
sleep(1);
ui_print("Setting permissions...");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 0, 0755, "/system/bin/install-recovery.sh");
set_perm(0, 3003, 06755, "/system/bin/ip");
set_perm(0, 1000, 0750, "/system/bin/iptables");
set_perm(0, 3003, 02750, "/system/bin/netdiag");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm(0, 1000, 0750, "/system/bin/tc");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pair_devlist.conf");
set_perm(0, 0, 0644, "/system/etc/bluetooth/iop_device_list.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.sec.boot.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm(0, 0, 0555, "/system/etc/ppp/ip-up-vpn");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/lib");
set_perm(0, 2000, 0755, "/system/vendor/media");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
ui_print("Extracting boot image...");
package_extract_file("boot.img", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/BOOT");
ui_print("Installation complete!");
sleep(1);
unmount("/system");
It must be noted that the only thing I have in the system folder is everything I extracted from system.img from the stock ROM I downloaded from Sammobile. I also added the boot.img

Categories

Resources