This guide is about installing v4a on factory ROM viper4Android. Your mileage may vary with other versions of Android/OSs. I'm not responsible if your device bricks. I'm only writing this guide because I miss the golden days of using V4A on my personal device to enhance audio quality.
1. Get the earliest version of Android from Google's website. Make sure you have fastboot and adb installed on your system.
https://developers.google.com/android/images#sargo > get Android 9 from here
2. Enable Developer options. Go to developer options and enable bootloader unlocking.
3. Reboot the phone by holding down Power + Vol Down button to boot into fastboot.
4. With the phone in fastboot mode, connect it to your PC and execute the following. WARNING: This will wipe all data on the phone, I mean ALL.
Code:
fastboot flashing unlock
Then confirm on the phone that you want to unlock the bootloader.
5. Go into the zip file you've downloaded from Google and find the other zip file from within it. Extract the boot.img from that second zip.
6. Boot the phone into Android 9 but DO NOT connect it to any network.
7. Enable developer options again and disable automatic system updates from developer options.
8. Download Magisk from Github (from the releases) https://github.com/topjohnwu/Magisk
9. Clone the v4a repo from https://github.com/Magisk-Modules-Repo/ViPER4Android-FX and put the contents in a zip file. The top folder should contain the repo's folders, so when you open the zip file it should be exactly the same as the repo. On Linux you can use the following commands to do the job:
Code:
git clone https://github.com/Magisk-Modules-Repo/ViPER4Android-FX.git v4a
zip -r viper.zip v4a
Do the same thing with this repo to download Audio Modification Library : https://github.com/Zackptg5/Audio-Modification-Library
10. Transfer the boot.img, magisk apk and the compiled zips to the phone storage. Install Magisk.apk
11. Open Magisk and select install from top and select and patch a file. Choose the boot.img. This will give you another file called magisk_boot_random.img. Transfer this file to your desktop.
12. Boot the phone in fastboot mode and flash this magisk patched boot image onto the boot partition with the following:
Code:
fastboot flash boot magisk_patched_random.img
13. Boot the phone and open Magisk. Choose Modules> install from storage and install viper.zip and then AML's zip files. DO NOT REBOOT.
14. Open the v4a application and allow it to install the drivers. This will reboot the phone automatically.
15. Install a file explorer that allows root access to the system, add the following code to the /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
Code:
magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }'
magiskpolicy --live 'allow audioserver system_file file { execmod }'
magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }'
magiskpolicy --live 'allow mediaserver system_file file { execmod }'
magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }'
magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }'
magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }'
magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }'
magiskpolicy --live 'allow app app_data_file file { execute_no_trans }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }'
16. Reboot and open v4a app, if it's not working, in the settings toggle the Legacy option on & off. This should be working now.
Thank you, confirmed working on a Pixel 3a XL.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
marstonpear said:
This guide is about installing v4a on factory ROM viper4Android. Your mileage may vary with other versions of Android/OSs. I'm not responsible if your device bricks. I'm only writing this guide because I miss the golden days of using V4A on my personal device to enhance audio quality.
1. Get the earliest version of Android from Google's website. Make sure you have fastboot and adb installed on your system.
https://developers.google.com/android/images#sargo > get Android 9 from here
2. Enable Developer options. Go to developer options and enable bootloader unlocking.
3. Reboot the phone by holding down Power + Vol Down button to boot into fastboot.
4. With the phone in fastboot mode, connect it to your PC and execute the following. WARNING: This will wipe all data on the phone, I mean ALL.
Code:
fastboot flashing unlock
Then confirm on the phone that you want to unlock the bootloader.
5. Go into the zip file you've downloaded from Google and find the other zip file from within it. Extract the boot.img from that second zip.
6. Boot the phone into Android 9 but DO NOT connect it to any network.
7. Enable developer options again and disable automatic system updates from developer options.
8. Download Magisk from Github (from the releases) https://github.com/topjohnwu/Magisk
9. Clone the v4a repo from https://github.com/Magisk-Modules-Repo/ViPER4Android-FX and put the contents in a zip file. The top folder should contain the repo's folders, so when you open the zip file it should be exactly the same as the repo. On Linux you can use the following commands to do the job:
Code:
git clone https://github.com/Magisk-Modules-Repo/ViPER4Android-FX.git v4a
zip -r viper.zip v4a
Do the same thing with this repo to download Audio Modification Library : https://github.com/Zackptg5/Audio-Modification-Library
10. Transfer the boot.img, magisk apk and the compiled zips to the phone storage. Install Magisk.apk
11. Open Magisk and select install from top and select and patch a file. Choose the boot.img. This will give you another file called magisk_boot_random.img. Transfer this file to your desktop.
12. Boot the phone in fastboot mode and flash this magisk patched boot image onto the boot partition with the following:
Code:
fastboot flash boot magisk_patched_random.img
13. Boot the phone and open Magisk. Choose Modules> install from storage and install viper.zip and then AML's zip files. DO NOT REBOOT.
14. Open the v4a application and allow it to install the drivers. This will reboot the phone automatically.
15. Install a file explorer that allows root access to the system, add the following code to the /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
Code:
magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }'
magiskpolicy --live 'allow audioserver system_file file { execmod }'
magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }'
magiskpolicy --live 'allow mediaserver system_file file { execmod }'
magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }'
magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }'
magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }'
magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }'
magiskpolicy --live 'allow app app_data_file file { execute_no_trans }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }'
16. Reboot and open v4a app, if it's not working, in the settings toggle the Legacy option on & off. This should be working now.
Click to expand...
Click to collapse
I am on android 11, unlocked bootloader, rooted with Magisk (patched boot.img). I want to roll back to Android 9. I'm not concerned about losing data as this is not my daily driver. Do I need to relock the bootloader before attempting this downgrade? I am doing this is to successfully install Viper4Android, so I figured this question might belong in this thread. Thank you in advance!
The Optimizer said:
I am on android 11, unlocked bootloader, rooted with Magisk (patched boot.img). I want to roll back to Android 9. I'm not concerned about losing data as this is not my daily driver. Do I need to relock the bootloader before attempting this downgrade? I am doing this is to successfully install Viper4Android, so I figured this question might belong in this thread. Thank you in advance!
Click to expand...
Click to collapse
Hi, no. You don't need to relock your bootloader to downgrade your OS.
marstonpear said:
Hi, no. You don't need to relock your bootloader to downgrade your OS.
Click to expand...
Click to collapse
Thank you so much for your quick reply! I really miss having v4a on all of my phones. Cheers!
marstonpear said:
This guide is about installing v4a on factory ROM viper4Android. Your mileage may vary with other versions of Android/OSs. I'm not responsible if your device bricks. I'm only writing this guide because I miss the golden days of using V4A on my personal device to enhance audio quality.
1. Get the earliest version of Android from Google's website. Make sure you have fastboot and adb installed on your system.
https://developers.google.com/android/images#sargo > get Android 9 from here
2. Enable Developer options. Go to developer options and enable bootloader unlocking.
3. Reboot the phone by holding down Power + Vol Down button to boot into fastboot.
4. With the phone in fastboot mode, connect it to your PC and execute the following. WARNING: This will wipe all data on the phone, I mean ALL.
Code:
fastboot flashing unlock
Then confirm on the phone that you want to unlock the bootloader.
5. Go into the zip file you've downloaded from Google and find the other zip file from within it. Extract the boot.img from that second zip.
6. Boot the phone into Android 9 but DO NOT connect it to any network.
7. Enable developer options again and disable automatic system updates from developer options.
8. Download Magisk from Github (from the releases) https://github.com/topjohnwu/Magisk
9. Clone the v4a repo from https://github.com/Magisk-Modules-Repo/ViPER4Android-FX and put the contents in a zip file. The top folder should contain the repo's folders, so when you open the zip file it should be exactly the same as the repo. On Linux you can use the following commands to do the job:
Code:
git clone https://github.com/Magisk-Modules-Repo/ViPER4Android-FX.git v4a
zip -r viper.zip v4a
Do the same thing with this repo to download Audio Modification Library : https://github.com/Zackptg5/Audio-Modification-Library
10. Transfer the boot.img, magisk apk and the compiled zips to the phone storage. Install Magisk.apk
11. Open Magisk and select install from top and select and patch a file. Choose the boot.img. This will give you another file called magisk_boot_random.img. Transfer this file to your desktop.
12. Boot the phone in fastboot mode and flash this magisk patched boot image onto the boot partition with the following:
Code:
fastboot flash boot magisk_patched_random.img
13. Boot the phone and open Magisk. Choose Modules> install from storage and install viper.zip and then AML's zip files. DO NOT REBOOT.
14. Open the v4a application and allow it to install the drivers. This will reboot the phone automatically.
15. Install a file explorer that allows root access to the system, add the following code to the /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
Code:
magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }'
magiskpolicy --live 'allow audioserver system_file file { execmod }'
magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }'
magiskpolicy --live 'allow mediaserver system_file file { execmod }'
magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }'
magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }'
magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }'
magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }'
magiskpolicy --live 'allow app app_data_file file { execute_no_trans }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }'
16. Reboot and open v4a app, if it's not working, in the settings toggle the Legacy option on & off. This should be working now.
Click to expand...
Click to collapse
I've flashed Android 9, Rooted successfully (Magisk v25.2 boot.img patch), when I try to install the v4a/modules zips I made, the terminal outputs an error:
- Copying zip to temp directory
! Unzip error
Do these files need to be compressed in a certain way to be able to flash them correctly? I cloned both repo's and just compressed them into .zip files. Am I doing this correctly?
The Optimizer said:
I've flashed Android 9, Rooted successfully (Magisk v25.2 boot.img patch), when I try to install the v4a/modules zips I made, the terminal outputs an error:
- Copying zip to temp directory
! Unzip error
Do these files need to be compressed in a certain way to be able to flash them correctly? I cloned both repo's and just compressed them into .zip files. Am I doing this correctly?
Click to expand...
Click to collapse
I encountered the same issue when I zipped the repos wrongly. Just ensure all the files in the repo are in the top directory of the zip. So basically META-INF directory needs to be there when you open the zip on desktop.
marstonpear said:
I encountered the same issue when I zipped the repos wrongly. Just ensure all the files in the repo are in the top directory of the zip. So basically META-INF directory needs to be there when you open the zip on desktop.
Click to expand...
Click to collapse
I was thinking that this may be the issue. Thank you for confirming!
Related
I have the following problem, I can not go into recovery mode. I know how to do that.I have access only in fastboot menu.when i try to enter from fastboot menu to recovery mode i don't have connection with the PC , because the problem is DRIVERS to start the second step "step2-windows.bat" for rooting.
I HAVE GOLD CARD !!!!!! .I had all drivers before this problem drivers was added to the PC and the phone WAS rooted.
The problem is not in my Windows i try those step on ,Windows7, windows xp ,Linux Ubuntu 10.4. And errors are the same "unknown device" and is impossible to install drivers to ROOT the phone.
Before the phone can not detect the SD card.The problem is fixed now is working .Now the phone is with original ROM and is not rooted.May be I have to flash new bootloader or new recovery.img I don't know.
My cable is not damaged.
the reason that I want to enter in recovery mode is that i want to root the phone again.
!!!!!!!!!!!WHO CAN HELLP ME !!!!!!!!!!!!!
sorry for my bad english
Strange.......... how it could be:
release your battery, push the power to release residual power , maybe 1 minute, in sert the battery and try go to recovery again
BesFen said:
Strange.......... how it could be:
release your battery, push the power to release residual power , maybe 1 minute, in sert the battery and try go to recovery again
Click to expand...
Click to collapse
The same f**** message "device not recognized". And it start to search Drivers on windows 7 x86 (fresh installation before 30 min.).
"Android 1.0, Qualcomm CDMA technologies MSM " - searching for drivers .. and the message "device not recognized" or "unknown device"
problem occurs when app2sd install and replace all programs to sd card.I enter into recovery mode and i wipe all options.After reboot my sd card was unmounted ........
may be this will be helpful
Follow this:
http://android.modaco.com/content/htc-legend-legend-modaco-com/309961/usb-brick-rickrolled-b0rked-fixed/
I've had a similar problem during the rooting-process of my legend
I have Win7 X86 and it also couldn't find any drivers for the legend.
Then I installed the HTC Sync application found on the HTC-Homepage
So i would suggest that you do the same
It is not an usb driver issue.
The phone acting as different device depending of its mode normal/fastboot/recovery/usb mount etc
Boot to bootloader select fastboot
run on your computer "fastboot oem boot"
if you have any of thoose =1 you have to alter it to 0
where the bold down is of importance
Normal output is:
INFOTAG xxxxx
INFOCID is HTC__***
INFOserial numer: *********
INFOcommandline from head: no_console_suspend=1 console=null
INFOcommand line length = xxx
INFOactive commandline:
board_legend.disable_uart3=0
board_legend.usb_h2w_sw=0
board_legend.disable_sdcard=0
diag.enabled=0
board_legend.debug_uart=0
smisize=0
userdata_sel=0
androidboot.emmc=false
androidboot.baseband=7.08.35.21 (or other)
andriodboot.cid=HTC_XXX (different depending on serial )
androidboot.carrier=HTX-
androidboot.mid=
androidboot.keycaps=querty
androidboot.mode=normal
androidboot.serialno=xxxxxxxx
androidboot.bootloader=0.43.00001
no_console_suspend=1
console=null
aArm_partion[0].name=misc
aArm_partion[1].name=recovery
aArm_partion[2].name=boot
aArm_partion[3].name=system
aArm_partion[4].name=cache
aArm_partion[5].name=userdata
partition number=6
Valid partition num=6
mpu_nand_acpu_rw 8F2 1000
result is :
Code:
C:\android SDK\tools>fastboot oem disable_uart3=0
... INFO[ERR] Command error !!!
OKAY [ 0.016s]
finished. total time: 0.016s
C:\android SDK\tools>fastboot oem usb_h2w_sw=0
... INFO[ERR] Command error !!!
OKAY [ 0.000s]
finished. total time: 0.016s
C:\android SDK\tools>fastboot oem boot
... INFOsetup_tag addr=0x60000100 cmdline add=0x9D
078D14
INFOTAG:Ramdisk OK
INFOTAG:smi ok, size = 0
INFOTAG:hwid 0x0
INFOTAG:skuid 0x22F00
INFOTAG:hero panel = 0x0
INFOTAG:engineerid = 0x0
INFOMCP dual-die
INFOMCP dual-die
INFOTAG:mono-die = 0x0
INFODevice CID is not super CID
INFOCID is HTC__032
INFOsetting->cid::HTC__032
INFOserial number: HT03YNX02877
INFOcommandline from head: no_console_suspend=1 console=null
INFOcommand line length =446
INFOactive commandline: board_legend.disable_uart3=1 board_legen
INFOd.usb_h2w_sw=1 board_legend.disable_sdcard=0 diag.enabled=0
INFOboard_legend.debug_uart=0 smisize=0 userdata_sel=0 androidbo
INFOot.emmc=false androidboot.baseband=7.05.35.26L androidboot.
INFOcid=HTC__032 androidboot.carrier=HTC-EastEurope androidboot.
INFOmid=PB7610000 androidboot.keycaps=qwerty androidboot.mode=no
INFOrmal androidboot.serialno=HT03YNX02877 androidboot.bootloade
INFOr=0.43.0001 no_console_suspend=1 console=null
INFOaARM_Partion[0].name=misc
INFOaARM_Partion[1].name=recovery
INFOaARM_Partion[2].name=boot
INFOaARM_Partion[3].name=system
INFOaARM_Partion[4].name=cache
INFOaARM_Partion[5].name=userdata
INFOpartition number=6
INFOValid partition num=6
INFOmpu_nand_acpu_rw 8F2 1000
FAILED (status read failed (Too many links))
finished. total time: 0.874s
the phone must be rooted main is not this is the problem and what this mean
FAILED (status read failed (Too many links))
this is your problem:
board_legend.disable_uart3=1
board_legend.usb_h2w_sw=1
The FAIL string at bottom is normal.
this is your problem:
board_legend.disable_uart3=1
board_legend.usb_h2w_sw=1
The FAIL string at bottom is normal.
So you tell us that you have succeed with unrooting and lock usbcontroller.
Umm, sounds like and bad combination.
I had the uart3=1 probleb but still rooted and could insert new mtd0.img
have you tested to replace this two files?
http://www.shadowchild.nl/mtd0legend.img
http://www.shadowchild.nl/flash_image
download to your sdcard direct or with other usb/sdcard writer.
install terminal
open run
su
to check if it it still rooted
if so
chmod 755 /data/flash_image
cat /sdcard/flash_image > /data/flash_image
cat /sdcard/mtd0legend.img > /data/mtd0.img
/data/flash_image misc /data/mtd0.img
and reboot
I assume you updated your legend to rom >2.03 (or any above 2.xx) you will have to downgrade
http://forum.xda-developers.com/showthread.php?t=725430
when you downgrade, root the legend again (fastboot usb > step1) then recovery mode >> step2
should work, worked for me tho. If not do step1 few times and try step2 again
snakehult said:
this is your problem:
Board_legend.disable_uart3=1
board_legend.usb_h2w_sw=1
the fail string at bottom is normal.
So you tell us that you have succeed with unrooting and lock usbcontroller.
Umm, sounds like and bad combination.
I had the uart3=1 probleb but still rooted and could insert new mtd0.img
have you tested to replace this two files?
http://www.shadowchild.nl/mtd0legend.img
http://www.shadowchild.nl/flash_image
download to your sdcard direct or with other usb/sdcard writer.
Install terminal
open run
su
to check if it it still rooted
if so
chmod 755 /data/flash_image
cat /sdcard/flash_image > /data/flash_image
cat /sdcard/mtd0legend.img > /data/mtd0.img
/data/flash_image misc /data/mtd0.img
and reboot
Click to expand...
Click to collapse
thank you !!!
no way.....its not working showing
C:\sdk\tools>chmod 755 /data/flash_image
'chmod' is not recognized as an internal or external command,
operable program or batch file.
C:\sdk\tools>cat /sdcard/flash_image > /data/flash_image
The system cannot find the path specified.
no no
you most run that on your phone.
install terminal emulator or similar
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
i can't download......... showing insufficient storage........i even can't install application through 91pc suite for android..........i need help....
how do i type this in terminal all at once or sentence by sentence?
do exactly what he does :
http://android.modaco.com/content/h...com/309961/usb-brick-rickrolled-b0rked-fixed/
after unbricking your usb , install a stock rom not a custom coz you need a clean system.img.
If you don't do that, usb bricking will come again after flashing with a custom rom...
You can install a new stock rom ( like 2.03 etc... ) and use the thread "how to downgrade to 1.31" and root your legend again.
Another solution :
If the rom is not rooted and you can't follow unbrick instructions try this ( it's what i've done but not sure if result will be the same for you... ) :
Go to recovery mode ( power + volume down ) , select fastboot and try step 1 of rooting process, that will push 1.31 rom + some necessary tool to root the rom.
if all succeded , you will have a 1.31 rom apparently not rooted... but ! yes but ! after installing "connectbot" from market and select "local" and type 2 time "su" i got root access ! if not try step 1 of rooting process under fastboot mode.
If all is ok and you have ( like me ) root acces ( after typing 2 times "su" you will past from $ to # at the beginning of the line... ) , follow unbrink process .
Code:
if your phone can't even see the memory card, enable first with:
fastboot oem enableqxdm 0
Do the above step in Recovery mode.
Once the memory card is visible, transfer the files "flash_image" and "mtd0.img" to the memory card
howevor is possible.
Restart the phone, and install connectbot from the market.
Open connectbot, and through terminal (local) issue the following commands:
su [B][U](2 times)[/U][/B]
cat /sdcard/flash_image > /data/flash_image "then press enter"
cat /sdcard/mtd0.img > /data/mtd0.img "then press enter"
chmod 755 /data/flash_image "then press enter"
[B][U]and to finish process type the following command 2 times[/U] :[/B]
/data/flash_image misc /data/mtd0.img "then press enter"
It will give you 2 errors, on the last command, but ignore it and restart the phone
It should be fixed.
after that i had upgraded to an official stock rom to get back a clean system.img and boot.img. oh yes... phone again unrooted... ok... downgrade to 1.31 and root again
Isn't there a noob friendly way to unbrick.i couldn't possibly do all of that.
Sent from my HTC Legend using XDA App
THANK YOU!!!!
My phone lost the ability to read SD-cards and this thread helped me tremendously. I was just about to sell it or go and buy a new one or something.
Hugs to all!
heelp me
Very very much please help me fix my htc my legend. I do not see sd card, I can not root them anymore, can not find drivers. I do only step 1, you want to put up two do not communicate with the PC. Do not know much about Android, where I do not know the commands to be written, please help me. TeamViewer eventually get through to my PC. My address is [email protected] messenger. I pray a lot.
[DEV_TOOL] HTC ROM EXTRACTOR
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Tools for working with firmware HTC in LINUX
fit Kenny Millington Source kmdm
(HOW TO)
PUSH THE BUTTON
! Requirements (libunshield v0.7 or higher):
Code:
$ sudo apt-get install automake
$ git clone https://github.com/kmdm/unshield.git
$ cd unshield/
$ git checkout -t origin/v18\_wip
$ ./bootstrap
$ ./configure --prefix=/usr
$ make
$ sudo make install
1. Extract from the zip and put the RUUXXXXXXXXX.exe to a folder with the tool;
2. Run in Terminal rom-extractor file and select the option:
MAIN MENU
u - UNRUU EXE TO ZIP - extract from the file rom.zip RUU.exe
d - DECRYPT MENU > DECRYPT MENU ROM.ZIP > OUTPUT.ZIP
r - REPACK MENU > REPACK MENU
e - ENCRYPT MENU >
c - CLEAN TOOL - Unmount and remove temporary files
x - exit
> DECRYPT MENU ROM.ZIP > OUTPUT.ZIP
1 ... 24 - decode the file rom.zip output.zip (select the target device)
> REPACK MENU
e - EXTRACT ZIP ROM - to extract the firmware from the ROM folder output.zip
m - MOUNT SYSTEM (EXT4 ONLY) - mount the partition image system.img in the folder system (you can add \ remove the firmware files)
d - DESPARSE SYSTEM.IMG (EXT4 ONLY) - uncompress the sparse image system.img (depending on the device - some zhaty, some not (determined EXPERIMENTAL)) and mount the partition image system.img in the folder system (you can add \ remove the firmware files)
s - MAKE SPARSE SYSTEM.IMG (EXT4 ONLY) - the creation of a sparse image sistem.img (you must specify the size of the partition XXXXM (device) - for example ONE X = 1280M)
n - UNMOUNT SYSTEM - dismount and delete the folder system
z - ADD SYSTEM.IMG > OUTPUT.ZIP - add new edited system.img into output.zip
> ENCRYPT MENU OUTPUT.ZIP > ROM.ZIP
1 ... 24 - create encrypt new rom.zip from output.zip
Thanks
as i9000 said:
[DEV_TOOL] HTC ROM EXTRACTOR
Tools for working with firmware HTC in LINUX
fit Kenny Millington Source
(HOW TO)
PUSH THE BUTTON
! Requirements (libunshield v0.7 or higher):
Code:
$ git clone https://github.com/kmdm/unshield.git
$ cd unshield/
$ git checkout -t origin/v18\_wip
$ ./bootstrap
$ ./configure --prefix=/usr
$ make
$ sudo make install
1. Extract from the zip and put the firmware. Exe to a folder with the tool;
2. Run in Terminal rom-extractor file and select the option:
u - extract from the file rom.zip RUU.exe
1 ... 21 - decode the file rom.zip output.zip (select the target device)
e - to extract the firmware from the ROM folder output.zip
m - mount the partition image system.img in the folder system (you can add \ remove the firmware files)
n - dismount and delete the folder system
c - Clean all tools
x - exit
d - uncompress the sparse image system.img (depending on the device - some zhaty, some not (determined EXPERIMENTAL)) and mount the partition image system.img in the folder system (you can add \ remove the firmware files)
s - the creation of a sparse image sistem.img (you must specify the size of the partition XXXXM (device) - for example ONE X = 1280M)
Click to expand...
Click to collapse
i can not work and i can not runnig
R: [DEV_TOOL] HTC ROM EXTRACTOR extract RUU & repack system.img
lauri_ylonen said:
i can not work and i can not runnig
Click to expand...
Click to collapse
This is only for linux
Inviato dal mio GT-I9070 con Tapatalk 2
Are there plans to add the One S?
Nm. Just looked at the source.... Oops.
bedwa said:
Are there plans to add the One S?
Nm. Just looked at the source.... Oops.
Click to expand...
Click to collapse
INFO FOR ALL...
If your device is not supported and you would like it supported please open an issue in the tracker with the device name, codename and a link to the most recent hboot file for the device. (Not a link to the full RUU!)
Click to expand...
Click to collapse
Kenny Milington https://github.com/kmdm/ruuveal
anything more?..
I promise to add new binaries in my instrument as we update source
Not as all. The oops was cause I looked at the source and noticed the unpacker was One S supported. Lol.
Fixed a typo in paragraph 21
HTC One VX (tc2) > HTC One S (ville)
add
HTC_ROM-EXTRACTOR_v.0.0.3_x64
it seems that I'm doing something wrong.
[email protected]:~$ git clone https://github.com/kmdm/unshield.git
Cloning into 'unshield'...
remote: Counting objects: 569, done.
remote: Compressing objects: 100% (208/208), done.
remote: Total 569 (delta 370), reused 545 (delta 346)
Receiving objects: 100% (569/569), 116.31 KiB | 204 KiB/s, done.
Resolving deltas: 100% (370/370), done.
[email protected]:~$ cd unshield/
[email protected]:~/unshield$ git checkout -t origin/v18\_wip
Branch v18_wip set up to track remote branch v18_wip from origin.
Switched to a new branch 'v18_wip'
[email protected]:~/unshield$ ./bootstrap
Creating configure.ac...done.
+ aclocal -I m4
./bootstrap: 29: ./bootstrap: aclocal: not found
[email protected]:~/unshield$
Click to expand...
Click to collapse
can anyone help?
Maybe a more step-bystep guide,
Sorry for been noob
andrewschumi said:
it seems that I'm doing something wrong.
can anyone help?
Maybe a more step-bystep guide,
Sorry for been noob
Click to expand...
Click to collapse
sudo apt-get install automake
Added
v.o.o.4
22 - HTC One U (m7_u)
23 - HTC One UL (m7_ul)
24 - HTC Desire SV (magnids)
ADDED v.0.0.5
REBUILD TOOL
ADDED ENCRYPT MENU!!!
as i9000 said:
ADDED v.0.0.5
REBUILD TOOL
ADDED ENCRYPT MENU!!!
Click to expand...
Click to collapse
Could you please help? unruu never completes. It gives me this
Extracting temporary files...
Extracting rom zip files...
./unruu_exe: line 8: 4379 Aborted (core dumped) ./unruu ruu.exe
failed to open source zip: No such file or directory
That last line fails because decrypt is looking for a zip that was never made.
If i do ./unruu ruu.exe , I am given the following
[email protected]:~/Desktop/HTC_ROM-EXTRACTOR_v.0.0.5/tools$ ./unruu ruu.exe
Extracting temporary files...
Extracting rom zip files...
Aborted (core dumped)
Click to expand...
Click to collapse
this was done as root with the same result.
Perhaps I need to switch to all i386 binaries? Ill try that, but i was trying to avoid it, as it will break my current nvidia driver setup. ohwell
Tilde88 said:
Could you please help? unruu never completes. It gives me this
Extracting temporary files...
Extracting rom zip files...
./unruu_exe: line 8: 4379 Aborted (core dumped) ./unruu ruu.exe
failed to open source zip: No such file or directory
That last line fails because decrypt is looking for a zip that was never made.
If i do ./unruu ruu.exe , I am given the following
this was done as root with the same result.
Perhaps I need to switch to all i386 binaries? Ill try that, but i was trying to avoid it, as it will break my current nvidia driver setup. ohwell
Click to expand...
Click to collapse
Did you do this?
! Requirements (libunshield v0.7 or higher):
Code:
$ sudo apt-get install automake
$ git clone https://github.com/kmdm/unshield.git
$ cd unshield/
$ git checkout -t origin/v18\_wip
$ ./bootstrap
$ ./configure --prefix=/usr
$ make
$ sudo make install
Added version 0.0.6 x86-64
25 - HTC One WLS (m7_wls)
26 - HTC One SV (k2_u)
27 - HTC One SV (k2_plc_cl)
as i9000 said:
Did you do this?
! Requirements (libunshield v0.7 or higher):
Code:
$ sudo apt-get install automake
$ git clone https://github.com/kmdm/unshield.git
$ cd unshield/
$ git checkout -t origin/v18\_wip
$ ./bootstrap
$ ./configure --prefix=/usr
$ make
$ sudo make install
Click to expand...
Click to collapse
lol yes of course
Tilde88 said:
lol yes of course
Click to expand...
Click to collapse
OK, try to extract some different rom, may be you has problem from invalid ruu.exe..
and more, what size have your ruu.exe? - x32 systems, can't handle files largest 2GB...
as i9000 said:
OK, try to extract some different rom, may be you has problem from invalid ruu.exe..
and more, what size have your ruu.exe? - x32 systems, can't handle files largest 2GB...
Click to expand...
Click to collapse
im running x64, tried with x64 binaries, and i also tried using 32bit binaries. furthermore, my RUU is onlt 1.15GB. Also, x86 (there is not such thing as x32) can handle 3gb files.
thanks so much for the tool though, everything else workes, I juse used a script I found from another developer to get the .zip, then used your tool for all the other features.
Tilde88 said:
im running x64, tried with x64 binaries, and i also tried using 32bit binaries. furthermore, my RUU is onlt 1.15GB. Also, x86 (there is not such thing as x32) can handle 3gb files.
thanks so much for the tool though, everything else workes, I juse used a script I found from another developer to get the .zip, then used your tool for all the other features.
Click to expand...
Click to collapse
Well then stay one variant - you doesn't installed "Unshield", try run terminal and input 'unsield'
here the correct conclusion:
Code:
~$ unshield
No action provided on command line.
Syntax:
unshield [-c COMPONENT] [-d DIRECTORY] [-D LEVEL] [-g GROUP] [-i VERSION] [-GhlOrV] c|g|l|t|x CABFILE [FILENAME...]
Options:
-c COMPONENT Only list/extract this component
-d DIRECTORY Extract files to DIRECTORY
-D LEVEL Set debug log level
0 - No logging (default)
1 - Errors only
2 - Errors and warnings
3 - Errors, warnings and debug messages
-g GROUP Only list/extract this file group
-h Show this help message
-i VERSION Force InstallShield version number (don't autodetect)
-j Junk paths (do not make directories)
-L Make file and directory names lowercase
-O Use old compression
-r Save raw data (do not decompress)
-V Print copyright and version information
Commands:
c List components
g List file groups
l List files
t Test files
x Extract files
Other:
CABFILE The file to list or extract contents of
FILENAME... Optionally specify names of specific files to extract (wildcards are supported)
hi is there any chance to add the Desire HD. As i am trying to merge a Orange UK RUU for Desire DHD and they never released the last RUU with all the OTA's to make a New RUU with all the OTA's included.
I have made a Nandroid backup after all the OTA's was installed to the phone i even have all the OTA's just need a way to extract the rom.zip (easy from exe file not a issue) add the changed .img files such as radio, system, hboot recovery rcdata lib.img and make a new rom.zip and ruu.exe any way this can be done just tried with your tool and got invalid htc aes encrypted zip.
Thanks in advance
How to install this:
1. put copymodulecrc to the /data/local/tmp folder and chmod them to 755
(adb shell chmod 755 /data/local/tmp/copymodulecrc)
2. put ntfs-3g and ntfsmount to the folder /system/bin and chmod them to 755
(adb shell chmod 755 /system/bin/ntfs-3g)
(adb shell chmod 755 /system/bin/ntfsmount)
3. put sdcardfs.ko to the folder /system/lib/modules and chmod them to 644
(adb shell chmod 644 /system/lib/modules/sdcardfs.ko)
What is next? Next:
1. in order to get it working, sdcardfs.ko must be patched to match your kernel version since every kernel modules is paired with kernel by version string, so if version string not match module version it will not work! So you must patch sdcardfs.ko module using tool called copymodulecrc! Copymodulecrc will extract version string from any module of the your stockrom kernel modules and copy them directly to the sdcardfs.ko (patch them). First of all you need to look into your /system/lib/modules folder and use any .ko file NAME for referencie in next commands:
Code:
adb shell /data/local/tmp/copymodulecrc /system/lib/modules/PUT_NAME_OF_THE_KO_YOU_FOUND_IN_STOCK_ROM_KERNEL_MODULES /system/lib/modules/sdcardfs.ko
So replace PUT_NAME_OF_THE_KO_YOU_FOUND_IN_STOCK_ROM_KERNEL_MODULES with the name of the any module you found in modules folder! Done.
2. if you completed step 1 without errors you are ready for this step. You need to locate script called install-recovery.sh (on most devices it is in folder /system/etc) and add next lines:
Code:
insmod /system/lib/modules/sdcardfs.ko
Done. On every next reboot sdcardfs kernel module will be automatically included in your kernel.
3. if you get error in patching sdcardfs.ko whole thing will not work! So these step is important! You can verify success by command: (su -c "insmod /system/lib/modules/sdcardfs.ko") , if you see error than sdcardfs is not working, if you see nothing than it is working
Since you completed these 3 things, you are ready to use NTFS volumes on your device! To understand these things:
1. first of all, you can not mount ntfs volume regulary trought settings menu since android not support ntfs by default! You must mount/umount your ntfs volume manually (you can use for example android terminal emulator when you need to mount/umount ntfs). You will not see any details about ntfs volume in settings menu since android not support ntfs by default, you can see details in most file managers only.
How to mount and unmount:
1. to mount (first connect your usb ntfs volume to your device usb port) :
Code:
su -c "ntfsmount mount"
Done! Your ntfs volume by these command is mounted and you are ready to read/write them using your faworite file manager
2. To umount (do in mind - every time before you going to remove ntfs volume from your device you must unmount it!):
Code:
su -c "ntfsmount umount"
Done! You are ready to remove ntfs volume from your usb port.
NTFS on sdcard? Yes but you need to modify a bit ntfsnount script! Don't ask me how ypu can modify them, do it byself!
Since somebody complain here about gpl licence, I am not ready ready to share sdcardfs source code with you since it is not gpl licenced, instead it is apache 2.0 licenced by Samsung guys @ 2013 and I no need to share it with you since you wanted to see them forced! I not like when somebody forcing me for something! Find it, patch them, make module of them byself
ntfs-3g is not compiled by me, it is used from here -> http://forum.xda-developers.com/showthread.php?t=1724078
ntfsmount script is created by me.
Copymodulecrc I do not know where I found them but here is source code:
Code:
/* copymodulecrc */
/*
* Copyright (C) 2014 CUBE
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
int main(int argc, char **argv) {
struct stat st;
off_t filesize;
int fd;
char *data, *pos;
unsigned int i;
int bFound;
unsigned long crcval;
if (argc != 3) {
printf("usage: copymodulecrc [modulename(src)] [modulename(dst)]\n");
return -1;
}
if (stat(argv[1], &st) != 0) {
fprintf(stderr, "module1 stat failed.\n");
return -1;
}
filesize = st.st_size;
fd = open(argv[1], O_RDONLY);
if (fd < 0) {
fprintf(stderr, "module1 open failed.\n");
return -1;
}
data = mmap(NULL, filesize, PROT_READ, MAP_SHARED, fd, 0);
if (data == MAP_FAILED) {
fprintf(stderr, "module1 mmap failed.\n");
close(fd);
return -1;
}
pos = data;
bFound = 0;
for (i = 0; i < (filesize - 12); ++i) {
if (memcmp((void *)pos, (void *)"module_layout", 13) == 0) {
bFound = 1;
break;
}
pos++;
}
if (bFound == 0) {
fprintf(stderr, "module1 crc not found.\n");
munmap(data, filesize);
close(fd);
return -1;
}
pos -= 4;
memcpy((void *)&crcval, (void *)pos, 4);
munmap(data, filesize);
close(fd);
printf("module crc=%08x\n", (unsigned int)crcval);
if (stat(argv[2], &st) != 0) {
fprintf(stderr, "module2 stat failed.\n");
return -1;
}
filesize = st.st_size;
fd = open(argv[2], O_RDWR);
if (fd < 0) {
fprintf(stderr, "module2 open failed.\n");
return -1;
}
data = mmap(NULL, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (data == MAP_FAILED) {
fprintf(stderr, "module2 mmap failed.\n");
close(fd);
return -1;
}
pos = data;
bFound = 0;
for (i = 0; i < (filesize - 12); ++i) {
if (memcmp((void *)pos, (void *)"module_layout", 13) == 0) {
bFound = 1;
break;
}
pos++;
}
if (bFound == 0) {
fprintf(stderr, "module2 crc not found.\n");
munmap(data, filesize);
close(fd);
return -1;
}
pos -= 4;
memcpy((void *)pos, (void *)&crcval, 4);
munmap(data, filesize);
close(fd);
printf("module crc copied.\n");
return 0;
}
And finaly, files you need to install is in attachment, enjoy!
Will try late-night. Just asking, will it work on Galaxy S3-GTi9300?
Just need some clarification, when you say NTFS support, do you mean read and write or just read-only?
munjeni said:
Not going to explain in details, here is my tool which will add ntfs support to your android, run them and folow instructions! If you unable to patch sdcardfs.ko kernel module (giving you error when you doing insmod) than the whole things will not work on your device Curntly tested device is Xperia Z1 Compact on android version 14.4.A.0.108! Important thing is having sdcardfs installable, the rest is easy.
In order to have sdcardfs module insmoded on every reboot, you need to add one line into /system/etc/install-recovery.sh :
The rest of the tutorial you can see under application. Enjoy if you find this usefull!
Click to expand...
Click to collapse
/system/etc/install-recovery.sh :-
- install-recovery.sh file is not available at /system/etc/.
- Is it possible to create the file and then we can insert the line?
Am using AOSP - Carbon ROM on Xperia Z..
Thank you!!
'A Munjeni Work' again!
Thanks a lot! :victory:
Looking forward for what all can I do with it.
Wow this will be amazing, cant wait to try...
anonyo said:
Just need some clarification, when you say NTFS support, do you mean read and write or just read-only?
Click to expand...
Click to collapse
+1
anonyo said:
Just need some clarification, when you say NTFS support, do you mean read and write or just read-only?
Click to expand...
Click to collapse
Quote!
Just a heads up..
On Xperia Z2 tablet with 4.4.2, connected to 1tb NTFS drive.
After modding the ko and setting all permissions, rebooting, will only "half-mount" the drive. It sees it, recognizes it, but claims drive is empty (wants to format it).
Status bar displays "Empty USB Storage"
In settings, when selecting Mount USB Storage, it briefly acts like it will mount. for a split second.
Any files I can get that can possibly help?
UPDATE: After running the mount commands via terminal, now it seems to mount it via ES File explorer. Although it sometimes still gives me the message in statusbar.
But seems to be working well.
Seeing as this patches a kernel module will it work on rooted phones with a locked bootloader?
Aborto said:
Seeing as this patches a kernel module will it work on rooted phones with a locked bootloader?
Click to expand...
Click to collapse
My Z2 Tablet has a locked bootloader. So yes, it should. There's nothing going on that warrants an unlocked bootloader. Just the addition of some files and permission changes, which are normal with a rooted device.
Also note, that in the Settings\Storage, it will not show up as being "mounted". At least not in my case. However, ES File Explorer has no issue with it, and shows as a USB 1052 drive under the "Local" menu. Navigation seems normal within the drive.
I get the "USB Drive Empty or Unsupported" message in the status bar, for a few seconds, but the ES FE displays the drive contents, and the message goes away after it reads drive contents. Note that it may assign a different drive identifier each time you use it.
In testing I have found apps from the market;
StickMount does not work at all on my Stock OS.
Paragon NTFS mount works, but it runs as a system process using memory and probably battery.
This mod seems to work, for the most part, as long as you use ES File Explorer.
OP - you must provide the source for any modified code covered by the GPL that you are distributing - that includes the sdcardfs kernel module, and the ntfs-3g binary. Packing them in an encrypted Windows executable does not help.
spoidar said:
OP - you must provide the source for any modified code covered by the GPL that you are distributing - that includes the sdcardfs kernel module, and the ntfs-3g binary. Packing them in an encrypted Windows executable does not help.
Click to expand...
Click to collapse
No he doesn't. Only the zimage (kernel) is covered under GPL.
UPDATE: Just to clarify, the matter "Has" been brought to the Developers Committee to address any possible GPL violations. The DC is more informed on GPL.
Moscow Desire said:
No he doesn't. Only the zimage (kernel) is covered under GPL.
Click to expand...
Click to collapse
What? No. The ntfs-3g project is licensed under the GPL. And so is the sdcardfs driver. You can't generate binaries from GPL code and distribute them without providing the source.
Need help here
After i Copy copymodulecrc and sdcardfs.ko to /data/local/tmp and gave the permission as rwx-r-r to copymodulecrc. how to run it? can anybody help me here to patch sdcardfs.ko
coolrevi said:
After i Copy copymodulecrc and sdcardfs.ko to /data/local/tmp and gave the permission as rwx-r-r to copymodulecrc. how to run it? can anybody help me here to patch sdcardfs.ko
Click to expand...
Click to collapse
First off, permissions must be set to 755 (rwx-rx-rx) if I'm not mistaken. Root Explorer converts it to the numerical format when you change permissions.
Next, use a terminal program (available from the play store) Make sure you run it as SU. (type SU + Enter, you will get the # sign) Then type in the commands and paths as indicated. (I copied and pasted my paths)
Moscow Desire said:
First off, permissions must be set to 755 (rwx-rx-rx) if I'm not mistaken. Root Explorer converts it to the numerical format when you change permissions.
Next, use a terminal program (available from the play store) Make sure you run it as SU. (type SU + Enter, you will get the # sign) Then type in the commands and paths as indicated. (I copied and pasted my paths)
Click to expand...
Click to collapse
I got it till replacing a line in install-recovery.sh but i am stuck there as there is no line called ntfs.ko to replace with
Thanks for posting this up, can't wait to get home and test this out.
I am recieving the error in the screenshot
The device that i am using is Lenovo A3500HV which contains a Jellybean 4.2.2 AOSP ROM (Hardly any modification)
Please Help
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I've seen people recommending to set selinux to permissive to solve camera lag on Oreo rooted with Magisk.
I think that's a pretty bad idea since it completely defeats having selinux at all. Permissive selinux + root is an especially dangerous combination, as explained here by @Jman420.
Now I'm no selinux expert, but I think what would be much better is to explicitly only enable the required permissions.
While looking for this I came across this commit on the sony sepolicy, which explicitly enables some selinux policies to fix camera denials.
Magisk supports modifying selinux policies at runtime using the `magiskpolicy` command. To make this work we should make a magisk module that runs some `magiskpolicy` commands, so effectively we need to translate the granted policies from the linked commit to `magiskpolicy` commands.
This is where I got stuck a little and could use some help.
I tried this:
Code:
magiskpolicy --live "allow hal_camera_default vndbinder_device chr_file { read write }”
magiskpolicy --live "allow hal_camera_default camera_prop file { read }”
magiskpolicy --live "allow hal_camera_default property_socket sock_file { write }”
magiskpolicy --live "allow hal_camera_default gpu_device chr_file { read write }”
magiskpolicy --live "allow hal_camera_default sysfs file { read }”
magiskpolicy --live "allow hal_camera_default hal_graphics_mapper_hwservice hwservice_manager { find }”
magiskpolicy --live "allow hal_camera_default qdisplay_service service_manager { find }”
magiskpolicy --live "allow vndservicemanager hal_camera_default dir { search }”
magiskpolicy --live "allow vndservicemanager hal_camera_default file { read }”
magiskpolicy --live "allow vndservicemanager hal_camera_default process { getattr }”
But that didn't fix the camera lag.
This does fix it (largely):
Code:
magiskpolicy --live "permissive camera_prop"
magiskpolicy --live "permissive hal_camera_default"
But obviously this is also shotgun surgery. Anyone with more selinux knowledge willing to chime in here? Perhaps @topjohnwu or @Jman420?
From your quoted article it sounds like It does seem to not matter too, too much though.. Basically once a malicious app has root priviliges it can circumvent selinux anyways..
Anyways, I hope you get this solved. I'm on permissive & root and more security is always better!
The post mentions that running rooted at all is a liability and that's true, but with selinux permissive mode it's even worse.
It might not make a huge difference, but if we can have a good camera experience with selinux enabled I'd prefer that.
I haven't had time to look into this further, but for now I'm running with permissive camera_prop and hal_camera_default only and it's working fine.
Hi. I use Magisk and I have been facing the camera lag issue as well after upgrading to Oreo. Now I am not a dev in any way and this may sound like an insanely noob question but where and how exactly do I enter the magiskpolicy commands to fix the camera issue? I am willing to try OP's solution. Do I have to download a terminal emulator or something like that?
Yes, you can do it in Terminal emulator.
Type in "su", then grant root-priliviges and then type in the two line of code mentioned above.
For me it works till the next reboot.
Pyrb said:
I've seen people recommending to set selinux to permissive to solve camera lag on Oreo rooted with Magisk.
I think that's a pretty bad idea since it completely defeats having selinux at all. Permissive selinux + root is an especially dangerous combination, as explained here by @Jman420.
Now I'm no selinux expert, but I think what would be much better is to explicitly only enable the required permissions.
While looking for this I came across this commit on the sony sepolicy, which explicitly enables some selinux policies to fix camera denials.
Magisk supports modifying selinux policies at runtime using the `magiskpolicy` command. To make this work we should make a magisk module that runs some `magiskpolicy` commands, so effectively we need to translate the granted policies from the linked commit to `magiskpolicy` commands.
This is where I got stuck a little and could use some help.
I tried this:
Code:
magiskpolicy --live "allow hal_camera_default vndbinder_device chr_file { read write }”
magiskpolicy --live "allow hal_camera_default camera_prop file { read }”
magiskpolicy --live "allow hal_camera_default property_socket sock_file { write }”
magiskpolicy --live "allow hal_camera_default gpu_device chr_file { read write }”
magiskpolicy --live "allow hal_camera_default sysfs file { read }”
magiskpolicy --live "allow hal_camera_default hal_graphics_mapper_hwservice hwservice_manager { find }”
magiskpolicy --live "allow hal_camera_default qdisplay_service service_manager { find }”
magiskpolicy --live "allow vndservicemanager hal_camera_default dir { search }”
magiskpolicy --live "allow vndservicemanager hal_camera_default file { read }”
magiskpolicy --live "allow vndservicemanager hal_camera_default process { getattr }”
But that didn't fix the camera lag.
This does fix it (largely):
Code:
magiskpolicy --live "permissive camera_prop"
magiskpolicy --live "permissive hal_camera_default"
But obviously this is also shotgun surgery. Anyone with more selinux knowledge willing to chime in here? Perhaps @topjohnwu or @Jman420?
Click to expand...
Click to collapse
Thanks! Those two lines worked for me too using terminal emulator. Did you finally make a Magisk module that do this at start up? If you did may you upload here until a better solution is found? Thanks. Best regards.
I have made it into an app.
Here: https://forum.xda-developers.com/mi-a1/themes/fix-camera-delay-boot-t3742022
Give it root permission after installing. It will run the code every time the device reboots.
Thanks for that fix. I made a magisk module that'll run this on startup, feel free to use this (at your own risk)
Code:
magiskpolicy --live "permissive camera_prop"
magiskpolicy --live "permissive hal_camera_default"
Credit for the fix goes to @Pyrb - I only put his fix into a magisk module
EDIT: taken offline for now. Gonna need to investigate something first.
File reuploaded. I had a bootloop after a second reboot but it worked without any issues since. So use at your own risk:
arnabJ said:
I have made it into an app.
Here: https://forum.xda-developers.com/mi-a1/themes/fix-camera-delay-boot-t3742022
Give it root permission after installing. It will run the code every time the device reboots.
Click to expand...
Click to collapse
Thanksssssss
Pyrb said:
I've seen people recommending to set selinux to permissive to solve camera lag on Oreo rooted with Magisk.
I think that's a pretty bad idea since it completely defeats having selinux at all. Permissive selinux + root is an especially dangerous combination, as explained here by @Jman420.
Now I'm no selinux expert, but I think what would be much better is to explicitly only enable the required permissions.
While looking for this I came across this commit on the sony sepolicy, which explicitly enables some selinux policies to fix camera denials.
Magisk supports modifying selinux policies at runtime using the `magiskpolicy` command. To make this work we should make a magisk module that runs some `magiskpolicy` commands, so effectively we need to translate the granted policies from the linked commit to `magiskpolicy` commands.
This is where I got stuck a little and could use some help.
I tried this:
Code:
magiskpolicy --live "allow hal_camera_default vndbinder_device chr_file { read write }”
magiskpolicy --live "allow hal_camera_default camera_prop file { read }”
magiskpolicy --live "allow hal_camera_default property_socket sock_file { write }”
magiskpolicy --live "allow hal_camera_default gpu_device chr_file { read write }”
magiskpolicy --live "allow hal_camera_default sysfs file { read }”
magiskpolicy --live "allow hal_camera_default hal_graphics_mapper_hwservice hwservice_manager { find }”
magiskpolicy --live "allow hal_camera_default qdisplay_service service_manager { find }”
magiskpolicy --live "allow vndservicemanager hal_camera_default dir { search }”
magiskpolicy --live "allow vndservicemanager hal_camera_default file { read }”
magiskpolicy --live "allow vndservicemanager hal_camera_default process { getattr }”
But that didn't fix the camera lag.
This does fix it (largely):
Code:
magiskpolicy --live "permissive camera_prop"
magiskpolicy --live "permissive hal_camera_default"
But obviously this is also shotgun surgery. Anyone with more selinux knowledge willing to chime in here? Perhaps @topjohnwu or @Jman420?
Click to expand...
Click to collapse
I've discovered that only this line is required:
Code:
magiskpolicy --live "permissive hal_camera_default"
or
Code:
magiskpolicy --live "allow hal_camera_default * * *"
I wasn't able to narrow it down further to which target needed to be allowed. dmesg and kmsg only had one target for hal_camera_default but allowing that didn't fix it.
Localhorst86 said:
Thanks for that fix. I made a magisk module that'll run this on startup, feel free to use this (at your own risk)
Credit for the fix goes to @Pyrb - I only put his fix into a magisk module
EDIT: taken offline for now. Gonna need to investigate something first.
File reuploaded. I had a bootloop after a second reboot but it worked without any issues since. So use at your own risk:
Click to expand...
Click to collapse
Thanks. This works well and no bootloops.
Google camera doesn't seem to work for me if i don't install permissive script. Will this eliminate the need of permissive script for google camera?
ashu.mkb said:
Google camera doesn't seem to work for me if i don't install permissive script. Will this eliminate the need of permissive script for google camera?
Click to expand...
Click to collapse
yes it will.. but u will need camera2 api enabled for gcam to work
---------- Post added at 12:42 PM ---------- Previous post was at 11:55 AM ----------
justin97530 said:
I've discovered that only this line is required:
Code:
magiskpolicy --live "permissive hal_camera_default"
or
Code:
magiskpolicy --live "allow hal_camera_default * * *"
I wasn't able to narrow it down further to which target needed to be allowed. dmesg and kmsg only had one target for hal_camera_default but allowing that didn't fix it.
Click to expand...
Click to collapse
which target was it? can you tell me?
coolkoushik07 said:
yes it will.. but u will need camera2 api enabled for gcam to work
---------- Post added at 12:42 PM ---------- Previous post was at 11:55 AM ----------
which target was it? can you tell me?
Click to expand...
Click to collapse
It was `search` for`qti_debugfs` of type `dir`, but allowing that didn't fix it.
BlackoutOl said:
Yes, you can do it in Terminal emulator.
Type in "su", then grant root-priliviges and then type in the two line of code mentioned above.
For me it works till the next reboot.
Click to expand...
Click to collapse
Where is the magiskpolicy binary meant to be? I'm using Termux that I downloaded from F-Droid and it doesn't seem to be on the path
edit: sorry, it's just in /sbin. not sure why that wasn't on my path.
Localhorst86 said:
Thanks for that fix. I made a magisk module that'll run this on startup, feel free to use this (at your own risk)
Code:
magiskpolicy --live "permissive camera_prop"
magiskpolicy --live "permissive hal_camera_default"
Credit for the fix goes to @Pyrb - I only put his fix into a magisk module
EDIT: taken offline for now. Gonna need to investigate something first.
File reuploaded. I had a bootloop after a second reboot but it worked without any issues since. So use at your own risk:
Click to expand...
Click to collapse
Thank you so much. Both of you guys. Yesterday I unlocked and rooted my phone and after I completed my new setup (I did a factory reset too) I came up to this camera lag issue.
Lucky us, xda is here.
Installed that module in Magisk and worked. Only thing to mention is a bootloop οn firtst boot. After that everything was ok.
start time of camera didn't reduce after applying fix in my case.(both in stock camera & Gcam).
I clean flashed & rooted. Then when i applied cam2 API, & start using Gcam or stock, i saw lag in starting. Even i see lag when i click setting in both camera.
Code:
magiskpolicy --live "permissive camera_prop"
magiskpolicy --live "permissive hal_camera_default"
Both didn't fix any lag.
Also tried
Code:
magiskpolicy --live "allow hal_camera_default surfaceflinger_service service_manager find"
That also didn't fix any lag.
Code:
magiskpolicy --live "allow hal_camera_default * * *"
Above fixed Camera Lag for me. I made a Magisk Module for that.
.:Addicted:. said:
Code:
magiskpolicy --live "allow hal_camera_default * * *"
Above fixed Camera Lag for me. I made a Magisk Module for that.
Click to expand...
Click to collapse
I downloaded directly from Magisk's downloads.
Have you created it?
https://github.com/Magisk-Modules-Repo/MI-A1-Camera-Startup-Lag-Oreo
My camera lag fixed after watching this video
Watch this video:
Hi everyone. The reason i make this thread is to ask for helping. If anybody willingly to build permissive mode kernel for A910F. Very appreciate. If there is somewhere exist, where to find it. I already try to make my own kernel for this model but ive failed at part build the zimage.img. i try to bash script "build_kernel.sh" but fail. I follow all tutorial 100% but still fail. Really appreciate if somebody want to help me
Not a permissive kernel, but in most use cases granting the required selinux permission in an enforcing kernel might be enough, in a terminal emulator use cat /proc/avc_msg or logcat -s audit
For example
type=1400 audit(...): avc: denied { execute } for pid=22889 comm="HwBinder:22882_" path=... dev="tmpfs" ino=... scontext=u:r:hal_audio_default:s0 tcontext=ubject_r:hal_audio_default_tmpfs:s0 tclass=file
In a terminal emulator,
/sbin/magiskpolicy --live "allow hal_audio_default hal_audio_default_tmpfs file execute"
The format is
/sbin/magiskpolicy --live "allow scontext tcontext tclass permission"
The permission "ioctl" uses allowxperm instead.
If it says not found then one of these
su -c /sbin/magiskpolicy
/sbin/supolicy
/system/xbin/supolicy
/su/xbin/supolicy
/su/bin/supolicy
/su/xbin_bind/supolicy
/system/bin/supolicy
/system/bin/magiskpolicy
supolicy
If if says permission denied type su first.
Restart the software that required the permission, and the software that it requires, should revert after restarting the device.