Related
i found a way to root i909
download the rar
unrar and run the start_root.bat
because i909 hasn't the xbin i have change xbin to bin in the com.sh
before u root ,u must install the samsung usb driver
and change to the debug model
View attachment FascinateRoot_v02.zip
you should be able to use update.zip from the i9000
and edit it to include i909 and then root the phone
example
Code:
assert(getprop("ro.product.device") == "GT-I5800" ||
getprop("ro.build.product") == "GT-I5800" ||
getprop("ro.product.device") == "GT-I9000" ||
getprop("ro.build.product") == "GT-I9000" ||
[COLOR="Red"] getprop("ro.product.device") == "GT-I9000M" ||
getprop("ro.build.product") == "GT-I9000M" ||[/COLOR]
getprop("ro.product.device") == "SGH-T959" ||
getprop("ro.build.product") == "SGH-T959"
);
change the update.zip to include the I909 or whatever it's the full code name
i have root my i909 by this way
Hi Guys, up for this. Can you please further elaborate and explain how to do this?
bqwd36 said:
i found a way to root i909
download the rar
unrar and run the start_root.bat
because i909 hasn't the xbin i have change xbin to bin in the com.sh
before u root ,u must install the samsung usb driver
and change to the debug model
View attachment 413221
Click to expand...
Click to collapse
KIS 2011 warning that file as Trojan virus
What should I do
Rooted Samsung SCH-i909
After countless of hours, I finally rooted my Samsung Galaxy S SCH-I909 (yes, that dual-sim CDMA/GSM phone from China) using SuperOneClick. My I909 was upgraded to Froyo.EC04 (firmware 2.2.1) via Samsung Kies from stock. Then I tried various methods with no luck until I gave it a final shot using SuperOneClick. Now I would find a way to backup my system before going further. Good luck and happy rooting.
Hi All,
I'm trying to flash the latest MIUI 2.11.30 to my Galaxy SIII int without success.
I'd like to not install the chinese stock as requested on the MIUI site so I'm asking if someone was able to flash it from recovery on another rom.
Now I'm on Omega 3.33 with TWRP recovery but I also tried with Paranoid 2.54 and CWM touch without success.
I always get this error message:
Code:
assert failed: getprop("ro.product.device") == "~truncated
getprop("ro.build.product") == "m0" || ge~truncated
E:Error in "zip file path" (status 7)
Error flashing zip "zip file path"
Anyone knows a possible solution?
Thank you very much!
Bye.
Try altering the install script in the zip file to say "galaxys3" instead of "m0".
Sent from my GT-I9300 using Tapatalk 2
Theshawty said:
Try altering the install script in the zip file to say "galaxys3" instead of "m0".
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Thanks for the advice, no luck with that but I solved it removing this assert statement:
Code:
assert(getprop("ro.product.device") == "m0" ||
getprop("ro.build.product") == "m0" || getprop("ro.product.device") == "m0" || getprop("ro.build.product") == "m0");
from this file inside the zip:
META-INF\com\google\android\updater-script
Thanks again for the advice, I took a look around and I saw that. :good:
Bye!
Now that it's solved, Thread closed.
Starting from the 7.1.2 ROMs most of the developers decided to follow the process of checking modem version at the time of flashing the rom. This is to know that the bootloader is unlocked officially or unofficially. Many people ended up in
"Error 7- assert(xiaomi.verify_modem("MSM8976.LA.1.0.c3-30041-STD.PROD-1.77504.1.83742.1") == "1")"
Searched the net and haven't found any concrete solution?
Don't worry. It is very easy to solve this error.
If you have unofficially unlocked and/or are using a custom ROM and are getting the error follow the following steps:
1. Download the latest Redmi Note 3 Fastboot ROM from Here (Don't download .zip file.. Download the .tgz file and download the latest version)
2. Download the MI Flash tool from the Mi Forums ( the latest version recommended)
3. Extract the .tgz file in Step 1 and start Mi Flash tool
4. Boot your device in fastboot mode by the vol down+power button combo
5. Select the extracted folder in step 3 in Mi flash tool
6. Attach your phone through usb and press refresh.
7. Select clean all and lock in the bottom bar and then press flash. (WARNING: You will lose your data. Thus a backup is recommended)
8. After the flashing completes successfully, your device will reboot. Complete the set up and Login into your mi account on the device.
9. Request Permissions from Xiaomi to unlock your bootloader from Here.
It's very easy to get the permission. If lucky, you might get the permission in about 15 mins.
10. Unlock your bootloader using the steps provided by the site itself.
11. After unlocking your device, download twrp from here.
12. Flash twrp using "fastboot flash recovery ~path to twrp.img~" in the command line
13. Boot into twrp using vol up + power button combo
Ta-da! You now have a custom recovery and can now flash whichever ROM you want to. I'd personally suggest you to flash MIUI 8.6 but you have the liberty to flash any ROM.
If you have a locked bootloader, follow from Step 9.
If you still have any issues drop em down.
Reference: https://forum.xda-developers.com/redmi-note-3/how-to/guide-error-7-solution-flashing-7-1-2-t3621767
The above site also mentions a temporary solution if you fail to get your bootloader officially unlocked.
You can also download a firmware update package for Redmi Note 3 from Here. Haven't tried it though but I guess this can be an alternative solution for those who failed to get permission to unlock their bootloader.
just a small edit..
its not fastboot mode that you require for flashing via miflash tool its edl mode..
the firmware by REEMAR given at last worked for me but the other firmware didn't , anyway thanks mate
I had the same problem, you need to unzip the zip file of the lineage rom, and edit updater-script with notepad, located in the \ META-INF \ com \ google \ android folder. You remove all the lines and place the following. It is a problem in the criterion of the command "assert"
Assert (getprop ("ro.product.device") == "kate" || getprop ("ro.build.product") == "kate" || getprop ("ro.product.device") == "kenzo "Getprop (" ro.build.product ") ==" kenzo "|| abort (" E3004: This package is for device: kate, kenzo; this device is "+ getprop (" ro.product.device ") + "."); Ui_print ("Target: Xiaomi / kenzo / kenzo: 6.0.1 / MMB29M / V8.2.1.0.MHOCNDL: user / release-keys"); Ifelse (is_mounted ("/ system"), unmount ("/ system")); Package_extract_dir ("install", "/ tmp / install"); Set_metadata_recursive ("/ tmp / install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644); Set_metadata_recursive ("/ tmp / install / bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755); Mount ("ext4", "EMMC", "/ dev / block / bootdevice / by-name / system", "/ system", ""); Run_program ("/ tmp / install / bin / backuptool.sh", "backup"); Unmount ("/ system"); If is_mounted ("/ data") then Package_extract_file ("META-INF / org / lineageos / releasekey", "/ tmp / releasekey"); Run_program ("/ tmp / install / bin / otasigcheck.sh")! = "31744" || Abort ("Can not install this package on top of incompatible data. Please try another package or run a factory reset"); Else Mount ("f2fs", "EMMC", "/ dev / block / bootdevice / by-name / userdata", "/ data", ""); Package_extract_file ("META-INF / org / lineageos / releasekey", "/ tmp / releasekey"); Run_program ("/ tmp / install / bin / otasigcheck.sh")! = "31744" || Abort ("Can not install this package on top of incompatible data. Please try another package or run a factory reset"); Unmount ("/ data"); Endif; Show_progress (0.750000, 0); Ui_print ("Patching system image unconditionally ..."); Block_image_update ("/ dev / block / bootdevice / by-name / system"), package_extract_file ("system.transfer.list"), "system.new.dat", "system.patch.dat") || Abort ("E1001: Failed to update system image."); Show_progress (0.020000, 10); Mount ("ext4", "EMMC", "/ dev / block / bootdevice / by-name / system", "/ system", ""); Run_program ("/ tmp / install / bin / backuptool.sh", "restore"); Unmount ("/ system"); Show_progress (0.050000, 5); Package_extract_file ("boot.img", "/ dev / block / bootdevice / by-name / boot"); Show_progress (0.200000, 10); Set_progress (1.000000);
After saving, without modifying the file extension, recompress the file in .zip
Now you can flasher via TWRP
Just update your firmware to 7.7.6 extracted by Thestrix,issue will be settled.
It worked for me.
Although Aroma installer is great, development on it stopped a while ago and many devices aren't compatible with it. However the ability for selections in an installer hasn't been completely lost. You can use the volume keys to make selections through a couple different methods.
Note that this needs put into a shell script so either you need to have the updater-script call a shell script or use a dummy updater-script and have it in the update-binary
This combines both methods of volume key selection that I've stumbled across.
The one in the choose method is by @Chainfire and is from his VerifiedBootSigner zip.
The one in the chooseold method uses the keycheck binary by someone755. The original idea was by @Zappo here which I modified a bit to not use the timeout binary since it was a bit wonky when I tested it and to work with any volume key setup. I think the keycheck binary is arm compiled but not sure.
First thing that happens though is that it attempts to get the selection from the zip name. The user can add new or old to the zip (make sure there are no spaces) and skip the whole volume key thing (useful if neither vol key method works on their device - note that this won't work with tools like magisk manager which rename the zip to "install.zip" when flashing).
Second is that the keytest function is run. This is by me tests the chainfire method. One of his comments is that his method needs to be tested with older versions of android and sure enough, it doesn't work properly on many. So the keytest function tests the chainfire method and checks for an error. If there is no error, the installer will use the choose (chainfire) method. If there is an error, it'll use the chooseold (keycheck) method. I favor chainfire's because it's not reliant on a 3rd part binary that may not work with x86 and other devices with unusual cpu architectures
Third, the selection process is run. If using choose, the user makes their selection and the installer continues. If using chooseold, the installer will prompt the user to enter volume up, then volume down. This "programs" the vol keys for that device since it may vary between devices. Then the user makes their selection and the installer moves on.
Here's the code. At the bottom of it are 2 comments where you can put your stuff you want to have happen depending on the selection.
Code:
# Get option from zip name if applicable
case $(basename $ZIP) in
*new*|*New*|*NEW*) NEW=true;;
*old*|*Old*|*OLD*) NEW=false;;
esac
# Change this path to wherever the keycheck binary is located in your installer
KEYCHECK=$INSTALLER/keycheck
chmod 755 $KEYCHECK
keytest() {
ui_print "- Vol Key Test -"
ui_print " Press a Vol Key:"
(/system/bin/getevent -lc 1 2>&1 | /system/bin/grep VOLUME | /system/bin/grep " DOWN" > $INSTALLER/events) || return 1
return 0
}
choose() {
#note from chainfire @xda-developers: getevent behaves weird when piped, and busybox grep likes that even less than toolbox/toybox grep
while true; do
/system/bin/getevent -lc 1 2>&1 | /system/bin/grep VOLUME | /system/bin/grep " DOWN" > $INSTALLER/events
if (`cat $INSTALLER/events 2>/dev/null | /system/bin/grep VOLUME >/dev/null`); then
break
fi
done
if (`cat $INSTALLER/events 2>/dev/null | /system/bin/grep VOLUMEUP >/dev/null`); then
return 0
else
return 1
fi
}
chooseold() {
# Calling it first time detects previous input. Calling it second time will do what we want
$KEYCHECK
$KEYCHECK
SEL=$?
if [ "$1" == "UP" ]; then
UP=$SEL
elif [ "$1" == "DOWN" ]; then
DOWN=$SEL
elif [ $SEL -eq $UP ]; then
return 0
elif [ $SEL -eq $DOWN ]; then
return 1
else
ui_print " Vol key not detected!"
abort " Use name change method in TWRP"
fi
}
ui_print " "
if [ -z $NEW ]; then
if keytest; then
FUNCTION=choose
else
FUNCTION=chooseold
ui_print " ! Legacy device detected! Using old keycheck method"
ui_print " "
ui_print "- Vol Key Programming -"
ui_print " Press Vol Up Again:"
$FUNCTION "UP"
ui_print " Press Vol Down"
$FUNCTION "DOWN"
fi
ui_print " "
ui_print "- Select Option -"
ui_print " Choose which option you want installed:"
ui_print " Vol Up = New, Vol Down = Old"
if $FUNCTION; then
NEW=true
else
NEW=false
fi
else
ui_print " Option specified in zipname!"
fi
if $NEW; then
# insert stuff for new here
else
# insert stuff for old here
fi
Attached is the keycheck binary. The original source of it is here along with the timeout binary if you want to give that a go
If you want to have more than 2 selections, you can just add more selections by adding conditionals and calling $FUNCTION again. The V4A mod I help with here is a good example of this
If you have a device with a bixby button and want to use it or you have awk bundled in your installer and/or on target device (it's a part of busybox) and want to use an alternative getevent method, check out this post. Big thanks to @ianmacd
If you know of any other methods or of any improvements (since much of this is kind of hacky), let me know! I'll add it here :fingers-crossed:
Hey @Zackptg5, Ive been making a module that is kinda based entirely around this Volume key thing, not gonna give anything away just yet, but it requires a lot of choices to be made using the volume keys. Based on what the script above shows, the key inputs are tested for everytime you want to get an input, with the keytest function, then the choose port function is decided on that.
From the above code, for my device, the keytest would recognise the newer method and do that one the first time around, but whenever an input is required a second time, it would revert to the legacy ,ethod. Time consuming. So what I did was store tje exit status of the keytest function as a variable keytest_status, and always make a check against that variable whenever an input is needed.
For those with a modern keytest method, this would solve the function reverting to the legacy one. Check the attached file for a better description. I'm still working away so if i find anything else I'll let you know:good:
Also added a couple functions for size benefits etc
Sent from my OnePlus5T using XDA Labs
OldMid said:
Hey @Zackptg5, Ive been making a module that is kinda based entirely around this Volume key thing, not gonna give anything away just yet, but it requires a lot of choices to be made using the volume keys. Based on what the script above shows, the key inputs are tested for everytime you want to get an input, with the keytest function, then the choose port function is decided on that.
From the above code, for my device, the keytest would recognise the newer method and do that one the first time around, but whenever an input is required a second time, it would revert to the legacy ,ethod. Time consuming. So what I did was store tje exit status of the keytest function as a variable keytest_status, and always make a check against that variable whenever an input is needed.
For those with a modern keytest method, this would solve the function reverting to the legacy one. Check the attached file for a better description. I'm still working away so if i find anything else I'll let you know:good:
Also added a couple functions for size benefits etc
Sent from my OnePlus5T using XDA Labs
Click to expand...
Click to collapse
Not quite sure what you mean but the keytest function is only run once when the script is initially run to determine whether the new or old choose function should be used. It also looks like you based yours on v4a (the one in the OP here has been reworked a bit to make it easier/more efficient). Also changed it up a bit to make it easier for you, let me know if this does what you want
Zackptg5 said:
Not quite sure what you mean but the keytest function is only run once when the script is initially run to determine whether the new or old choose function should be used. It also looks like you based yours on v4a (the one in the OP here has been reworked a bit to make it easier/more efficient). Also changed it up a bit to make it easier for you, let me know if this does what you want
Click to expand...
Click to collapse
No attachement:laugh: What I meant was that it would to the legacy key programming function every second time an input was needed, and the normal one every first time.
It would:
Initial key programming
detect modern version and continue
if an input is required it would switch back to legacy method
switch back to modern when another input is needed
switch back to legacy again
repeat until no more inputs are needed and script is finished running. But this may also be because I'm using the old logic:silly:
Sent from my OnePlus5T using XDA Labs
OldMid said:
No attachement:laugh: What I meant was that it would to the legacy key programming function every second time an input was needed, and the normal one every first time.
It would:
Initial key programming
detect modern version and continue
if an input is required it would switch back to legacy method
switch back to modern when another input is needed
switch back to legacy again
repeat until no more inputs are needed and script is finished running. But this may also be because I'm using the old logic:silly:
Sent from my OnePlus5T using XDA Labs
Click to expand...
Click to collapse
Oh, that may be because of the old logic. Does that happen with the one I attached on the last post?
Zackptg5 said:
Oh, that may be because of the old logic. Does that happen with the one I attached on the last post?
Click to expand...
Click to collapse
I don't see anything attached
Sent from my OnePlus5T using XDA Labs
OldMid said:
I don't see anything attached
Sent from my OnePlus5T using XDA Labs
Click to expand...
Click to collapse
Sorry, forgot that xda doesn't like .sh files
Zackptg5 said:
Sorry, forgot that xda doesn't like .sh files
Click to expand...
Click to collapse
Yeah it fixes it:good:
Sent from my OnePlus5T using XDA Labs
HMMM... It doesn't work for me. I am trying to create a ZIP file to do some updates into the system requiring basic A/B selections. I am trying to implement this in a basic TWRP ZIP module. Have you managed to include it in a flashable ZIP file without Magisk? I could adapt V4A FX installer, but I don't want this to be a Unity module since it doesn't install anything. For some reason removing that unity thing is creating all the problem. Any clue?
Oki said:
HMMM... It doesn't work for me. I am trying to create a ZIP file to do some updates into the system requiring basic A/B selections. I am trying to implement this in a basic TWRP ZIP module. Have you managed to include it in a flashable ZIP file without Magisk? I could adapt V4A FX installer, but I don't want this to be a Unity module since it doesn't install anything. For some reason removing that unity thing is creating all the problem. Any clue?
Click to expand...
Click to collapse
I'll need to see it to find what the problem is. You can pm me if you don't want it public yet
Zackptg5 said:
I'll need to see it to find what the problem is. You can pm me if you don't want it public yet
Click to expand...
Click to collapse
I solved it using only the keycheck program. getevent was not working fine for me. You can download and inspect my code here.
This is my version:
Code:
#!/sbin/sh
ui_print() {
echo -n -e "ui_print $1\n" > /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" > /proc/self/fd/$OUTFD
}
keytest() {
$KEYCHECK
KEYCODE=$?
if [ "$KEYCODE" = 42 ] ; then
return 0
else
return 1
fi
}
customkey() {
# Calling it first time detects previous input. Calling it second time will do what we want
$KEYCHECK
#$KEYCHECK
SEL=$?
if [ "$1" == "UP" ]; then
UP=$SEL
elif [ "$1" == "DOWN" ]; then
DOWN=$SEL
elif [ $SEL -eq $UP ]; then
return 0
elif [ $SEL -eq $DOWN ]; then
return 1
else
ui_print " Vol key not detected!"
abort " Use name change method in TWRP"
fi
}
##### THE PARTY STARTS HERE ########
# INITIAL CLEANUP
cd /tmp
rm -rf $INSTALLER 2>/dev/null
mkdir -p $INSTALLER
# extract files
ui_print "Extracting files."
cd $INSTALLER
unzip -o "$ZIP"
chmod 777 $KEYCHECK
ui_print " "
ui_print " #########################################"
ui_print " PROGRAM NAME"
ui_print " #########################################"
ui_print " "
ui_print " Welcome message"
ui_print " "
ui_print " Press Vol Up to continue..."
if keytest; then
FUNCTION=keytest
else
FUNCTION=customkey
ui_print " - Device detected! but using custom key method"
ui_print " "
ui_print " - Vol Key Programming -"
ui_print " Press Vol Up Again..."
$FUNCTION "UP"
ui_print " Press Vol Down..."
$FUNCTION "DOWN"
fi
# QUESTION 1 ##########
ui_print " - Continue?"
ui_print " Vol UP = YES, Vol DN = NO"
if ! $FUNCTION ; then
ui_print " "
ui_print " - Loser...."
exit 0
fi
# QUESTION 2 ##########
ui_print " "
ui_print " - Do you like this script?"
ui_print " Vol UP: YES / Vol DN: NO"
if $FUNCTION ; then
ui_print " - THANKS!!!!!"
else
ui_print " - I'm so sorry."
fi
# MORE QUESTIONS... ##########
Thanks!
Oki said:
I solved it using only the keycheck program. getevent was not working fine for me. You can download and inspect my code here.
This is my version:
Code:
#!/sbin/sh
ui_print() {
echo -n -e "ui_print $1\n" > /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" > /proc/self/fd/$OUTFD
}
keytest() {
$KEYCHECK
KEYCODE=$?
if [ "$KEYCODE" = 42 ] ; then
return 0
else
return 1
fi
}
customkey() {
# Calling it first time detects previous input. Calling it second time will do what we want
$KEYCHECK
#$KEYCHECK
SEL=$?
if [ "$1" == "UP" ]; then
UP=$SEL
elif [ "$1" == "DOWN" ]; then
DOWN=$SEL
elif [ $SEL -eq $UP ]; then
return 0
elif [ $SEL -eq $DOWN ]; then
return 1
else
ui_print " Vol key not detected!"
abort " Use name change method in TWRP"
fi
}
##### THE PARTY STARTS HERE ########
# INITIAL CLEANUP
cd /tmp
rm -rf $INSTALLER 2>/dev/null
mkdir -p $INSTALLER
# extract files
ui_print "Extracting files."
cd $INSTALLER
unzip -o "$ZIP"
chmod 777 $KEYCHECK
ui_print " "
ui_print " #########################################"
ui_print " PROGRAM NAME"
ui_print " #########################################"
ui_print " "
ui_print " Welcome message"
ui_print " "
ui_print " Press Vol Up to continue..."
if keytest; then
FUNCTION=keytest
else
FUNCTION=customkey
ui_print " - Device detected! but using custom key method"
ui_print " "
ui_print " - Vol Key Programming -"
ui_print " Press Vol Up Again..."
$FUNCTION "UP"
ui_print " Press Vol Down..."
$FUNCTION "DOWN"
fi
# QUESTION 1 ##########
ui_print " - Continue?"
ui_print " Vol UP = YES, Vol DN = NO"
if ! $FUNCTION ; then
ui_print " "
ui_print " - Loser...."
exit 0
fi
# QUESTION 2 ##########
ui_print " "
ui_print " - Do you like this script?"
ui_print " Vol UP: YES / Vol DN: NO"
if $FUNCTION ; then
ui_print " - THANKS!!!!!"
else
ui_print " - I'm so sorry."
fi
# MORE QUESTIONS... ##########
Thanks!
Click to expand...
Click to collapse
I prefer the getevent one because it doesn't involve any binaries but it is more finicky than the keycheck method. Since your mod is for arm devices, keycheck should be fine. The keytest stuff all looks good except that in the keytest function, you probably would want it to be
Code:
if [ $KEYCODE -eq 42 ]; then
since it's integer comparison. You could keep as string the way you have it but you would need a '==' rather than a '='
Also, the keytest function doesn't program volume down key at all (it's typically 21). I just always use the custom key logic just in case there's that one weird device
Zackptg5 said:
I prefer the getevent one because it doesn't involve any binaries but it is more finicky than the keycheck method. Since your mod is for arm devices, keycheck should be fine. The keytest stuff all looks good except that in the keytest function, you probably would want it to be
Code:
if [ $KEYCODE -eq 42 ]; then
since it's integer comparison. You could keep as string the way you have it but you would need a '==' rather than a '='
Also, the keytest function doesn't program volume down key at all (it's typically 21). I just always use the custom key logic just in case there's that one weird device
Click to expand...
Click to collapse
I totally agree. I don't want to load the TWRP Zip with unnecessary tools. My problem was that for some reason the getevent method was colliding with some libraries in the implementation for my device, an Axon 7. So I decided to go this way. I would like to convert it to pure getevent method.
Regarding the comparison, you are right, I will have to change that. The link is the very first working version of the tool and there is a lot of code cleanup required. The tool I have developed is a TWRP Zip module that splits a vendor partition from system or userdata, so developers could create treblerized roms for legacy devices. I have an Axon 7, released with Android M, and we have now unofficial Android P, LOS 16.0 and a couple of treble roms supporting a lot of GSI. My objective is to make it as general and compatible as I could.
Thanks Again!
Zackptg5 said:
You could keep as string the way you have it but you would need a '==' rather than a '='
Click to expand...
Click to collapse
Actually, a single '=' is fine for string comparison, and is actually the only string comparison operator accepted by the [ and test commands of POSIX-compliant shells.
ianmacd said:
Actually, a single '=' is fine for string comparison, and is actually the only string comparison operator accepted by the [ and test commands of POSIX-compliant shells.
Click to expand...
Click to collapse
Thanks for the correction, guess a single '=' could work. However, Android shell isn't posix compliant. It's its own beast :/
Zackptg5 said:
Thanks for the correction, guess a single '=' could work. However, Android shell isn't posix compliant. It's its own beast :/
Click to expand...
Click to collapse
The Android shell nowadays is mksh, and yes, you're right, it isn't terribly POSIX-compliant, even when started with -o posix.
Just be aware that the '==' comparison operator doesn't work in some shells in combination with single brackets, whereas the single '=' always will. zsh, for example:
Code:
$ zsh -c '[ x = y ]'
$ zsh -c '[ x == y ]'
zsh:1: = not found
The single '=' predates '==' by quite a margin. The double '==' is best reserved for the double bracket command: [[
Anyway, I don't want to go too far off-topic. It's just that shells are an area of particular interest to me.
Thanks for starting this thread, by the way. I now user a modified version of this code in the installer of my S9/S9+ kernel, APGK, to allow the user to interactively select certain features at install-time. The only gotcha is that I have to manually mount /system to gain access to the getevent binary.
I prefer to pipe the output through awk and output only the penultimate field:
Code:
local key=$( getevent -lqc 1 | awk '{ print $(NF-1) }' )
And since the S9/S9+ also has a Bixby button, I add a line of code to return something more legible than the raw keycode when this is pressed:
Code:
[ $key = 02bf ] && key=KEY_BIXBY
Perhaps these details will be of some use to someone.
ianmacd said:
The Android shell nowadays is mksh, and yes, you're right, it isn't terribly POSIX-compliant, even when started with -o posix.
Just be aware that the '==' comparison operator doesn't work in some shells in combination with single brackets, whereas the single '=' always will. zsh, for example:
Code:
$ zsh -c '[ x = y ]'
$ zsh -c '[ x == y ]'
zsh:1: = not found
The single '=' predates '==' by quite a margin. The double '==' is best reserved for the double bracket command: [[
Anyway, I don't want to go too far off-topic. It's just that shells are an area of particular interest to me.
Thanks for starting this thread, by the way. I now user a modified version of this code in the installer of my S9/S9+ kernel, APGK, to allow the user to interactively select certain features at install-time. The only gotcha is that I have to manually mount /system to gain access to the getevent binary.
I prefer to pipe the output through awk and output only the penultimate field:
Code:
local key=$( getevent -lqc 1 | awk '{ print $(NF-1) }' )
And since the S9/S9+ also has a Bixby button, I add a line of code to return something more legible than the raw keycode when this is pressed:
Code:
[ $key = 02bf ] && key=KEY_BIXBY
Perhaps these details will be of some use to someone.
Click to expand...
Click to collapse
Good to know. I link this to the OP, thanks!
Sorry to revive an old thread but I need some help guys. I'm converting GSI's to flashable zips and for my custom stock rom installation, I want Xposed to be installed with Vol+ and not installed(updater-script continues) with Vol-. Also, i'll be using just the old method with keycheck. Any pointers on how I would accomplish that? Thanks much
Del
Optimization details:
Added double quotes around variables to handle potential issues with spaces in filenames.
Replaced the use of backticks with the $(command) syntax for command substitution.
Used the -q option with grep to suppress output and replaced /dev/null redirection.
Removed unnecessary calls to cat.
Simplified comparisons by directly using the variable values.
Removed redundant blank lines and unnecessary ui_print statements.
Bash:
# Get option from zip name if applicable
case $(basename "$ZIP") in
*[nN][eE][wW]*) NEW=true;;
*[oO][lL][dD]*) NEW=false;;
esac
# Change this path to wherever the keycheck binary is located in your installer
KEYCHECK="$INSTALLER/keycheck"
chmod 755 "$KEYCHECK"
keytest() {
ui_print "- Vol Key Test -"
ui_print " Press a Vol Key:"
/system/bin/getevent -lc 1 2>&1 | /system/bin/grep -q "VOLUME.* DOWN" > "$INSTALLER/events"
return $?
}
choose() {
ui_print "- Vol Key Programming -"
ui_print " Press Vol Up Again:"
$KEYCHECK
$KEYCHECK
SEL=$?
if [ "$1" == "UP" ]; then
UP=$SEL
elif [ "$1" == "DOWN" ]; then
DOWN=$SEL
elif [ "$SEL" -eq "$UP" ]; then
return 0
elif [ "$SEL" -eq "$DOWN" ]; then
return 1
else
ui_print " Vol key not detected!"
abort " Use name change method in TWRP"
fi
}
ui_print " "
if [ -z "$NEW" ]; then
if keytest; then
FUNCTION=choose
else
FUNCTION=chooseold
ui_print " ! Legacy device detected! Using old keycheck method"
ui_print " "
$FUNCTION "UP"
$FUNCTION "DOWN"
fi
ui_print " "
ui_print "- Select Option -"
ui_print " Choose which option you want installed:"
ui_print " Vol Up = New, Vol Down = Old"
if $FUNCTION; then
NEW=true
else
NEW=false
fi
else
ui_print " Option specified in zipname!"
fi
ui_print " "
if "$NEW"; then
# insert stuff for new here
else
# insert stuff for old here
fi
This is untested but since i am investigating into a new AROMA Replacement this might be interesting as alternative. I will play around with it later...
Hi all
Trying to install the latest nightly has been impossible since June. Have left things as is, the phone works fine with the installed ROM version.
Now I tried to research where the problem lies, but don't have the necessary tech know-how to remedy it.
When trying to install the zip the following messages appear on TWRP:
Updating partition details......
...... done
Full SELinux support is present.
MTP Enabled
Installing zip file '/external_sd/LineageOS/lineage-15.1-20181214-nightly-klte-signed.zip'
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
Warning: No file_contexts
E3004: This package is for device: klte,klteacg,klteatt,kltecan,kltelra,kltetmo,klteusc,kltevzw,kltexx; this device is .
(now text in red)
E:unknown command[log]
Updater process ended with ERROR: 7
Error installing zip file '/external_sd/LineageOS/lineage-15.1-20181214-nightly-klte-signed.zip'
(text in red ends)
Updating partition details....
...done
Until June, the nightly updating never was a problem.
I am 100% sure my S5 is the klte version
The red line E:unknown command [log] always popped up when updating, but did not interrupt the updating process.
The latest version that worked for updating and that is installed on my phone is: 14.1-20180629-NIGHTLY-klte
Kernel Version
3.4.113-lineageos-g31d25d7
[email protected] #1
Fri Jun 29 14:12:53 CEST 2018
Build Number
lineage_klte_userdebug 7.1.2 NJH47F 6fc3da3341
Hope this info helps to identify, why the nightly does not recognize the klte (see the 9th line, where it says ' this device is . '
My guess is that either some file on my phone is missing or not in the spot where the nightly is looking for it???
How can i repair this so that i can get my S5 up to date?
Appreciate your help!!
Delete the first line in updater script using notepad++
Where is the updater script?META-INF/com/google/android/updater-script
Thank you for your answer. Unzipped the nightly file, but I can not find a script named updater? Do you mean the file I list below:
updater-script ???
The first line reads:
assert(getprop("ro.product.device") == "klte" || getprop("ro.build.product") == "klte" ||
getprop("ro.product.device") == "klteacg" || getprop("ro.build.product") == "klteacg" ||
getprop("ro.product.device") == "klteatt" || getprop("ro.build.product") == "klteatt" ||
getprop("ro.product.device") == "kltecan" || getprop("ro.build.product") == "kltecan" ||
getprop("ro.product.device") == "kltelra" || getprop("ro.build.product") == "kltelra" ||
getprop("ro.product.device") == "kltetmo" || getprop("ro.build.product") == "kltetmo" ||
getprop("ro.product.device") == "klteub" || getprop("ro.build.product") == "klteub" ||
getprop("ro.product.device") == "klteusc" || getprop("ro.build.product") == "klteusc" ||
getprop("ro.product.device") == "kltevzw" || getprop("ro.build.product") == "kltevzw" ||
getprop("ro.product.device") == "kltexx" || getprop("ro.build.product") == "kltexx" || abort("E3004: This package is for device: klte,klteacg,klteatt,kltecan,kltelra,kltetmo,klteub,klteusc,kltevzw,kltexx; this device is " + getprop("ro.product.device") + ".");
If that is correct, please let me know. prefer to be 100% sure before bricking my phone. Thanks for your patience with a newb
unzipping the nightly I see:
folder install/bin with backuptool.functions and backuptool.sh
folder META-INF/com/android with metadata and otacert
folder META-INF/com/google/android with update-binary and updater-script ??? any of these 2????
folder META-INF/org/lineageos with releasekey
folder system with build.prop
and the files
boot.img
file_contents.bin
system.new.dat.br
system-patch.dat
system.transfer.list
Once more: Appreciate your help a lot!
Edit: THIS WORKED JUST FINE! Thank you a million! Using notepad++ makes editing the file a snap, as it does not insist on .txt ending of file. Edited the line above out and saved the file, zipped the lot up again and then did the Install in TWRP. The Install process ran smoothly. Wiped the Davlik and rebooted. System comes up just fine!!!! AD FOX You were a great help!!!!
same problem on lineage 16 any fix yet?
Octaved said:
same problem on lineage 16 any fix yet?
Click to expand...
Click to collapse
Can confirm, same problem, also same solution, as described above:
open the zip, edit META-INF/com/google/android/updater-script
Remove from the start of assert(getprop("ro.product.device") == "klte" || ... untill ...+ getprop("ro.product.device") + ".")
Save, and use this modified zip. I just tried it with no problems. Thanks!
Updater process ended with signal: 11
xananaxx said:
Can confirm, same problem, also same solution, as described above:
open the zip, edit META-INF/com/google/android/updater-script
Remove from the start of assert(getprop("ro.product.device") == "klte" || ... untill ...+ getprop("ro.product.device") + ".")
Save, and use this modified zip. I just tried it with no problems. Thanks!
Click to expand...
Click to collapse
Tried this solution but now get different error Updater process ended with signal: 11
According to the updater-script its failing at this point
block_image_update("/dev/block/platform/msm_sdcc.1/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat.br", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
The same here. I also got the error 11 message after flashing the modified updater script. My solution: Just flash the next older version of TRWP (e.g. instead of twrp-3.4.0-0-klte.img use twrp-3.3.1-0-klte.img). It worked just fine.
plapic said:
Updater process ended with signal: 11
Tried this solution but now get different error Updater process ended with signal: 11
According to the updater-script its failing at this point
block_image_update("/dev/block/platform/msm_sdcc.1/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat.br", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
Click to expand...
Click to collapse
If editing the code and removing some open brackets, make sure to also remove the corresponding closing brackets. I.e. I changed line 1 from:
Code:
assert(getprop("ro.product.device") == "grouper" || getprop("ro.build.product") == "grouper" || abort("E3004: This package is for device: grouper; this device is " + getprop("ro.product.device") + "."););
into:
Code:
getprop("ro.product.device") + ".";
When I made this change to line 1 of updater-script it worked fine and the ROM installed.
By the way, if you edit updater-script, you have edited the zip file and so you will need to uncheck TWRP's 'zip signature verification' tickbox.