[tutorial]Add build.prop lines from cwm - Sony Ericsson Xperia Neo, Pro

I have seen many questions about build.prop editing but very less of them have been convincing to be solved and modders don't need to tell people to add lines from next time​
First how to make a script sh file which contains your prop lines
Click to expand...
Click to collapse
Open npp and type:
#!/sbin/sh[This is the first line to call busybox]
busybox echo "" >> /system/build.prop[Call busybox for prop file]
busybox echo "Title of your added lines" >> /system/build.prop(not recommended but works absolutely)[This is the description line which is written inside build.prop for understanding of your apk's value nature..]
busybox echo "ro.config.ringtone=opal.ogg" >> /system/build.prop....(And just the same way add lines)[This line put your default ringtone to opal.ogg]
Provide a line break
busybox echo "" >> /system/build.prop[Call this line again for busybox to finish prop file]
save file with script.sh extension.....save it at the main folder which contains meta-inf folder too...
Add these lines to updater-script after
Click to expand...
Click to collapse
ui_print("Adding lines to build.prop");
package_extract_file("script.sh", "/tmp/script.sh");
set_perm(0, 0, 0777, "/tmp/script.sh");
run_program("/tmp/script.sh");

For modifying the script ...like deleting prop lines....its quite hard to manage through it..end up in bootloops...will see to work it out...if any of you have got the deleting prop lines successful then post here

Try this one
Code:
{ sed -i "/^$1=/{ h; s/^$1=\(.*\)/# $1 was \"\1\"\n$1=$2/ }; \${ x; s/$1//; x; t e; s/$/\n$1=$2/; : e }" "$TMP"; }
this will search your build.prop for a line and replace it with something that you want it to be... then it will echo all of that to a temporary file of your choosing for reference. it will also comment out what the old prop was

RErick said:
Try this one
Code:
{ sed -i "/^$1=/{ h; s/^$1=\(.*\)/# $1 was \"\1\"\n$1=$2/ }; \${ x; s/$1//; x; t e; s/$/\n$1=$2/; : e }" "$TMP"; }
this will search your build.prop for a line and replace it with something that you want it to be... then it will echo all of that to a temporary file of your choosing for reference. it will also comment out what the old prop was
Click to expand...
Click to collapse
Great..i will work through it

epicsilence said:
I have seen many questions about build.prop editing but very less of them have been convincing to be solved and modders don't need to tell people to add lines from next time​
Open npp and type:
#!/sbin/sh[This is the first line to call busybox]
busybox echo "" >> /system/build.prop[Call busybox for prop file]
busybox echo "Title of your added lines" >> /system/build.prop(not recommended but works absolutely)[This is the description line which is written inside build.prop for understanding of your apk's value nature..]
busybox echo "ro.config.ringtone=opal.ogg" >> /system/build.prop....(And just the same way add lines)[This line put your default ringtone to opal.ogg]
Provide a line break
busybox echo "" >> /system/build.prop[Call this line again for busybox to finish prop file]
save file with script.sh extension.....save it at the main folder which contains meta-inf folder too...
ui_print("Adding lines to build.prop");
package_extract_file("script.sh", "/tmp/script.sh");
set_perm(0, 0, 0777, "/tmp/script.sh");
run_program("/tmp/script.sh");
Click to expand...
Click to collapse
I cant quite understand this. Could you please make a simple way on how to do this. thanks :fingers-crossed:

Najmi Mansor said:
I cant quite understand this. Could you please make a simple way on how to do this. thanks :fingers-crossed:
Click to expand...
Click to collapse
1. Don't quote full op
2.Nope there is no other simple method, you may learn from now

Najmi Mansor said:
I cant quite understand this. Could you please make a simple way on how to do this. thanks :fingers-crossed:
Click to expand...
Click to collapse
Friend, npp means notepad ++ ..you can get it from sourceforge.net ...and for later instructions type and understand meaning written in brackets
And yes...you need to read more threads around xda so you can understand more threads easily..
Enjoy reading

RErick said:
Try this one
Code:
{ sed -i "/^$1=/{ h; s/^$1=\(.*\)/# $1 was \"\1\"\n$1=$2/ }; \${ x; s/$1//; x; t e; s/$/\n$1=$2/; : e }" "$TMP"; }
this will search your build.prop for a line and replace it with something that you want it to be... then it will echo all of that to a temporary file of your choosing for reference. it will also comment out what the old prop was
Click to expand...
Click to collapse
Can you explain this a bit further in terms of usage? What part of this code is the line to be replaced and the line to be supplanted? I assume 1 & 2 are the lines, but I still don't quite understand... Maybe you could give an example? Thank you.

epicsilence said:
Friend, npp means notepad ++ ..you can get it from sourceforge.net ...and for later instructions type and understand meaning written in brackets
And yes...you need to read more threads around xda so you can understand more threads easily..
Enjoy reading
Click to expand...
Click to collapse
Thanks for replying

Heatshiver said:
Can you explain this a bit further in terms of usage?
Click to expand...
Click to collapse
Hello, learn more about sed here...my friend once implemented it on galaxy s2 for verification....but same script did not applied for xperia series...so i think its more important to get to know deep about its usage......
SED-Complete Document(Unofficial)
Always share knowledge, sometimes we might get more than we know

anybody has sample zip for this including updater script commands and the file script.sh, thanks anyone can help
---------- Post added at 04:14 AM ---------- Previous post was at 03:30 AM ----------
TheDriller said:
Try this one
Code:
{ sed -i "/^$1=/{ h; s/^$1=\(.*\)/# $1 was \"\1\"\n$1=$2/ }; \${ x; s/$1//; x; t e; s/$/\n$1=$2/; : e }" "$TMP"; }
this will search your build.prop for a line and replace it with something that you want it to be... then it will echo all of that to a temporary file of your choosing for reference. it will also comment out what the old prop was
Click to expand...
Click to collapse
can u give an example of a line that ur trying to replace in buildprop? what if this line ro.config.dha_empty_max=36 you change the value to 40 . . pls? thanks

Related

[WIP]Developers only - a different way of creating flashables..

This is NOT going to contain anything for users to flash - this is for developers(or those who aspire and want to learn). This is a work in progress.
I want to make it clear that XDA nor the mods endorse or approve of this thread(well, they are allowing me to post it), but this is a concept that may be helpful for multiple reasons.
Please go easy on me, constructive criticism is welcomed, flaming is not. Do not post if you are not adding to the discussion or a developer asking a question. This is something I have been working on for a "rom" I will be putting out in a few days.. I just decided I would share the process, maybe others can help refine it.
Benefits:
If you build for multiple devices you can use this SAME flashable on those other devices and only need to edit the updater-script, prop edits that are device specific, and any system or apk's that are device specific! This could take 5 minutes or less to change AND upload!
It will work on ANY rom(for the same device) as long as you aren't modifying the things that rom specifically needs - and with this method it would be very rare that you would somehow break a rom.
You can still add files/apks, delete files you don't want, modify(rather than replace) the build.prop - technically you could create a flashable that turns stock into CM9 if you wanted to, but only then is a full ROM really needed.
Users can choose the rom they want and add your customizations(the entire community can use your flashable, rather than just a portion!)
It reduces the flashable filesize - rather than 100-400mb your flashable could be 4-20(depending how much you are changing).
It takes MUCH less time to flash, the recovery log will be shorter/easier to read, and it reduces the chance of errors(you are changing less).
Easier to track the changes since the flashable has been reduced to what is NEEDED.
This is an open source community - other devs and even users could look at your flashable and clearly see what you've done, how you've done it, so everyone benefits.
Easier to support - to make changes is EASY, faster zipping, signing, updating, uploading, etc.
You can choose to make it CONFIGURABLE - add #comments in the updater-script, the included build.prop script, or add a readme in the flashable that tells them what they can remove if they don't want it!
I'm quite sure there are MANY more reasons this is beneficial, but I'll leave it to you to decide..
Post 1 - Benefits, explanation, reasoning
Post 2 - Instructions and a soon a flashable example that I will publish
Post 3 = profit?!
First, there are totally different systems out there we can try to get running, CM9, MIUI, etc- this is when the very framework is absolutely different-- otherwise every rom we have RIGHT NOW is just a series of tweaks to the stock(like the leaked ICS) rom. We can argue that people just tweak what is there, or "develop" something new, but nearly everything is building on the concepts of something before- so let's do it right.
What makes a rom unique:
It is easier to keep track of changes(the /system will only have the changes you make, your updater-script will show you other changes, and any scripts you create will show the last changes) - so there shouldn't be "and other stuff I don't remember" in your changelog. This will also assure that there are less potential issues- you are ONLY changing specific things- troubleshooting these things are easier when you aren't including the entire modified flashable.
What you are trying to accomplish:
The main thing that makes a "rom" stand out from any other is the changes to the build.prop - you totally replaced it with something that is your own(or an adapted version hopefully giving proper credit to whoever's tweaks you are using): but they are using your "rom" if they have your build.prop and not someone else's. Everything else is deleting, copying, setting permissions, etc.
The goal: making it more open source
Until you build something totally new(Cm9, miui, etc), you are working with an open source platform, modifying, adding, deleting, scripting. Period. Admit that you are giving the base platform some tweaks, or a "flavor" that others will hopefully prefer.
If you are already developing, you know that with the correct updater-script you can add apks, delete what you don't want, over-write the things you want to replace- this includes theming and everything else you could want.. and usually you would include this in the full base rom, totally pre-configured. With a build.prop that is yours alone.
Conclusion:
Unless you are building an OS from scratch, or modifying it so heavily that it is more yours than it is not, giving the end users these options without wiping is the way to go. If they can flash your mods and then mine and end up with a better final product, how can this go wrong? This is open source, this is android, this is evolution.
Instructions:
First, keep track of all the changes you want to make - the better organized you are, the easier this will be. If you aren't even sure what all you did..
How to do it:
One of the main things you are changing by creating a total prepacked rom is the build.prop- perhaps you have tweak A, and I have tweak B, and those tweaks are different enough to change the users experience.. but why not combine them if possible? It IS possible.
Decide on the build.prop edits that you want to add/modify(you will NOT replace their build.prop) and modify the propEditor script as needed - if you build for multiple devices I would recommend you add the device specific ones at the end(with #comments) for easy modification/removal from script. You really only need to MODIFY the RO.whatever lines(because they are read only), everything else can be added to a local.prop in the /data folder
Create your updater-script as you normally would, as you know this does the main work - this will likely remain mostly the same, with just a few lines added for the scripts you need to modify the build.prop. Just make sure you delete what you would from the rom itself with the script
Rather than copy your /system /data or any other files into the rom you would normally be modifying, those are the only files you will include in the flashable - if this is done right it will make all of the changes you want without breaking anything.
If you want others to be able to understand/build upon your work you can add #comments or a readme in the above steps, then all users would have to do is remove the lines you instructed, re-zip(no need to sign if they use 7-zip or winrar) and then flash.
As said in the previous area, outside the build.prop you can make a small flashable that will change everything, but if you can MODIFY tweaks already in the build.prop, or add lines if they don't exist-- we would be creating a continual evolution of a better and better performing rom.. with feedback bad tweaks would get tossed, each developer adds their flavor, but users can flash what they want to get the performance they desire without the headache and confusion that comes with wiping everything of the developer they used before that. This will enable them to learn more about how and what we are doing with their devices, and they can provide feedback that makes it better for everyone.
The code(that may need work) to modify or add lines in the default build.prop is here:
(This may require testing, big thanks to tommytomatoe for all the help, original thread is here.)
Code:
#!/sbin/sh
# Build.prop editor script with basic sed commands
# tommytomatoe
# May 12, 2012
# mounting system as rw
busybox mount -o remount,rw /system
if [ $? != 0 ] ; then exit
fi
FILE=/system/build.prop
TMPFILE=$FILE.tmp
line1=ro.product.version
line2=ro.HOME_APP_ADJ
line3=ro.media.enc.jpeg.quality
#Add more line# formatted as above as needed to identify each prop
line1Arg=Classicv0.1.0
line2Arg=1
line3Arg=100
#Add more line$Arg formatted as above as needed for each prop change
lineNum=
#to add additional prop changes copy the lines between here
prop=$line1
arg=$line1Arg
if grep -Fq $prop $FILE ; then
lineNum=`sed -n "/${prop}/=" $FILE`
echo $lineNum
sed -i "${lineNum} c${prop}=${arg}" $FILE
else
echo "$prop does not exist in build.prop"
echo "appending to end of build.prop"
echo $prop=$arg >> build.prop
fi
#and here and paste to the end, changing the $line# and $line#Arg to match what you've added
# to iterate over all the prop values you want to change,
# just copy and paste the code chunk or create a for loop.
# I will leave it to you to create a for loop
prop=$line2
arg=$line2Arg
if grep -Fq $prop $FILE ; then
lineNum=`sed -n "/${prop}/=" $FILE`
echo $lineNum
sed -i "${lineNum} c${prop}=${arg}" $FILE
else
echo "$prop does not exist in build.prop"
echo "appending to end of build.prop"
echo $prop=$arg >> build.prop
fi
prop=$line3
arg=$line3Arg
if grep -Fq $prop $FILE ; then
lineNum=`sed -n "/${prop}/=" $FILE`
echo $lineNum
sed -i "${lineNum} c${prop}=${arg}" $FILE
else
echo "$prop does not exist in build.prop"
echo "appending to end of build.prop"
echo $prop=$arg >> build.prop
fi
It may require some work, feel free to offer advice if you can help make it better), but you can make a few changes to that, and rather than replacing the entire system on a users phone, you are making YOUR modifications to make their device work better! Read the #comments above to see the different tweaks you are trying to make, and it will automatically either change the value, or it will add the line if it doesn't already exist in the build.prop
Profit?!
I understand many developers may think this would make it easier to "steal" your work, but as I said before, everything android is open source. Besides, with enough changes this makes it a TRUE rom, and it will be NEARLY as complex as the much larger file he would be uploading.
It could actually be profitable time/effort wise, ANY rom could be done with this as long as you tell them what base to work with.
Example of "profit"
Mike 1986.'s ARHD is on 10 devices, if you check, most of the features in one are in the rest of them. He has enough experience where porting everything over all of his changes to a new rom probably isn't that difficult for him(I'll bet he is VERY organized), but this would enable him to make a few changes to a propEditor script, the updater-script, remove or change out a few files.. re-zip and sign, upload, done.
This also takes out much of the opportunity for developer error or errors during flashing..
Doubt I'll need it.. but we'll see.

[Q] Edit line in file from terminal?

Hi, I don't really know where to put this topic but anyways my problem is that i need to edit a line in a file.
So i think of something like this
su
Cd /data/data/foldernameofapp/
Edit "file.dat"
Edit line 4 "text here 2"
i want it to edit like this "text here 3"
Change only the number. or replace the hole line with a new line where i only changed the number. btw the best is if the script can change a line and not find text and change. Because the number in the text i want to change can vary from different numbers.
Hope someone understands what i mean. Thanks in advance
P.S i can use root explorer and open the file with a text editor and change it, this works but takes forever
P.S.S i got root
This below will change "text here <whatever>" in oldfile.txt to "text here 3" in newfile.txt
Code:
$ busybox sed 's/text here .*/text here 3/' oldfile.txt > newfile.txt
kuisma said:
This below will change "text here <whatever>" in oldfile.txt to "text here 3" in newfile.txt
Code:
$ busybox sed 's/text here .*/text here 3/' oldfile.txt > newfile.txt
Click to expand...
Click to collapse
Okay but will it create a new file? Because I want it to save the old file.
Sent from my Galaxy Nexus using xda premium
julllleee said:
Okay but will it create a new file? Because I want it to save the old file.
Click to expand...
Click to collapse
I'm quite sure you can find out a way for the new file to live under the name of Sanders.
hmm i get this error. ser:bad option in substitution expression
Btw what do you mean with the last post? How do I save it? I can use your code and then maybe have another script after your thats remove the old file and then rename the new file to the old name?
sed 's/<zk_cp>0</zk_cp>.*/<zk_cp>6</zk_cp>/' zk.dat > zk2.dat
julllleee said:
sed 's/<zk_cp>0</zk_cp>.*/<zk_cp>6</zk_cp>/' zk.dat > zk2.dat
Click to expand...
Click to collapse
Ah, ok, you can't use / as delimiter if it occurs in the replacement strings as well. And yes, of course you can rename (mv) or copy (cp) the resulting files to get correct file names. Did you really have to ask that?
Code:
$ cp zk.dat zk.tmp
$ sed 's!<zk_cp>.*</zk_cp>!<zk_cp>6</zk_cp>!' zk.tmp > zk.dat
kuisma said:
Ah, ok, you can't use / as delimiter if it occurs in the replacement strings as well. And yes, of course you can rename (mv) or copy (cp) the resulting files to get correct file names. Did you really have to ask that?
Code:
$ cp zk.dat zk.tmp
$ sed 's!.*!6!' zk.tmp > zk.dat
Click to expand...
Click to collapse
Okay thanks I'll try the code
Sent from my Galaxy Nexus using xda premium
Wow works really good exactly as I want. I really appreciated it. You are the best!!
Sent from my Galaxy Nexus using xda premium

updater-script error??

I am learning about updater-script. But now I just have a single line:
ui_print("This is a test!");
and an enter at the end of the file, but Status 6, unexpected BAD line 1 col 33... I don't understand this cause there is no syntax wrong as far as I know?
Could someone explain this, please?
TIA Caelin
Always remember to set the EOL(End of Line) conversion of updater-script, and UNIX format before saving (Notepad++ > Edit > EOL Conversion > UNIX format)
That worked. Thanks!!

How to bump yourself stock kernel, modify ramdisk to add init.d + SELinux permissive

Hello,
I spent a lot of time searching and finding the material to understand and reproduce process about bump!.
After a few times shared the results of my manipulations on stock kernel, which I applied the method I'll describe here, I will try now to explain how you can make for yourself an identical result.
If you are still wondering what is Bump! I can only invite you to look for yourself, and even give you the link where I tried to answer this question on the section of the G2.
The purpose of this topic is to get you to bump kernel, from a PC, Linux, or Windows, or even from the phone.
I'll try to explain as why certain steps are essential to ensure a good result, steps that, at first, did not seem obvious.
When you will try it, and will want to test the result, make sure nice to have taken the necessary precautions before: Make a backup of your current kernel foremost flashing.
Now, you know what is BUMP! and why kernel must be bumped. Bump! basically involves injecting a signature in a file (boot).
This injection of the signature to be made in hexadecimal format, and immediately after the last used page of the kernel, we have to remove unnecessary bytes before doing so, and unpack/repack kernel is the easiest way to do so (http://forum.xda-developers.com/showpost.php?p=60086231&postcount=42). To do that, we need two binaries (unpackbootimg and mkbootimg).
About these two binaries, we can compile them ourselves from source, or taking already compiled bins.
@osm0sis made and share a super tool containing all that we need, these compiled bins, in his Android Image Kitchen - Unpack/Repack Kernel Ramdisk [Win/Android/Linux].
So i propose to use it here. The big advantage to this, is that @osm0sis compiled for windows, linux, and phone (arm). He created scripts that automate unpack and repack too.
The purpose of this topic is not to learn how to get the kernel file (boot), I assume that this prerequisite is acquired. However, I give you some hints for beginners, you can take a look at KDZ and TOT Extractor from @bullghost or the dd command to achieve.
1) Simply Bump a stock kernel in Linux (no change in ramdisk) to obtain a bumped working untouched stock kernel
Download the linux version of Android Image Kitchen - Unpack/Repack Kernel Ramdisk [Win/Android/Linux] ( AIK-Linux-v1.9.1-ALL.tar.gz), and untar it somewhere. Create, in the root directory of AIK, one file named "one_shot_bump.sh" (or the name that you like) containing this code I gave in osm0sis AIK thread (or, if you prefer, you can take the file named "linux_one_shot_bump_only.tar.gz" in attached files here), and chmod it 755.
Now you can use it by opening a terminal and drag and drop this file inside following by drag and drop kernel file too. Press enter, it's done You'll find a file named bumped.img, in AIK root directory, wich is your bumped kernel.
Note: bash for this script is very important for an expected result for printf cmd. It doesn't work as expected with sh.
2) Simply Bump a stock kernel in Windows (no change in ramdisk) to obtain a bumped working untouched stock kernel
I've not made a one click script to bump on this OS, but I'll explain very simply how to get there using the scripts offered natively in the osm0sis tools . This fair will be in three stages, for the reasons discussed in the preamble:
1) unpack the kernel
2) repack the kernel
3) inject hexa signature (bump!)
So to begin, download the windows version of Android Image Kitchen - Unpack/Repack Kernel Ramdisk [Win/Android/Linux] (Android.Image.Kitchen.v2.3-Win32.zip).
Unzip it where you want. Open a dos prompt and drag and drop unpackimg.bat on the prompt windows, tape one spaces in the command and drag and drop your kernel file in the prompt windows. Tape on enter: You made the first step, your kernel is unpacked.
Don't close window prompt, tape one touch to continue, as the prompt invite you to do.
Now, just drag and drop repackimg.bat in the prompt windows, and tape on enter. Done, you just finished the second step, you've repacked the kernel (image-new.img on the root folder of AIK).
Now, for doing the step 3, you need to inject the signature. I have not found other solutions at the moment than to use a hex editor to do this. I tried with a shareware (Hex Editor) and also with a freeware (HxD) with succes for these two softwares. With Hex Editor, after opening image-new.img, click on the first free byte at the end of the file and copy paste there "41A9E467744D1D1BA429F2ECEA655279" (without double quote). Save the file.
Or with HxD, after opening image-new.img, click at the end of the file, just after the last used byte, and in the menu"edition", choose "insert bytes". On the dialog box, type 10 on the first field (amount), let "hex" checked, and paste in the second field the value "41A9E467744D1D1BA429F2ECEA655279" (without double quote). Save the file.
Done, you just finished bumping your kernel in windows
I can give later screenshot if needed/asked.
Edit: i've found a workaround for using @osmosis tool to sign (bump) kernel just after repacking. Details can be found here: http://forum.xda-developers.com/showthread.php?p=63884919#post63884919
Edit2: After talking with @osmosis, the best solution for signing (bump) the kernel just after repacking should be to use cygwin printf.exe (I've attached this file to this post), that can be added in aik/bin folder (the real name of this folder is android_win_tools and it can be found in the root of AIK tool). So we just need to put printf.exe in android_win_tools folder, and replace this code in repackimg.bat
Code:
%bin%\mkbootimg --kernel "split_img/%kernel%" %ramdisk% %second% --cmdline "%cmdline%" --board "%board%" --base %base% --pagesize %pagesize% --kernel_offset %kerneloff% --ramdisk_offset %ramdiskoff% %second_offset% --tags_offset %tagsoff% %dtb% -o image-new.img %errout%
by
Code:
%bin%\mkbootimg --kernel "split_img/%kernel%" %ramdisk% %second% --cmdline "%cmdline%" --board "%board%" --base %base% --pagesize %pagesize% --kernel_offset %kerneloff% --ramdisk_offset %ramdiskoff% %second_offset% --tags_offset %tagsoff% %dtb% -o image-new.img %errout%
%bin%\printf \x41\xA9\xE4\x67\x74\x4D\x1D\x1B\xA4\x29\xF2\xEC\xEA\x65\x52\x79 >> image-new.img
As you can see, just one new line was inserted for injecting the signature.
3) Simply Bump a stock kernel in Phone (no change in ramdisk) to obtain a bumped working untouched stock kernel
I will not reinvent the wheel, you can use an existing tool for some time, made by @somboons, which uses the technique I mentioned here (unpack the kernel, repack it and injection of signing , all in the phone).
This script is an adaptation of Live bump by @Skin1980 that uses the arm versions of unpackbootimg and mkbootimg.
You will find the instructions and the tool here:
http://forum.xda-developers.com/lg-g2/development/tools-bump-kernel-offline-t3073261
---​
Credits and thank's a lot:
codefire team for bump!:
@thecubed , @Shelnutt2 , @IllegalArgument , @autoprime , @AnimatronicRocketReptile , @Dees_Troy
@Skin1980 for his live bump and these explanations
@osm0sis for his Android Image Kitchen - Unpack/Repack Kernel Ramdisk [Win/Android/Linux]
@zequav for explain me at the beginning what happen with bump and what can be done on linux
How to add init.d support and SELinux permissive on the Ramdisk​
Here, i explain how to implement in Ramdisk init.d and SELinux permissive.
We start from untouched kernel not bumped (so not from the kernel we eventually have bumped with the previous post).
Use @osmosis tool android image kitchen version for your system to unpack it.
After that, navigate to the AIK root folder and:
in split_img/boot.bin-cmdline, replace
Code:
console=ttyHSL0,115200,n8 user_debug=31 ehci-hcd.park=3 msm_rtb.filter=0x37 androidboot.hardware=g3
by
Code:
console=ttyHSL0,115200,n8 user_debug=31 ehci-hcd.park=3 msm_rtb.filter=0x37 androidboot.hardware=g3 androidboot.selinux=permissive
in ramdisk/init.qcom.rc replace
Code:
on property:sys.boot_completed=1
start qcom-post-boot
by
Code:
service sysinit /sbin/sysinit.sh
oneshot
class late_start
user root
group root
disabled
on property:sys.boot_completed=1
start qcom-post-boot
start sysinit
and on /sbin folder, add a file named "sysinit.sh" that contains this code:
Code:
#!/system/bin/sh
mount -o rw,remount /system
if [ ! -e /system/etc/init.d ]; then
mkdir /system/etc/init.d
chown -R root.root /system/etc/init.d
chmod -R 755 /system/etc/init.d
fi;
mount -o ro,remount /system
run-parts /system/etc/init.d/
/system/xbin/daemonsu --auto-daemon &
Note: This previous code on sysinit.sh is only for those who have run-parts installed (with busybox by example). Otherwise, for those who don't want to use run-parts, you can put the next one that don't need it:
Code:
#!/system/bin/sh
mount -o rw,remount /system
if [ ! -e /system/etc/init.d ]; then
mkdir /system/etc/init.d
chown -R root.root /system/etc/init.d
chmod -R 755 /system/etc/init.d
fi;
mount -o ro,remount /system
setenforce 0
FILES=/system/etc/init.d/*
for f in $FILES
do
$f
done
/system/xbin/daemonsu --auto-daemon &
Now you are ready to repack the kernel. Use AIK repackimg script for that. After repacking the kernel, you still have to sign it (Bump!).
For this last formality depending on the OS which you find yourself:
1) On Linux
put a file that you name as you want with sh ext(bump.sh should be a great idea ) on the AIK root folder, and chmod it 755.
On this file put the code above:
Code:
#!/bin/bash
printf '\x41\xA9\xE4\x67\x74\x4D\x1D\x1B\xA4\x29\xF2\xEC\xEA\x65\x52\x79' >> image-new.img
Save it, and now just drag and drop this file on a window terminal and valid. That's all
2) On Windows
Refer to the OP, i explained there how I bump on windows
3) On Phone
Refer to the OP, i explained there how I bump on the phone
Wow great, waiting for chapter 2
reserved
u25150 said:
Wow great, waiting for chapter 2
Click to expand...
Click to collapse
I feel that few people seem really passionate about what I say, if I refer to the answers
Also I'm going to focus on those who, like you, arise, and seem interested in this subject.
What specifically would you like to see some detail (what do you call "chapter two" ) ?
Duckscreen said:
reserved
Click to expand...
Click to collapse
Welcome, pleased to meet you
@6ril1 great work my freind
jac10000 said:
@6ril1 great work my freind
Click to expand...
Click to collapse
Hi my friend (not my freind, which is an advantage of German expression, ) , thank's, I assume that it is better to teach to fish than give fish, but perhaps this concept is it outdated ?
Could you making how to kexec hardboot patch Guide please
(for support Multirom)
Really nice work my friend !!!
In Linux, I just make my first bump boot thanks to you :good:
jac10000 said:
Really nice work my friend !!!
In Linux, I just make my first bump boot thanks to you :good:
Click to expand...
Click to collapse
You are welcome
And great thank's for having notify me my mistake about code i wrote in post 2 (class late_sart instead of class late_start )
Code is edited and correct now
Yeaah @6ril1 and my first bump boot with SELinux permissive
jac10000 said:
Yeaah @6ril1 and my first bump boot with SELinux permissive
Click to expand...
Click to collapse
LOL, thank's to have testing all of that i described in this thread, and for having mentioning me in private some others mistakes (unexpected one space inserted during copy-paste on the post 2 and one code tag not closed) . I have edited again with all that you find and now it should be correct
THANK'S again my friend
For windows user, new stuff added, i'll edit op with that too:
http://forum.xda-developers.com/showpost.php?p=63884919&postcount=716
Edit2: One more simple solution just added in OP
I have new-img but how do you use hex editor exactly? i can not figure it out. can u help with screenshots please?
I tried your tutorial (windows x64)(only bump no change in ramdisk) for 30c MM kernel but my phone wont boot(i don't have security error). Any ideas? Thank you!

few questions about making a flashable zip

Please bear with me, I'm not a dev.
The purpose of making the zip is to load an rsa key to my phone so I can authorize usb debugging mode on my computer. Long story short, broken phone, I think this is one of the last options I have to recover data from it.
Details here if you're interested: https://forum.xda-developers.com/galaxy-s4-att/general/recover-data-broken-screen-digitizer-t3788079
Its a Galaxy S4 i337 phone, i didn't find any specific instructions on how to make flashable zip for it. I have 2 zip files for my bootloader (one for flashing a modem, one of tethering setting). Both have META-INF and system folders. T
1 - update-binary files in each sample zip are different, I read somewhere that I don't really need to touch them but if thats the case I would expect them to be the same. If I just copy that update-binary file over to my zip, and write a very simply script to copy a 1 key to another location, what are the chances I brick the phone if my script fails or something is wrong with that binary file?
2 - anyone feel like helping, I'm thinking this is probably <5 minutes worth of work for someone that knows what they are doing?
Here is what I have so far, if someone could just give me some insight into whether this has any chance of working.
zip file:
META-INF/com/google/android/update-binary (not sure which one to use yet)
META-INF/com/google/android/update-script
Code:
mount("/system", "/data");
package_extract_file("system/rsa-swap.sh", "/tmp/rsa-swap.sh");
set_perm(0, 0, 0777, "/tmp/rsa-swap.sh");
package_extract_file("system/key", "/tmp/key");
run_program("/tmp/rsa-swap.sh");
unmount("/system", "/data");
system/key
system/rsa-swap.sh
Code:
#!/sbin/sh
newrsa="/tmp/key"
oldkey="/data/misc/adb/adb_keys"
if [ -f $oldkey ]; then
echo "exists"
cp $oldkey /data/misc/adb/adb_keys.bak
cat $newrsa >> $oldkey
else
echo "does not exist"
cp $newrsa $oldkey
fi
I aslo want it to reboot, not just where to add that yet but should be easy. Not signing this if its an option.
I'm I asking a stupid question?
still looking for some help

Categories

Resources