Question 【solved】fastboot flash recovery ,stuck? - Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40

{
"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"
}

no response

then I pull out data cable:
Sending 'recovery' (33496 KB) FAILED (Write to device failed (Invalid argument))
fastboot: error: Command failed

Should try it again.
Also I think you shouldn't reboot your phone, because your phone may become hardbricked if it corrupted the recovery-partition because of the failed flashing process.
I say this, because this happened to me once, I rebooted the phone and it was just a black screen, a hardbrick. ^^ So maybe don't reboot phone.
Just try again. If it doesn't work, restart PC. If it again doesn't work, try reinstalling drivers, or try using a Linux Distro instead of Windows. ^^

sorry if i'm pointing out the obvious, but i take it rec.img is the exact same name as your recovery img you are trying to flash? (the file and flash name must be identical) and also that named rec.img is in the same folder - C/platform-tools?

i thought we shouldn't "fastboot flash recover.img"
and should use "fastboot boot recovery.img"
then go to settings in the recovery and flash current recovery

3zozHashim said:
i thought we shouldn't "fastboot flash recover.img"
and should use "fastboot boot recovery.img"
then go to settings in the recovery and flash current recovery
Click to expand...
Click to collapse
C:\Users\Administrator\Desktop\platform-tools>fastboot boot rec.img
Sending 'boot.img' (33496 KB) FAILED (Write to device failed in SendBuffer() (no link))
fastboot: error: Command failed

reg66 said:
sorry if i'm pointing out the obvious, but i take it rec.img is the exact same name as your recovery img you are trying to flash? (the file and flash name must be identical) and also that named rec.img is in the same folder - C/platform-tools?
Click to expand...
Click to collapse
yes,it is.

3zozHashim said:
i thought we shouldn't "fastboot flash recover.img"
and should use "fastboot boot recovery.img"
then go to settings in the recovery and flash current recovery
Click to expand...
Click to collapse
ahh yes, forgot that with this device! good point.

hellothanku said:
yes,it is.
Click to expand...
Click to collapse
also, another obvious one, i had major flashing issues using USB 3.0/3.1 ports. are you using USB 2.0 ports?

reg66 said:
also, another obvious one, i had major flashing issues using USB 3.0/3.1 ports. are you using USB 2.0 ports?
Click to expand...
Click to collapse
I tried usb 2.0 or 3.0

@Echo off
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "osvc" /t REG_BINARY /d "0000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipContainerIdQuery" /t REG_BINARY /d "01000000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipBOSDescriptorQuery" /t REG_BINARY /d "01000000" /f
pause
run above as bat file (administrator maybe)

hellothanku said:
@Echo off
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "osvc" /t REG_BINARY /d "0000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipContainerIdQuery" /t REG_BINARY /d "01000000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipBOSDescriptorQuery" /t REG_BINARY /d "01000000" /f
pause
run above as bat file (administrator maybe)
Click to expand...
Click to collapse
Is this on the amd fix usb? Also Should i run it once? Im using ryzen cpu

hellothanku said:
@Echo off
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "osvc" /t REG_BINARY /d "0000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipContainerIdQuery" /t REG_BINARY /d "01000000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipBOSDescriptorQuery" /t REG_BINARY /d "01000000" /f
pause
run above as bat file (administrator maybe)
Click to expand...
Click to collapse
What is this lol? What are those Registry keys?

Related

How to unpack/repack initramfs in zImage

Here we go.
I'm saying that I'm not a very good developer so this information could be messy, contain unnecessary works or a bit wrong.
And also I'm not sure if this method will work with every zImage from every device.
I've tested with
I9000-JM2/JM7 : ECLAIR
JPC : FROYO
and they work like a charm.
OK, now we start.
Download this file
http://www.multiupload.com/GSVLO15WDL
It has cross-compiler in it so that it's slightly big.
------------------------------------------------------------
This is basically for devs so I won't tell you specifically. (or I can't...maybe)
1. Extract cpio'ed initramfs file from zImage.
## EDIT : In order to extract initramfs.cpio, go through from step4 to step11.
A file which starts with "30 37 30" means that this is a cpio'ed file.
So, trim the Image-Orig file from the beginning to the point just before "30" then, you've got a cpio compressed file.
You can now simply decompress it.
cat initramfs.cpio | cpio -i --no-absolute-filenames
Click to expand...
Click to collapse
2. Decompress and edit these files. Make sure you shouldn't go over the original size. (simply, I removed redbend_ua in /sbin forder)
3. Recompress to cpio. ( I've used scripts/gen_initramfs_list.sh which is in the kernel source for a safe bet)
## EDIT : What I've done is here. chdir to "zImage_repack/2.6.29" forder then
/bin/bash scripts/gen_initramfs_list.sh -o usr/initramfs_data.cpio -u 0 -g 0 /home/zero/Desktop/JPC/initramfs/i9000_initramfs_list
Click to expand...
Click to collapse
4. open the zImage with a hexeditor.
5. find "1f 8b 08".
6. cut off from the beginning to the point just before the "1f" so that this file begins with "1f 8b 08".
7. save as anyname.gz
8. in terminal >>>> gunzip anyname.gz
Now, you've got an Image file. I'll call this as an Image-Orig.
9. open the Image-Orig file with a hexeditor.
10. remember the entire size of this file. One of mine was "0xb9a5df".
11. find "30 37 30" hexademical code and "TRAILER!!!" text.
12. cut off from the first "30" to the last "!".
an example is here
{
"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"
}
13. open the cpio file you had recompressed with the hexeditor.
14. paste this codes to the exactly same place where the former initramfs was, in Image-Origin file. (Up to now, I feel like English is more difficult than this trick...sigh, sorry for my bad english!)
15. Almost done. We're gonna make the modified Image file's size identically to the Image-Orig. It's simple. just fill the hole with a bunch of NULLs. put your finger on "0" button and have a little sleep.
I think I need a visual assistant.
Save it as "Image".
At this point, you should have an Image file which size is the same as Image-Orig.
Now open the file you've downloaded at the first.
there is a forder called place_Image_here
yeah, place the Image there and execute the "Repack_kernel.sh" file.
In several seconds, you'll have a zImage file.
I'm so tired and I can't last this writing so, if you have any question, I'll give you a reply.
Thanks!
## PLUS : I've attached the modified JPC kernel which supports /system/etc/init.d/userscripts.sh
It's named JPC_modified_kernel.tar.zip and you should take the ".zip" off in order to use with Odin.
## PLUS2 : I've compiled gnu_parted! also attached. good luck, RyanZA!
-info : GNU parted v2.2 (original version, didn't apply bug fixes.)
disabled device-mapper and read-line while compiling, does this matter?
...Wow.
Good job, sir. Good job.
dkcldark said:
1. Extract cpio'ed initramfs file from zImage.
Click to expand...
Click to collapse
I mostly followed along through the later steps and I don't see any issues, but unfortunately the first step leaves me clueless. How would you do that?!
@dkcldark: good job. nice pictures.
Thats what i do to extract initramfs, basically the same. But i have added instructions to extract from kernels compiled by kernel devs here at xda.
(kernels with gzipped cpio)
Uncompressing the zImage:
$ grep -a -b --only-matching $'\x1f\x8b\x08\x00' < zImage
12896:�
$ dd if=zImage bs=1 skip={number from above command} | zcat - > Image
if not gzipped cpio (this one for stock-samsung-kernel):
$ grep -a -b --only-matching '070701' Image
$ dd if=Image bs=1 skip={your first matching number from line above} > initramfs.cpio
else if cpio is gzipped:
$ grep -a -b --only-matching $'\x1f\x8b\x08' < Image
84448:�
2639420:�
Only the first number is interesting, so we can fetch the initramfs:
$ dd if=Image bs=1 skip={your first number, in my case 84448} | gzip -d -c - > initramfs.cpio
Now extract initramfs.cpio:
$ mkdir somedirtoextract
$ cd somedirtoextract/
$ cpio -i --no-absolute-filenames < ../initramfs.cpio
If you want to have device nodes created, make sure you do it as root:
sudo cpio -i --no-absolute-filenames < ../initramfs.cpio
I'm stunned...
wondewring if theres a way to change this:
c002e660 T __initramfs_start
c035d949 T __initramfs_end
I've compiled a short page about extracting initramfs some time ago here: http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
(also accessible from the SGS wiki page).
Please feel free to extend this page with more instructions / scripts on how also re-pack it back.
hi dkcldark, as i sayed i try to do this with the kernel from i5800 galaxy3, but ran into first problem after saving the image-orig.gz, i get a gz filke with a file image-orig with 0 bytes size and extracting results in an error.
hope you can somehow help me. like i sayed already, i am not really used to such blackbelt stuff, just trying to get a working lagfix for the g3
FadeFx said:
hi dkcldark, as i sayed i try to do this with the kernel from i5800 galaxy3, but ran into first problem after saving the image-orig.gz, i get a gz filke with a file image-orig with 0 bytes size and extracting results in an error.
hope you can somehow help me. like i sayed already, i am not really used to such blackbelt stuff, just trying to get a working lagfix for the g3
Click to expand...
Click to collapse
hello would you give me the kernel file please?
I'll have a look and give you an instruction
here you go: http://archiv.to/GET/FILE4C99994EB1316
thanx for help...
As far I understand this method -> Could we have JPK's kernel initramfs repacked in similar manner, to include EXT2/4 support?
Hello.
dkcldark & neldar , What a great work you ´have done!
Unfortunately im lost at the point when to create the Image.
I followed neldar´s instructions to expand zImage to Image and
My files are extracted from JPK kernel and i have edit some files.
What to do?
xan said:
As far I understand this method -> Could we have JPK's kernel initramfs repacked in similar manner, to include EXT2/4 support?
Click to expand...
Click to collapse
ext2 support is (most likely) already in the kernel. the problem with adding ext4 is that we don't have a ext4 module compatible with this kernel and no source (yet) to compile one ... so we have to wait for samsung to release the source ...
@dkcldark, neldar ... awesome tutorials, thanks!
Has anyone figured out how to find the end of the ramdisk when it's compressed? I'm fooling with some Java code to try it, but the inflater class doesn't like the data that should be the start of the compressed data. No idea why yet. I can parse the gzip header, and it's right, but no decompression. From what I have read, gzip doesn't have a trailer, the only way to find the end is to decompress it.
We can decompress it and get the ramdisk contents, but knowing where to put it back in the file is the tricky part.
heh... I convinced GzipInputStream to do my bidding.
humph.. I was going to attach the java code to do it, but XDA is pissing and moaning about me using up a lot of storage space, a whole 35MB apparently. sigh. I'll try to inline it in a code block, hopefully you get the idea. I'll see about creating a little utility to pull, extract, and put back the ramdisk image, basically the hex editor part without the hex editor.
This is a prototype, change the filenames for your system. This will output the decompressed cpio image as well as give you the offsets for where to put it in a hex editor. It's a bit on the slow side, as it uses byte-at-a-time reading. Much like the dd command earlier in the thread. I'll see about buffering the I/O as well, I just wanted to get it out there to hopefully help out.
Another update. I added input buffering and it's a LOT faster. Hope it helps.
Just to make sure there's no question on it, the code is GPL2 licensed. I should have included the banner.
Code:
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
public class FindCompressedRamdisk
{
int numRead = 0;
int totRead = 0;
public FindCompressedRamdisk()
{
try
{
File f = new File("/home/travis/kernel.img");
if (f.exists())
{
FileInputStream in = new FileInputStream(f);
byte[] rData = new byte[4096];
byte[] oData = new byte[4096];
byte[] gzipKey = { 0x1F, (byte) 0x8B, 0x08, 0x00 };
int pos = 0;
while ((numRead = in.read(rData)) != -1)
{
pos = findBytes(rData, numRead, gzipKey);
if (pos != -1)
{
int start = pos + totRead;
System.out.println("GZIP Start: " + start);
in.close();
in = new FileInputStream(f);
in.skip(start);
InputStream gin = new BufferedInputStream(new GZIPInputStream(in));
int len = 0;
OutputStream out = new BufferedOutputStream(new FileOutputStream("/home/travis/out.img"));
int b;
for ( ; (b = gin.read()) != -1; len++)
{
out.write(b);
}
System.out.println("GZIP End: " + len);
out.close();
break;
}
totRead += numRead;
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
public int findBytes(byte[] data, int dSize, byte[] search)
{
int found = -1;
for (int i = 0; i < dSize && found == -1; i++)
{
if (data[i] == search [0])
{
for (int j = 1; j < search.length; j++)
{
if (data[i + j] != search[j])
break;
if (j == search.length-1)
found = i;
}
}
}
return found;
}
/**
* @param args
*/
public static void main(String[] args)
{
FindCompressedRamdisk rd = new FindCompressedRamdisk();
}
why i could see the graphs??????
Dkcldark did you find a way for the i5800 zimage i provided?
jodue said:
ext2 support is (most likely) already in the kernel. the problem with adding ext4 is that we don't have a ext4 module compatible with this kernel and no source (yet) to compile one ... so we have to wait for samsung to release the source ...
@dkcldark, neldar ... awesome tutorials, thanks!
Click to expand...
Click to collapse
I am perfectly happy with either EXT2/4 (no comments here).
can you tell me how to unpack the factoryfs.rfs ?
I grep the '1F8B0B' and cut the bytes (between '1F8B0B' and 'another 1F8B0B') to a file,,,,a.img,,,,then gunzip it,,,but console println " gzip: a.img is encrypted -- not supported "
why?
sharetop said:
can you tell me how to unpack the factoryfs.rfs ?
I grep the '1F8B0B' and cut the bytes (between '1F8B0B' and 'another 1F8B0B') to a file,,,,a.img,,,,then gunzip it,,,but console println " gzip: a.img is encrypted -- not supported "
why?
Click to expand...
Click to collapse
That's a filesystem image for the /system partition IIRC. I have used it on my phone via a loopback mount, but you can't extract stuff from it using this method. This is for zImage files.
sharetop said:
can you tell me how to unpack the factoryfs.rfs ?
I grep the '1F8B0B' and cut the bytes (between '1F8B0B' and 'another 1F8B0B') to a file,,,,a.img,,,,then gunzip it,,,but console println " gzip: a.img is encrypted -- not supported "
why?
Click to expand...
Click to collapse
You can't. The easiest way to unpack factory.rfs (if you don't have linux) is to copy it to your phone, mount it in a directory using a loopback device, and copy everything from it to another directory on your sdcard.
thank you. If i have a linux system, can i copy the .rfs to ubuntu, then mount it as a virtual device?

[Script]RemEdit (Easy and quick remote file editing)

I made this script a while ago, its an easy yet effective script. the purpose is to directly edit (text) files from your rom, on your pc. it works like this: you enter the path of the file that you want to edit on your phone: "remedit /system/etc/gps.conf" for example, will open gps.conf from your phone in your default text editor, when you are done with the changes you just save it and close the window. then in the shell press enter and the file will be pushed back to your device with the same permissions. Not anything special but just a handy script to make modding/testing just a bit easier.
Global access to the adb binary is required, it can be done by adding this line to .bashrc
.bashrc
Code:
export PATH=${PATH}:~/android-sdk/platform-tools
The script:
~/bin/remedit
Code:
#!/bin/bash
#Edit files on your phone like editing local files
#Copyright 2013 broodplank.net
#Revision 3
if [[ $1 = "" ]]; then
echo "usage: remedit [remote path]"
echo " example: remedit /system/build.prop"
exit
else
DIR=${1%/*}
FILE=${1##*/}
fi;
if [[ -e mode ]]; then
rm -f mode
fi;
adb get-state > state
export DEVICESTATE=`cat state`;
rm -f state
if [[ ${DEVICESTATE} != 'device' ]]; then
echo "Waiting for device..."
echo "Make sure debugging mode is enabled"
adb 'wait-for-device'
echo "Device found"
fi;
adb -d shell ls -l ${1} | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
*2^(8-i));if(k)printf("%0o ",k);print}' > mode
if [[ -e modenew ]]; then
rm -f modenew
fi;
head -c 3 mode > modenew
export FILEMODE=`cat modenew`;
if [[ -e mode ]]; then
rm -f mode
fi;
if [[ -e modenew ]]; then
rm -f modenew
fi;
echo
echo "Remote Path: '${DIR}'"
echo "Remote File: '${FILE}'"
echo "Remote Mode: '${FILEMODE}'"
echo
cd ${PWD}
if [[ -e $FILE ]]; then
rm -f $FILE
fi;
adb pull $1 $FILE
xdg-open $FILE
echo
echo "Press enter when you're done editing the file"
read -p [enter]
echo
adb remount
adb push $FILE $1
adb -d shell busybox chmod ${FILEMODE} ${1}
echo
echo "Pushed new version of: ${FILE} located in: ${DIR} with mode: ${FILEMODE}"
if [[ -e $FILE ]]; then
rm -f $FILE
fi;
Output:
{
"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"
}

[Script]Tools Menu v.05

IF USING AN OLD VER RUN THE UNINSTALL BEFORE INSTALLING A NEW VER
This is a batch file i made to install a tools menu i made. it came to be out of me being lazy and not wanting to have to open menus or hold shift
i did not make the scripts that some of the options use(credit is in the script).
see pictures to see the options and what it looks like in the end
IF ON WINDOWS RT YOU MUST BE JAILBROKEN TO USE. Thanks GoodDayToDie, it is now perfect
Main
{
"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"
}
Install
Uninstall
Installs finished
Tools
Power
Power with extras
Changelog
v0.2 - added open powershell as admin here, fixed open cmd as admin here, no longer need ele.exe and the e.cmd file
v0.3 - able to remove the restart explorer.bat file thanks to coldbloc
v0.4 - added power menu. normal has lock, logoff, restart, restart with boot options, and shut down. the second has all of the first but sleep, hibernate, and switch user.
v0.5 - fixed an issue in the hidden files vbs(thanks LEDelete for pointing it out), fixed missing icon folder copy command in install script (thanks trm96 for pointing that out) should fix icons not showing up
the script has some swears i found them funny, again the script was made for me i just figured others my find it helpful.
if the icons dont show up reboot
Download Tools Menu
Looks cool.
So imagine I copy a registry key to my clipboard, does this regedit command capture it and open directly ? I checked, it only opens registry. Wonder if this MJ snippet would work in RT.
http://forums.mydigitallife.info/threads/38208
FYI, I don't prefer to kill-explorer like that, I think some settings that are not finalized until logoff can be lost when doing so, so instead I just logoff. But to each his own.
You can also change the position setting and the flyout will move to top or bottom of your menu. Make change in same key as the muiverb.
Code:
[FONT=monospace]
[/FONT][HKEY_CLASSES_ROOT\Directory\background\shell\Tools]
"MUIVerb"="Tools"
"SubCommands"="regedit.Tools;Open Admin Cmd here.Tools;Open Cmd Here.Tools;Files Extensions.Tools;Hidden Files.Tools;Restart Explorer.Tools"
"Icon"="C:\\Windows\\tools.ico"
"Position"="Top"
I forget the trick to add an extra divider line.
EDIT: I've never been able to get more then 12 subcommands even with nested flyouts, if anyone knows how I am all ears.
coldbloc said:
Looks cool.
So imagine I copy a registry key to my clipboard, does this regedit command capture it and open directly ? I checked, it only opens registry. Wonder if this MJ snippet would work in RT.
http://forums.mydigitallife.info/threads/38208
FYI, I don't prefer to kill-explorer like that, I think some settings that are not finalized until logoff can be lost when doing so, so instead I just logoff. But to each his own.
You can also change the position setting and the flyout will move to top or bottom of your menu. Make change in same key as the muiverb.
Code:
[FONT=monospace]
[/FONT][HKEY_CLASSES_ROOT\Directory\background\shell\Tools]
"MUIVerb"="Tools"
"SubCommands"="regedit.Tools;Open Admin Cmd here.Tools;Open Cmd Here.Tools;Files Extensions.Tools;Hidden Files.Tools;Restart Explorer.Tools"
"Icon"="C:\\Windows\\tools.ico"
"Position"="Top"
I forget the trick to add an extra divider line.
DIT: I've never been able to get more then 12 subcommands even with nested flyouts, if anyone knows how I am all ears.
Click to expand...
Click to collapse
tbh the reason i didnt put a position in is i couldnt decide where i wanted it and where it was worked with the rest of the stuff in my context.
as for restarting explorer i run in testmode 24/7 so after i remove the watermarks i just restart explorer rather then logging off. its also helpful if explorer decides to lock up.
well i was bored so i added the option to choose position to it
pbanj said:
i run in testmode 24/7 so after i remove the watermarks
Click to expand...
Click to collapse
That sounds like you have to do it every reboot. Are the mui files protected in RT and we are unable to edit the watermark permanently ?
If I write a snip to add powershell run-as admin would you add it to your Tool™
coldbloc said:
That sounds like you have to do it every reboot. Are the mui files protected in RT and we are unable to edit the watermark permanently ?
If I write a snip to add powershell run-as admin would you add it to your Tool™
Click to expand...
Click to collapse
not at every boot once its done its done but i added it as it was more for when i do fresh installs, im adding it in now
edit one
i was able to get the admin cmd to work without the need of the extra files so those have been removed. i will be uploading it in a few min
edit two
new ver is uploaded, i added a ver number to it to help me keep track of it. you will have to run the uninstall part in the old one first before running the install on this as i have removed some unneeded stuff
pbanj said:
not at every boot once its done its done but i added it as it was more for when i do fresh installs, im adding it in now
edit one
i was able to get the admin cmd to work without the need of the extra files so those have been removed. i will be uploading it in a few min
edit two
new ver is uploaded, i added a ver number to it to help me keep track of it. you will have to run the uninstall part in the old one first before running the install on this as i have removed some unneeded stuff
Click to expand...
Click to collapse
That's a different way of doing it. Lately for elevation most people are using APPCOMPATFLAGS or an inline elevator script. Had never seen an example using just "ExplorerCommandHandler" and "ImpliedSelectionModel" settings before.
http://windowssucks.wordpress.com/file-type-registration/
Does that only work on newer builds, I searched my W7x64 registry for that canonical GUID (the powershell one) didn't come up with anything. Where did you find it.
coldbloc said:
That's a different way of doing it. Lately for elevation most people are using APPCOMPATFLAGS or an inline elevator script. Had never seen an example using just "ExplorerCommandHandler" and "ImpliedSelectionModel" settings before.
http://windowssucks.wordpress.com/file-type-registration/
Does that only work on newer builds, I searched my W7x64 registry for that canonical GUID (the powershell one) didn't come up with anything. Where did you find it.
Click to expand...
Click to collapse
i found it in a program that adds items to the context menu but when it added powershell it would crash explorer so i used it as a base and started messing with it until it worked without crashing explorer(fun times). im not sure if it works in windows 7 as im on 8.1
Understood, not available in W7, likely only 8.0 and up. I find it here in W8.1.
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{BF0AC53F-D51C-419F-92E3-2298E125F004}]
@="Open Powershell as Admin Command"
[HKEY_CLASSES_ROOT\CLSID\{BF0AC53F-D51C-419F-92E3-2298E125F004}\InProcServer32]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,00,00
"ThreadingModel"="Apartment"
Maybe can even use the GUID list of control panel items the same way.
http://msdn.microsoft.com/en-us/library/windows/desktop/ee330741(v=vs.85).aspx
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\OAPS.Tools]
"ImpliedSelectionModel"=dword:00000001
"Icon"="imageres.dll,-5373"
"ExplorerCommandHandler"="{BF0AC53F-D51C-419F-92E3-2298E125F004}"
@="Admin Pshell Here"
and I remembered how to do the divider line trick.
Code:
"SubCommands"="regedit.Tools;|;OACh.Tools;OCH.Tools;|;OAPS.Tools;|;FE.Tools;HF.Tools;|;RE.Tools"
Think you can get rid of the Restart_Explorer.bat with this.
http://www.robvanderwoude.com/condexec.php
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\RE.Tools]
"Icon"="C:\\Windows\\explorer.exe"
"MUIVerb"="Restart Explorer"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\RE.Tools\command]
@="taskkill /f /im explorer.exe && start explorer.exe"
and this could toggle file extensions, without the .vbs
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools]
"Icon"="C:\\Windows\\file.ico"
"MUIVerb"="Files Extensions"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools\command]
@="start /wait /b powershell -command \"$check = (Get-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt').HideFileExt;if ($check -eq 0){Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 1} else {Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 0}\""
;
;
coldbloc said:
Think you can get rid of the Restart_Explorer.bat with this.
http://www.robvanderwoude.com/condexec.php
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\RE.Tools]
"Icon"="C:\\Windows\\explorer.exe"
"MUIVerb"="Restart Explorer"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\RE.Tools\command]
@="taskkill /f /im explorer.exe && start explorer.exe"
and this could toggle file extensions, without the .vbs
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools]
"Icon"="C:\\Windows\\file.ico"
"MUIVerb"="Files Extensions"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools\command]
@="start /wait /b powershell -command \"$check = (Get-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt').HideFileExt;if ($check -eq 0){Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 1} else {Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 0}\""
;
;
Click to expand...
Click to collapse
tried both of those with no luck, the restart explorer one made a cmd window pop up real fast, all i could see was it said invalid something. the file extension one didnt do anything
i would love to be able to get rid of the scripts
pbanj said:
tried both of those with no luck, the restart explorer one made a cmd window pop up real fast, all i could see was it said invalid something. the file extension one didnt do anything
i would love to be able to get rid of the scripts
Click to expand...
Click to collapse
On the file extension, I forget the refresh. Here is the snip, it goes somewhere near the end. FYI, I need rewrite it registry > cmd > powershell escape character safe.
I want to be sure it's just the refresh causing the problem and that the registry still got toggled, proving the powershell did run in the background and was not stopped by execution policy. Will you confirm by running the old script and manually hitting refresh.
Code:
;[void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');[System.Windows.Forms.SendKeys]::SendWait('{F5}');
coldbloc said:
On the file extension, I forget the refresh. Here is the snip, I need rewrite it registry > cmd > powershell escape character safe (triple double quotes nesting issues mostly).
I want to be sure it's just the refresh causing the problem and the registry still got toggled, meaning the powershell did run in the background. Will you confirm by running the old script and manually hitting refresh to verify.
Code:
[void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');[System.Windows.Forms.SendKeys]::SendWait("{F5}")
Click to expand...
Click to collapse
i thought it might not have been refreshing so i tried that and it still didnt change
pbanj said:
i thought it might not have been refreshing so i tried that and it still didnt change
Click to expand...
Click to collapse
So you are on 8.1 RT, with powershell policy enabled and it still doesn't work.
Been bing'ing around for RT Powershell Limitations and it seems Microsoft might be the reason it doesn't work. Don't have RT hardware to test, cannot find a VM emulator either.
http://www.contextis.com/research/blog/windows-rt-and-powershell/
http://social.technet.microsoft.com...vated-but-on-windows-rt-ie-surface?forum=ITCG
http://www.reddit.com/r/netsec/comments/1khcw0/windows_rt_and_powershell/
coldbloc said:
So you are on 8.1 RT, with powershell policy enabled and it still doesn't work.
Been bing'ing around for RT Powershell Limitations and it seems Microsoft might be the reason it doesn't work. Don't have RT hardware to test, cannot find a VM emulator either.
http://www.contextis.com/research/blog/windows-rt-and-powershell/
http://social.technet.microsoft.com...vated-but-on-windows-rt-ie-surface?forum=ITCG
http://www.reddit.com/r/netsec/comments/1khcw0/windows_rt_and_powershell/
Click to expand...
Click to collapse
im on normal 8.1 pro with media center
pbanj said:
im on normal 8.1 pro with media center
Click to expand...
Click to collapse
OK, is my bad then. Found the issue with Restart Explorer. Working on 2012-R2
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\RE.Tools]
"Icon"="C:\\Windows\\explorer.exe"
"MUIVerb"="Restart Explorer"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\RE.Tools\command]
@="\"C:\\Windows\\System32\\cmd.exe\" /c \"taskkill /f /im explorer.exe & start explorer.exe\""
coldbloc said:
OK, is my bad then. Found the issue with Restart Explorer. Working on 2012-R2
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\RE.Tools]
"Icon"="C:\\Windows\\explorer.exe"
"MUIVerb"="Restart Explorer"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\RE.Tools\command]
@="\"C:\\Windows\\System32\\cmd.exe\" /c \"taskkill /f /im explorer.exe & start explorer.exe\""
Click to expand...
Click to collapse
that one works like a charm, i added it to the regfiles and added a mention to u in the changelog
updated it again, i added power options to the context menu it only shows on the desktop and i did not give it the option to have its position changed
Fixed the toggle file extensions added restart explorer kludge
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools]
"Icon"="C:\\Windows\\file.ico"
"MUIVerb"="Files Extensions"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools\command]
@="cmd /c start /wait /b powershell -command \"$check = (Get-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt').HideFileExt;if ($check -eq 0){Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 1} else {Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 0};taskkill /f /im explorer.exe;explorer.exe\""
coldbloc said:
Fixed the toggle file extensions added restart explorer kludge
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools]
"Icon"="C:\\Windows\\file.ico"
"MUIVerb"="Files Extensions"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools\command]
@="cmd /c start /wait /b powershell -command \"$check = (Get-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt').HideFileExt;if ($check -eq 0){Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 1} else {Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 0};taskkill /f /im explorer.exe;explorer.exe\""
Click to expand...
Click to collapse
if it didnt restart explorer it would be better then it is now.
pbanj said:
if it didnt restart explorer it would be better then it is now.
Click to expand...
Click to collapse
Fixed the toggle file extensions sans restart explorer kludge
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools]
"Icon"="C:\\Windows\\file.ico"
"MUIVerb"="Files Extensions"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools\command]
@="cmd /c start /wait /b powershell -command \"$check = (Get-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt').HideFileExt;if ($check -eq 0){Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 1} else {Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 0}\""
coldbloc said:
Fixed the toggle file extensions sans restart explorer kludge
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools]
"Icon"="C:\\Windows\\file.ico"
"MUIVerb"="Files Extensions"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\FE.Tools\command]
@="cmd /c start /wait /b powershell -command \"$check = (Get-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt').HideFileExt;if ($check -eq 0){Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 1} else {Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced' -Name 'HideFileExt' -Value 0}\""
Click to expand...
Click to collapse
im looking but finding it but maybe u know it, is there a way to have it send the f5 key with powershell?

Windows RT EditionID

Would someone with Windows 8.0 RT (or 8.1) run this powershell command and post back the EditionID string.
Code:
(Get-ItemProperty -Path 'registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name 'EditionID').EditionID
#
Code:
C:\Users\Nathan>reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /f EditionID
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
EditionID REG_SZ CoreARM
End of search: 1 match(es) found.

Huawei G9 Plus/ Nova Plus mods

I bought G9 plus, but for now it is on the way to me. I'm curious is somebody tried to enable camera 2 api? 1080p 60fps video recording? Raw photo? Double tap wake up? Stereo video recording without ugly noise cancellation?
Who wants to try, do it at your own risk, but i will be Grateful if you can check this mods.
Enable double tap wake up, works on mate 8. original theme https://forum.xda-developers.com/mate-8/general/enable-double-tap-to-wake-t3312676
I checked in g9 plus there is hw_easywakeupmotion_config.xml with mentioned lines, so mod should work in g9 plus too.
1) Go into system/build.prop and open it in your favorite text editor. Find the line that says ro.config.hw_easywakeup=false and change the false to true then save your changes.
2) Go to system/emui/base/xml and open up the hw_easywakeupmotion_config.xml in your favorite text editor. Find the line that says <EasyWakeupMotion name="Double_Touch" support="1" value="0" flag="0" keycode="131" /> and change the value=0 to value=1 then save your changes.
3) Restart your phone
4) Go into Settings/Smart Assistance/Motion Control and at the bottom you will now see Double Touch. Turn it on.
5) Restart your phone and you will have Double Tap to Wake enabled and working.
Enable camera2 api
add to bottom of build.prop
string:
persist.camera.HAL3.enabled=1
after saving changes to build.prop i think reboot required to changes take effect
you can test if camera2 api start work with app https://play.google.com/store/apps/details?id=pl.vipek.camera2_compatibility_test&hl=ru
or
1. Open terminal and issue command:
getprop | grep camera
If it's running, you should be able to find a line
persist.camera.HAL3.enabled 1
{
"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"
}
Enable RAW capture in the stock EMUI camera app source https://forum.xda-developers.com/huawei-p9lite/how-to/guide-enable-raw-capture-stock-camera-t3623530
1. Ensure your device is rooted
2. Use a root file explorer and navigate to /system/emui/lite/prop/local.prop and open the file as text.
3. Change the value of ro.build.hw_emui_lite.enable from true to false
4. Save the file
5. Reboot the device
6. Open the stock Camera app
7. Enable Pro Photo mode
8. Go to settings and enable RAW.
Happy shooting, happy editing.
If you know some more mods, please post in this thread.
My thoughts about video stereo recording, can some one test it?
1. backup /vendor/etc/mixer_paths.xml
2. in /vendor/etc/mixer_paths.xml
Code:
<path name="camcorder-mic">
<path name="handset-mic" />
change to
Code:
<path name="camcorder-mic">
<path name="speaker-dmic-endfire" />
or
Code:
<path name="camcorder-mic">
<path name="dmic-endfire" />
after saving changes to /vendor/etc/mixer_paths.xml reboot required to changes take effect
Good news!) Huawei NOVA can shoot in HDR+ by simple enabling camera2api and installing gcam.
Sample photos here http://4pda.ru/forum/index.php?showtopic=769885&view=findpost&p=64314965
That is mean Huawei NOVA Plus can this too!!)
"Enable double tap wake up" doesn't supported because lack of kernel and touch driver support.
Enable camera2 api SUCCESS!!)
Enable RAW capture in the stock EMUI camera app failed
Samples G9 Plus Gcam 3.2.045 HDR+ (HAL3) vs ~ default camera (HAL1)​
G9 Plus Gcam 3.2.045 HDR+(HAL3)
Lumio camera = almost default camera (HAL1)
Macro examples HDR+​
Fix Huawei accelerometer tilt
Fix accelerometer tilt​
Video of issue https://yadi.sk/i/fPoYgs3O3N5ssc​In russian language, with history of finding way to manage http://4pda.ru/forum/index.php?showtopic=846874&view=findpost&p=66664464
The instruction for editing the X-axis, similarly can be corrected Y, Z axis too
1. Turn on logcat, it's more convenient through the computer
2. Run any program that uses an accelerometer, wait few secconds
3. Stop the logcat, and look for something like this in it:
10-16 21:30:03.124: I/qti_sensors_hal(1396): read from oem info: data_readback
10-16 21:30:03.124: I/qti_sensors_hal(1396): 0xb3, 0x71, 0x4f, 0xbf
10-16 21:30:03.124: I/qti_sensors_hal(1396): 0x66, 0x92, 0xed, 0x3d
10-16 21:30:03.124: I/qti_sensors_hal(1396): 0xbf, 0xa0, 0x7f, 0x3f
10-16 21:30:03.124: I/qti_sensors_hal(1396): 0x55, 0x0, 0x0, 0x0
10-16 21:30:03.124: I/qti_sensors_hal(1396): 0x0, 0x0, 0x0, 0x0
10-16 21:30:03.124: E/qti_sensors_hal(1396): read from oem info: data_valid_flag=0x55
10-16 21:30:03.124: E/qti_sensors_hal(1396): read from oem info: x_offset=-0.810329, y_offset=0.116002, z_offset=0.998547
10-16 21:30:03.124: E/qti_sensors_hal(1396): Final value: x_offset=-0.810329, y_offset=0.116002, z_offset=0.998547
Click to expand...
Click to collapse
4. Open file /dev/block/platform/soc/7824900.sdhci/by-name/oeminfo through "hex редактор" https://play.google.com/store/apps/details?id=tuba.tools.hexfull&hl=ru
5. Looking for hex values from logcat in oeminfo, in my case this is: b3 71 4f
6. Find right hex values - change, save, start the logcat look at the line E/qti_sensors_hal(1396): Final value: x_offset=-0.810329, if there is a change in the right way - more / less, depending on the nature of accelerometer tilt error of your phone, then continue to change the value until you achieve desired values of x_offset. You can use values from the neighboring Y, Z axes if you think they are right for you. For example, first I inserted values from the line 0x66, 0x92, 0xed, 0x3d and got x_offset about 0.1. But I needed x_offset = 0.0 for this I go further and found out that is b3 39 0 0 is x_offset = 0.0 for me.
7. Enjoy that now you have accelerometer that show correct level
​

Categories

Resources