Editing build.prop via flashable zip - Nexus 5 Q&A, Help & Troubleshooting

Hey folks,
to avoid doing this manually with every nightly, I wanted to change some build.prop values via a flashable zip, which doesn't seem to work.
I used the script from here and modified it for my needs. It doesn't throw an error in recovery, but doesn't change any values, either.
Here are my files:
updater-script
Code:
ui_print("fixer");
ui_print("Mounting System partition...");
#mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
#Properly unmounting to avoid issues
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "mount", "/system");
ui_print("bloat removal..");
delete_recursive("/system/app/Apollo");
delete_recursive("/system/app/BasicDreams");
delete_recursive("/system/app/Browser");
delete_recursive("/system/app/Calculator");
delete_recursive("/system/app/CMHome");
delete_recursive("/system/app/CMWallpapers");
delete_recursive("/system/app/Development");
delete_recursive("/system/app/Email");
delete_recursive("/system/app/Galaxy4");
delete_recursive("/system/app/GoogleTTS");
delete_recursive("/system/app/HoloSpiralWallpaper");
delete_recursive("/system/app/Launcher3");
delete_recursive("/system/app/LiveWallpapers");
delete_recursive("/system/app/NoiseField");
delete_recursive("/system/app/OmaDmclient");
delete_recursive("/system/app/OpenWnn");
delete_recursive("/system/app/PrebuildExchange3Google");
delete_recursive("/system/app/PhaseBeam");
delete_recursive("/system/app/PhotoTable");
delete_recursive("/system/app/PicoTts");
delete_recursive("/system/app/PrintSpooler");
delete_recursive("/system/app/SprintHiddenMenu");
delete_recursive("/system/app/Stk");
delete_recursive("/system/app/Trebuchet");
delete_recursive("/system/app/UpdateSetting");
delete_recursive("/system/app/VisualizationWallpapers");
delete_recursive("/system/priv-app/CellBroadcastReceiver");
delete_recursive("/system/priv-app/CMUpdater");
delete_recursive("/system/priv-app/GoogleFeedback");
delete_recursive("/system/priv-app/VoiceDialer");
delete("/system/media/audio/ui/camera_click.ogg");
delete("/system/media/audio/ui/camera_focus.ogg");
ui_print("tweaking build.prop...");
package_extract_dir("tmp", "/tmp");
set_perm(0, 0, 0777, "/tmp/mytweaks.sh");
run_program("/tmp/mytweaks.sh", "mytweak");
unmount("/system");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Completed.");
mytweaks.sh
Code:
#!/sbin/sh
bp="/system/build.prop"
busybox mount /system
busybox mount /data
if [ -f /system/build.prop.bak ];
then
rm -rf $bp
cp $bp.bak $bp
else
cp $bp $bp.bak
fi
echo " " >> $bp
echo "# build.prop editor" >> $bp
echo " " >> $bp
for mod in misc;
do
for prop in `cat /tmp/$mod`;do
export newprop=$(echo ${prop} | cut -d '=' -f1)
sed -i "/${newprop}/d" /system/build.prop
echo $prop >> /system/build.prop
done
done
misc
Code:
ro.sf.lcd_density=420
drm.service.enabled=false
wifi.supplicant_scan_interval=60
dalvik.vm.isa.arm.features=lpae,div
dalvik.vm.dexopt-flags=m=y,v=a,o=v,u=y
Furthermore, my device runs on TWRP 2.8.1.0 and CM12. I suspect the path to the shell is wrong, but couldn't find anything on that. Any suggestions?

Anyone?

I haven't time to troubleshoot your zip and script but attached is the one I wrote. In the uodater-script, its the part after wireless charging you want. I've removed my files that I also flash via this zip, but left the shell script.
In the shell, the sed lines are original_value/new_value and the echo lines add new lines at the bottom.
Hope this helps.

Not sure but if you unmount the system can you modify after that?
Sent from my Nexus 5 using XDA Free mobile app

shri_chanakya said:
Not sure but if you unmount the system can you modify after that?
Sent from my Nexus 5 using XDA Free mobile app
Click to expand...
Click to collapse
You'll need /system mounted to make changes in the /system/build.prop (good point)

rootSU said:
I haven't time to troubleshoot your zip and script but attached is the one I wrote. In the uodater-script, its the part after wireless charging you want. I've removed my files that I also flash via this zip, but left the shell script.
In the shell, the sed lines are original_value/new_value and the echo lines add new lines at the bottom.
Hope this helps.
Click to expand...
Click to collapse
THank you, that worked marvellously!

anon768 said:
THank you, that worked marvellously!
Click to expand...
Click to collapse
No probs;

I know this is an old thread, but I have a question for Dan or whomever else could answer it.
I was trying to integrate this script into another updater-script that I use for other stuff. so (since it uses the new updater-binary) I put these lines in it
set_metadata_recursive("/system/build_prop.sh", "uid", 0, "gid", 0, "dmode", 0777, "fmode", 0777, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
run_program("sbin/sh", "/system/build_prop.sh");
delete("/system/build_prop.sh");
It works sort of fine. All the sed lines replace some text with some other text as expected. However, the echo lines, rather than appending the build.prop file, instead make a totally new build.prop file, with an identical name, sitting right next to it. I didn't even know that could happen.
Any thoughts on how to fix it?
oh ps an example of a line that works and one that doesn't are as follows
sed -i 's/telephony.lteOnCdmaDevice=0/telephony.lteOnCdmaDevice=1/g' /system/build.prop;
echo -e "telephony.lteOnGsmDevice=1" >> /system/build.prop

nevermind. turns out the echo lines were just missing semicolons. at first I thought it was a permissions issue on build.prop, so i set it to universal read/write then set it back to what it was supposed to be after script finishes
set_metadata("/system/build_prop.sh", "uid", 0, "gid", 0, "mode", 0777, "selabel", "ubject_r:system_file:s0", "capabilities", 0x0)
set_metadata("/system/build.prop", "uid", 0, "gid", 0, "mode", 0777, "selabel", "ubject_r:system_file:s0", "capabilities", 0x0)
run_program("sbin/sh", "/system/build_prop.sh");
delete("/system/build_prop.sh");
set_metadata("/system/build.prop", "uid", 0, "gid", 0, "mode", 0644, "selabel", "ubject_r:system_file:s0", "capabilities", 0x0)

Related

[PC][APP] D4 Update Zip Maker - Edify script like never before!

Hello guys, wanna share this app I made with you xda guys, hope it to be useful. Also will need help from other devices, so I can get update binarys, and make boot.img code
http://forum.xda-developers.com/showthread.php?p=16431272
New version it's up!
Bump, New version it's up!, now installable!
Thanks great Work!!!!
Tengo una pregunta de Newbie... :S
I'm trying to created a package to install/replace 3 apps... Below is the code... I successfully created the zip but is not extracting nothing... any guidance would be appreciated...
mount("yaffs2", "MTD", "system", "/system");
mount("yaffs2", "MTD", "userdata", "/data");
ui_print("Deleting Current Exchnage clients...");
delete("/system/app/email.apk", "/system/app/exchange.apk", "/system/app/emailwidget.apk ");
# Deleting Current Exchange client/apk...
ui_print("Extracting new email app...");
package_extract_file("data/Email.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/Email.apk");
# Extracting Current Email client...
package_extract_file("data/EmailWidget.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/EmailWidget.apk");
# Extracting Current EmailWidget client...
package_extract_file("data/Exchange.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/Exchange.apk");
# Extracting Current Exchange client...
ui_print("Installation Completed. Enjoy!");
corrections are
chpimentelpr said:
Thanks great Work!!!!
Tengo una pregunta de Newbie... :S
I'm trying to created a package to install/replace 3 apps... Below is the code... I successfully created the zip but is not extracting nothing... any guidance would be appreciated...
mount("yaffs2", "MTD", "system", "/system");
mount("yaffs2", "MTD", "userdata", "/data");
ui_print("Deleting Current Exchnage clients...");
delete("/system/app/email.apk", "/system/app/exchange.apk", "/system/app/emailwidget.apk ");
# Deleting Current Exchange client/apk...
ui_print("Extracting new email app...");
package_extract_file("data/Email.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/Email.apk");
# Extracting Current Email client...
package_extract_file("data/EmailWidget.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/EmailWidget.apk");
# Extracting Current EmailWidget client...
package_extract_file("data/Exchange.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/Exchange.apk");
# Extracting Current Exchange client...
ui_print("Installation Completed. Enjoy!");
Click to expand...
Click to collapse
Please make sure that you place email and widgets apk file in a folder system>app and then use package_extract_dir("system","/system") to move all apps at once .
Then when setting permission it should be 0755 and 0644 not 755 and 644
And add unmount("/system") command at the end before ui_print line
Make this correction and hopefully it will work

[Q] help with my kernel.zip, doesn't install kernel modules

In my kernel installer ZIP file, I have added some modules in system/lib/modules ... however they never end up getting installed.
My updater-script is:
Code:
ui_print("");
ui_print("Flashing Kernel");
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system");
package_extract_dir("system", "/system");
symlink("/lib/modules", "/system/lib/modules");
set_perm(0, 0, 0644, "/system/lib/libhardware_legacy.so");
set_perm(0, 0, 0644, "/system/lib/hw/lights.msm8660.so");
set_perm(0, 2000, 0550, "/system/etc/init.qcom.post_boot.sh");
set_perm_recursive(0, 0, 0755, 0644, "/system/lib/modules");
unmount("/system");
show_progress(0.500000, 0);
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "/dev/block/mmcblk0p8"),
delete("/tmp/boot.img"));
show_progress(0.100000, 0);
ui_print("Done");
I've included my kernel zip file also so you can extract it and find the directory structure. Is it because the initramfs in boot.img overwrites this directory or something?
http://users.ece.cmu.edu/~gnychis/hedpe_kernel.zip
it appears that anything put in the root of /system or in /system/lib is not honored. If I put something in /system/etc it will get installed via the updater script

Update script permission?

I am finishing off an update script and ran into a problem trying to set the permissions on an init.d script that I am loading to the system. Here are a few things I have tried to set on "crystal_clear" without success.
set_perm_recursive(0, 0, 0777, 0777, "/system/etc/init.d");
set_perm(0, 0, 0777, "/system/etc/init.d/crystal_clear");
Am I even close with this? This is my first update script. I bet i'm just missing something stupid but it's been killing me for hours and tried so many variations.
Here is everything so far. If there is something else you see here that doesn't look right please let me know.
show_progress(0.1, 0);
ui_print("Mounting System Partition");
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");
package_extract_file("tweaks/buildprop.sh", "/tmp/buildprop.sh");
package_extract_file("tweaks/sysmount/sysrw", "/tmp/sysrw");
package_extract_file("tweaks/sysmount/sysro", "/tmp/sysro");
set_perm(0, 0, 0777, "/tmp/buildprop.sh");
set_perm(0, 0, 0777, "/tmp/sysrw");
set_perm(0, 0, 0777, "/tmp/sysro");
ui_print("");
ui_print("Patching Build.prop");
run_program("/sbin/sh", "/tmp/sysrw");
run_program("/sbin/sh", "/tmp/buildprop.sh");
ui_print("");
ui_print("Patching adreno_config.txt, and egl.cfg");
package_extract_dir("system", "/system");
run_program("/sbin/sh", "/tmp/sysro");
show_progress(0.1, 10);
ui_print("");
ui_print("All tweaking processes are done");
ui_print("Adjusting framebuffer and color depth");
package_extract_file("system", "/system/etc/init.d");
set_perm(0, 0, 0777, 0777, "/etc/init.d/crystal_clear");
show_progress(0.2, 0);
unmount("/system");
ui_print("DONE");
General comments.
A simple
Code:
set_perm_recursive(0, 0, 0755, 0755, "/system/etc/init.d");
after I've extracted the all the files I've wanted to the right place has always worked fine in the CWM ZIP I keep for personal use to install BusyBox etc.
razz1 said:
package_extract_file("tweaks/sysmount/sysrw", "/tmp/sysrw");
package_extract_file("tweaks/sysmount/sysro", "/tmp/sysro");
set_perm(0, 0, 0777, "/tmp/sysrw");
set_perm(0, 0, 0777, "/tmp/sysro");
run_program("/sbin/sh", "/tmp/sysrw");
run_program("/sbin/sh", "/tmp/sysro");
Click to expand...
Click to collapse
You don't need these. CWM/TWRP will mount /system rw by default and you don't really need to remount it ro in CWM.
package_extract_dir("system", "/system");
package_extract_file("system", "/system/etc/init.d");
Click to expand...
Click to collapse
Is "system" a directory or a file?
That said, I think you want the former - just have a system folder in the root of your ZIP mirroring where you want the files to be placed (so in your ZIP, create a "system" folder at the same level as META-INF and then have a "etc" folder inside that, then a "init.d" folder inside "etc" with your script inside "init.d").
THANK YOU!
I'm going to try a few things you said and go from there.
Here is my current hierarchy...
4xMultiSampling_Antialiasing.zip
......META-INF
..........com
.............google
................android
.....................update-binary
.....................updater-script
......system
.........etc
.............Init.d
................crystal_clear. <-----this is what would not change to 0777
......lib
........egl
..........egl.config
......tweaks
.........build.prop.sh
.........sysmount
..............sysro
..............sysrw
razz1 said:
.............Init.d
Click to expand...
Click to collapse
If that's not a typo, it needs to be init.d - ext* file systems, unlike Windows', are case-sensitive
Yes that was a typo, but I appreciate your attention to detail because that's is exactly what I need. As you know, its that sort of thing that can kill a script. Critique away!
It appears I was able to pull it off with your help. Thanks. All is well here now.
Glad to hear it.

[GUIDE]Aroma Installer on any rom[Easy and simple]

Hello XDA member, i have little guide to add Aroma In your rom, this guide very easy to use, just need little change, and i gave the clues what you can change and can't change
Ok, to the point of the guide
Download the latest AROMA installer from this thread or my edited Aroma installer here
Then follow these little instructions
loadlang("langs/en.lang");
change "langs/en.lang" to change language, see in the aroma folder
theme("sense");
change "sense" to change aroma theme, see in the aroma folder
Added changelog/features
write your rom features or changelog in this files the file is in META-INF\com\android\google\android\aroma\changelog.txt
Little tutorial
Note :
> "xxx" means the words inside this ""
> you can change all xxx words
Option 1 : Option for select devices
> In aroma-config
);
selectbox(
#-- Title
"xxx", > you can change the "xxx" words
#-- Sub Title
"xxx", > you can change the "xxx" words
#-- Icon: <AROMA Resource Dir>/icons/default.png or <ThemeDir>/icon.default.png
"@default",
#-- Will be saved in /tmp/aroma/mods.prop
"system.prop",
"xxx","", 2, > you can change the "xxx" words
"xxx","xxx",1, > you can change the "xxx" words
"xxx","xxx",0, > you can change the "xxx" words
"xxx","xxx",0 > you can change the "xxx" words
#--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
);
> In updater-script
# xxx
# xxx
if
file_getprop("/tmp/aroma/system.prop","selected.1") == "1"
then
ui_print("xxx");
package_extract_dir("model/p760", "/system");
endif;
> you can change the "xxx" after "package_extract_dir" words depend on your own,
i use p760, which is the file is located in model/p760 folder,
make sure you put the right position of the file,
example :
i want to put "ducati-m3.bin" file in system/vendor/firmware
then that file should be in model/p760/vendor/firmware (look at the folder)
do the same thing for the rest of it
Option 2 : Option for add or remove apps
You can edit what you to install or remove from your rom, i used "Live Wallpapers" and some apps, you can edit yourself
> In aroma-config
checkbox(
"Install apps", > you can change the "xxx" words
"Uncheck items to remove", > you can change the "xxxx" words
"@default", > you can't change the "xxx" words
"remove.prop", > you can't change the "xxxx" words
"Live Wallpapers","",2, > you can change the "xxx" words
"Basic Dreams","",1, > you can change the "xxx" words
"Cosmic Flow","",1, > you can change the "xxx" words
"Photo Table","",1, > you can change the "xxx" words
"Applications","",2, > you can change the "xxx" words
"Carhome.apk","Carhome",1, > you can change the "xxx" words
"Protips.apk","Pro tips",1, > you can change the "xxx" words
"QuickBoot.apk","Quick Boot",1, > you can change the "xxx" words
);
> In updater-script
For install apps
# xxx > you can change the xxx words
# xxx > you can change the xxx words
if
file_getprop("/tmp/aroma/xxx.prop","selected.1") == "1" > you can change the xxx.prop words
then
ui_print("xxxx"); > you can change the "xxx" words
package_extract_file("camera/GoogleCamera.apk", "/system/app/GoogleCamera.apk");
endif;
> you can change the "xxx" after "package_extract_file" words depend on your own,
i use camera, which is the file is located in camera folder, then name of camera app
then i want to install in system/app folder, do the same thing for the rest of it
For remove apps
# xxx > you can change the xxx words
# xxx > you can change the xxx words
if
file_getprop("/tmp/aroma/remove.prop","item.1.1") == "0"
then
delete("/system/app/CarHome");
endif;
> change this "/system/app/CarHome" depend on what you want to remove, i used CarHome app
do the same thing for the rest of it
Last step : Change Updater script for installing rom
=> Step one : Device initial
Fine these lines
assert(getprop("ro.product.device") == "p760" || getprop("ro.build.product") == "p760" || abort("This package is for \"p760\" devices; this is a \"" + getprop("ro.product.device") + "\"."); );
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.1/by-name/system", "/system");
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "backup");
unmount("/system");
show_progress(0.200000, 0); >until this
Replace those lines with your updater.scirpt until show_progress line
=> Step Two : Format system
Fine these lines
format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.1/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.1/by-name/system", "/system");
Replace those lines with your updater.scirpt
=> Step Three : Extracting files and setup symlink
"xxx" means skiping
Fine these lines
ui_print("@ Extracting System Files..");
package_extract_dir("system", "/system");
symlink("../bin/fsck.f2fs", "/system/bin/dump.f2fs");
symlink("../xbin/su", "/system/bin/su");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
"/system/xbin/adjtimex", "/system/xbin/arp", "/system/xbin/ash",
"/system/xbin/awk", "/system/xbin/base64", "/system/xbin/basename",
"/system/xbin/bbconfig", "/system/xbin/blkid", "/system/xbin/blockdev",
xxxxx
xxxxx
show_progress(0.600000, 0);
Replace those lines with your updater.scirpt until show_progress line
=> Step Four : Setting permission
"xxx" means skiping
Fine these lines
ui_print("@ Setting Permissions");
set_metadata_recursive("/system", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u: object_r:system_file:s0");
set_metadata_recursive("/system/addon.d", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u: object_r:system_file:s0");
set_metadata_recursive("/system/bin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u: object_r:system_file:s0");
set_metadata("/system/bin/app_process", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u: object_r:zygote_exec:s0");
set_metadata("/system/bin/clatd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u: object_r:clatd_exec:s0");
xxxx
xxxx
ui_print("@ Done");
ui_print("@ By nasheich");
ui_print("@ If you like this new build");
ui_print("@ Go back to my thread and press THANKS button");
show_progress(1.000000, 0);
unmount("/system");
Replace those lines with your updater.scirpt until unmount("/system"); line
Click to expand...
Click to collapse
Credit :
- amarullz for Aroma Installer
- nasheich for this little guide
Tips and Trick
- For rom under Android 4.4.2 (Kitkar), skip the step 3 and step four,
- After installation, take a log, it's easier if your get installation failed, like status 6, status 7, etc
note : status 0 it's mean working or installation successful
Questions and Answers
Q : Can i use this on my rom ?
A : Yes, this cam be used for any roms
Q : I got error on installation, status 6/7
A : Check your updater.script, there must be something wrong
Q : I've checked it all, look like nothing wrong in updater.script, any idea ?
A : Try another recovery, in some device, aroma didn't work
@Nasheich Xfiles the link to your installer is broken.

Maintaining build.prop changes in ROM Updates

Hey guys,
So, I am using CM currently, and use CyanDelta to update every couple of days (it works so well!). It works great because I can have it flash Franco Kernel and SuperSU after updating, so those are maintained at least. Annoying part is, every time I update, my build.prop is being overwritten. I scale my DPI down to 405 in order for everything to be ungigantic, and when it gets changed back, it essentially erases my home screens. So, every update, I have to re-apply my settings, and re-do my homescreens. I'm just wondering if you guys have come up with a way to maintain build.prop changes between ROM updates? I feel like there may be a script or something out there, but with some cursory searching around, I can't find jack.
Thanks!
Just copy your current build.prop to your sd when u flash a new build copy and paste over the new one change permissions reboot
Sent from my SM-N910C using XDA Free mobile app
duvalbmarley said:
Just copy your current build.prop to your sd when u flash a new build copy and paste over the new one change permissions reboot
Sent from my SM-N910C using XDA Free mobile app
Click to expand...
Click to collapse
What happens if there are important build.prop changes in an update though?
Transmitted via Bacon
timmaaa said:
What happens if there are important build.prop changes in an update though?
Transmitted via Bacon
Click to expand...
Click to collapse
Most changes are not build.prop related and if it is it would be easier to just copy and paste those changes to the build.prop u copied on your sd card.. and if it's the same rom then it should be no problem or even if it's 2 different roms with the same Base just make sure to copy your original before replacing incase anything goes wrong.... I'm just throwing out a solution what do you suggest the op do??? Don't bash the helper give a helping hand or don't comment
Sent from my SM-N910C using XDA Free mobile app
duvalbmarley said:
Most changes are not build.prop related and if it is it would be easier to just copy and paste those changes to the build.prop u copied on your sd card.. and if it's the same rom then it should be no problem or even if it's 2 different roms with the same Base just make sure to copy your original before replacing incase anything goes wrong.... I'm just throwing out a solution what do you suggest the op do??? Don't bash the helper give a helping hand or don't comment
Sent from my SM-N910C using XDA Free mobile app
Click to expand...
Click to collapse
Whoa, calm down. I'm not bashing you, just asking a question, in order to work with you to come up with the best solution. I agree, most changes aren't contained in the build.prop, but every now and again there could be one or two and it'd take more time checking the two build.props against other than it would just changing the DPI and setting up screens after a flash. I just don't think this solution, while it may work, is a very elegant or practical one, considering that you'd need to waste time to check the build.prop anyway.
@kmakiki, what launcher do you use? I use the app Texdroider to adjust my DPI to 370 after each nightly flash too, but my home screens are never affected. I use Nova Launcher.
Transmitted via Bacon
timmaaa said:
Whoa, calm down. I'm not bashing you, just asking a question, in order to work with you to come up with the best solution. I agree, most changes aren't contained in the build.prop, but every now and again there could be one or two and it'd take more time checking the two build.props against other than it would just changing the DPI and setting up screens after a flash. I just don't think this solution, while it may work, is a very elegant or practical one, considering that you'd need to waste time to check the build.prop anyway.
@kmakiki, what launcher do you use? I use the app Texdroider to adjust my DPI to 370 after each nightly flash too, but my home screens are never affected. I use Nova Launcher.
Transmitted via Bacon
Click to expand...
Click to collapse
Well in my situation I have speed tweaks Internet tweaks dpi changes and a bunch of other tweaks I add to build.prop and i would rather just copy one or two lines then to add every tweak and change after every update
Sent from my SM-N910C using XDA Free mobile app
duvalbmarley said:
Well in my situation I have speed tweaks Internet tweaks dpi changes and a bunch of other tweaks I add to build.prop and i would rather just copy one or two lines then to add every tweak and change after every update
Sent from my SM-N910C using XDA Free mobile app
Click to expand...
Click to collapse
Yeah, but what I'm saying is that it would be time consuming to actually go through each build.prop line by line to discover if there are any that are different or added/removed. It isn't the adding of lines that's the problem, it's having to find out if you need to.
Transmitted via Bacon
timmaaa said:
Yeah, but what I'm saying is that it would be time consuming to actually go through each build.prop line by line to discover if there are any that are different or added/removed. It isn't the adding of lines that's the problem, it's having to find out if you need to.
Transmitted via Bacon
Click to expand...
Click to collapse
Most developer's have change logs to show what was updated and if it's build.prop changes which most likely it won't be u could just ask or it should be posted in change log let's not argue about the changes let's find another solution besides copy and paste since no one has came up with another option
Sent from my SM-N910C using XDA Free mobile app
duvalbmarley said:
Most developer's have change logs to show what was updated and if it's build.prop changes which most likely it won't be u could just ask or it should be posted in change log let's not argue about the changes let's find another solution besides copy and paste since no one has came up with another option
Sent from my SM-N910C using XDA Free mobile app
Click to expand...
Click to collapse
I think the best solution for him is to just change the launcher he's using, that's where the problem lies.
Transmitted via Bacon
flash this zip (attachement)
it will add a file called 99-DPI.sh to
/system/addons.d/ and, by that, it will be executed after every rom flash that uses the backupscripts (cm,... )
the script will replace the default ro.sf.lcd_density to a value you specify (the new default value is 360, this is what i use)
you can add a file called .dpi to your sdcard (/sdcard/.dpi) which contains a number (e.g. 405), then this value will be used after each rom flash.
if you have some questions then feel free to ask :>
[edit]
i just read the whole thread (i was missing some posts)
the 99-DPI.sh can be used to edit any build.prop change, you just have to add some lines, it should be self explaining.
@aHcVolle can u explain more on how to dd new lines to be added into build. Prop
Thnx in advance
@kmakiki i just think of it what if u edit the build. Prop in the cyandelta zip file b4 flashing it?
Ma7mu7 said:
@aHcVolle can u explain more on how to dd new lines to be added into build. Prop
Thnx in advance
Click to expand...
Click to collapse
Can you give more info in what you are trying to do?
aHcVolle said:
Can you give more info in what you are trying to do?
Click to expand...
Click to collapse
Thanks for the fast reply i want to add some lines to build.prop other than changing the dpi i.e disabling bootanimation 3g tweaks etc..
Ma7mu7 said:
Thanks for the fast reply i want to add some lines to build.prop other than changing the dpi i.e disabling bootanimation 3g tweaks etc..
Click to expand...
Click to collapse
OK, edit the file script/99-DPI.sh
remove everything between restore) and ;;
and add your stuff between those 2.
example:
Code:
restore)
echo "dummy_var=1" >> /system/build.prop
ui_print "added line to build.prop"
;;
that should be everything you need.
aHcVolle said:
OK, edit the file script/99-DPI.sh
remove everything between restore) and ;;
and add your stuff between those 2.
example:
Code:
restore)
echo "dummy_var=1" >> /system/build.prop
ui_print "added line to build.prop"
;;
that should be everything you need.
Click to expand...
Click to collapse
Sooo it should be
Code:
restore)
echo "dummy_var=1" >> /system/build.prop
ui_print "added line to build.prop"
debug.sf.nobootanimation=1
ro.config.hw_quickpoweron=true
persist.sys.shutdown.mode=hibernate
dev.bootcomplete=0 ;;
Instead of
Code:
restore)
# We only have work when restoring....
if [ -f $FILE ]; then
# The DPI file is existing, lets check its content
FILEDPI=$(cat $FILE)
# Convert to int (maybe not needed)
(( FILEDPI=$FILEDPI+0 ))
Right?
No
Code:
restore)
echo "debug.sf.nobootanimation=1" >> /system/build.prop
echo "ro.config.hw_quickpoweron=true" >> /system/build.prop
echo "persist.sys.shutdown.mode=hibernate" >> /system/build.prop
echo "dev.bootcomplete=0" >> /system/build.prop
ui_print "added 4 lines to build.prop"
;;
aHcVolle said:
No
Code:
restore)
echo "debug.sf.nobootanimation=1" >> /system/build.prop
echo "ro.config.hw_quickpoweron=true" >> /system/build.prop
echo "persist.sys.shutdown.mode=hibernate" >> /system/build.prop
echo "dev.bootcomplete=0" >> /system/build.prop
ui_print "added 4 lines to build.prop"
;;
Click to expand...
Click to collapse
Thank you very very much just last question
What abt the rest
Code:
# We only have work when restoring....
if [ -f $FILE ]; then
# The DPI file is existing, lets check its content
FILEDPI=$(cat $FILE)
# Convert to int (maybe not needed)
(( FILEDPI=$FILEDPI+0 ))
Shall i just delete them or keep the,m?
Ma7mu7 said:
Thank you very very much just last question
What abt the rest
Code:
# We only have work when restoring....
if [ -f $FILE ]; then
# The DPI file is existing, lets check its content
FILEDPI=$(cat $FILE)
# Convert to int (maybe not needed)
(( FILEDPI=$FILEDPI+0 ))
Shall i just delete them or keep the,m?
Click to expand...
Click to collapse
you can delete them.
make the file look like this:
Code:
#!/sbin/sh
# persistant dpi by volle
# credits: nuclearmistake for ui_print cmd
# Print function
export OUTFD=$(ps | grep -v "grep" | grep -o -E "update_binary(.*)" | cut -d " " -f 3); #BIG props to Chainfire
[ ! $OUTFD ] && export OUTFD=$(ps | grep -v "grep" | grep -o -E "/tmp/updater(.*)" | cut -d " " -f 3); #BIG props nuclearmistake for TWRP-izing
ui_print() { if [ $OUTFD ]; then echo "ui_print $*" 1>&$OUTFD; fi; return 0; }
case "$1" in
pre-backup)
;;
backup)
;;
post-backup)
;;
pre-restore)
;;
restore)
echo "debug.sf.nobootanimation=1" >> /system/build.prop
echo "ro.config.hw_quickpoweron=true" >> /system/build.prop
echo "persist.sys.shutdown.mode=hibernate" >> /system/build.prop
echo "dev.bootcomplete=0" >> /system/build.prop
ui_print "added 4 lines to build.prop"
;;
post-restore)
;;
*)
ui_print " Unkown command $1"
;;
esac
@aHcVolle thanx for the script.
i was also searching how to add lines to build.prop in recovery and it works perfect :good:
aHcVolle said:
you can delete them.
make the file look like this:
[/code]
Click to expand...
Click to collapse
I have a question about combining scripts.
I managed to combine 2 scripts.
First one i created with Android Flashable Zip Creator to install to flash apps in recovery.
Second one is the Fermion Blackhole script to remove bloatware and unwanted apps, also in recovery.
I just copied part of the blackhole into the 1st scipt. I tested it and it works.
Code:
ui_print("@Starting the install process");
ui_print("Setting up required tools...");
ui_print("Mounting Partitions...");
ui_print(" ");
run_program("/sbin/busybox","mount", "/system");
run_program("/sbin/busybox","mount", "/data");
set_progress(0.1);
ui_print("@Installing System Apps");
package_extract_dir("customize/APKs-System/APKs-System_appz", "/system/app");
set_progress(0.2);
set_progress(0.25);
set_progress(0.3);
set_progress(0.4);
set_progress(0.5);
set_progress(0.6);
set_progress(0.7);
set_progress(0.8);
set_progress(0.9);
ui_print("-Sending bloatware to a blackhole.");
delete_recursive(
"/system/app/BasicDreams",
"/system/app/Browser",
"/system/app/Camera2",
"/system/app/CMFileManager",
"/system/app/CMWallpapers",
"/system/app/Eleven",
"/system/app/Email",
"/system/app/Exchange2",
"/system/app/Galaxy4",
"/system/app/Gallery2",
"/system/app/HoloSpiralWallpaper",
"/system/app/LatinIME",
"/system/app/LiveWallpapers",
"/system/app/LiveWallpapersPicker",
"/system/app/Microbes",
"/system/app/NoiseField",
"/system/app/PhaseBeam",
"/system/app/PhotoPhase",
"/system/app/PhotoTable",
"/system/app/PicoTts",
"/system/app/VisualizationWallpapers",
"/system/app/WhisperPush"
);
delete_recursive(
"/system/priv-app/AudioFX",
"/system/priv-app/CellBroadcastReceiver",
"/system/priv-app/Mms",
"/system/priv-app/MmsService",
"/system/priv-app/OmniSwitch",
"/system/priv-app/Trebuchet",
"/system/priv-app/Wallet"
);
set_progress(0.9);
set_metadata_recursive("/system/addon.d", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/app", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/permissions", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/preferred-apps", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/framework", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/priv-app", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
ui_print("-Unmounting system partition.");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
ui_print("");
ui_print("Done debloating your device!");
ui_print("@Finished Install");
set_progress(1);
Is it possible to add your script to the updater.script ? What part should i copy ? And also can i just add the /script folder into my zip flash file ?
These are the 2 files i use to edit build.prop :
Code:
ui_print("Persistant DPI mod by volle");
ui_print(" Mounting /system");
ifelse(is_mounted("/system"), unmount("/system"));
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
ui_print(" Extracting backupscript");
package_extract_file("script/99-DPI.sh", "/system/addon.d/99-DPI.sh");
set_perm(0, 0, 0777, "/system/addon.d/99-DPI.sh");
ui_print(" Running backupscript");
assert(run_program("/system/addon.d/99-DPI.sh","restore"));
ui_print(" Unmounting /system");
unmount("/system");
ui_print("Everything done");
Code:
#!/sbin/sh
# persistant dpi by volle
# credits: nuclearmistake for ui_print cmd
# Print function
export OUTFD=$(ps | grep -v "grep" | grep -o -E "update_binary(.*)" | cut -d " " -f 3); #BIG props to Chainfire
[ ! $OUTFD ] && export OUTFD=$(ps | grep -v "grep" | grep -o -E "/tmp/updater(.*)" | cut -d " " -f 3); #BIG props nuclearmistake for TWRP-izing
ui_print() { if [ $OUTFD ]; then echo "ui_print $*" 1>&$OUTFD; fi; return 0; }
case "$1" in
pre-backup)
;;
backup)
;;
post-backup)
;;
pre-restore)
;;
restore)
echo "qemu.hw.mainkeys=0" >> /system/build.prop
ui_print " HW Mainkeys set"
;;
post-restore)
;;
*)
ui_print " Unkown command $1"
;;
esac

Categories

Resources