[Guide][Init.d script]Set resolution and dpi at boot - OnePlus X General

First of all you need root and init d support.
Second i will not take responsibility if something happens to you're phone.
I tried screen shift for a long time, but it kept disabling the set at boot and i got sick of it. Now im using 1600x900 with 360dpi with init d script and could not be happier that it works perfectly.
1. Download the file.
2. Open your preferred file manager with root priviliges.
3. Browse to your download folder and search the file.
4. Remove the txt extension from the file by renaming it.
4. Open the file with text editor and change the resolution and dpi to what you want.
5. Copy or cut the file into /etc/init.d
6. Reboot your phone and boom! You have you're desired resolution and dpi set at boot.
Stock 1900x1080 480dpi file attached.
You can change the values with text editor if you wan't different resolution and dpi.
1600x900 360dpi setting file also included.

Eh?
Code:
adb shell wm density “INSERT_DPI” && adb reboot

SpiritBreak3r said:
Eh?
Code:
adb shell wm density “INSERT_DPI” && adb reboot
Click to expand...
Click to collapse
What about the resolution?
I think that that only changes dpi.
I want more performance with lower res.

Fatsodonkey said:
What about the resolution?
I think that that only changes dpi.
I want more performance with lower res.
Click to expand...
Click to collapse
Code:
wm size "resolution"
wm size reset
wm density "DPI"
wm density reset

Does that also work with every boot?
I thought earlier that it just changed the value and after boot it would not stick.
Maybe i should not make guides since im a bit nooby with this. I just thought that it would make life easier for people like me.
I will just add the adb commands to it and call it a day.

Related

AmeriCanAndroid screen size issue

so i just flashed the AmeriCanAndroid rom and everything is running smoothly. the only issue is that the screen is very small. like the notification bar is so small i can hardly see it. the lock screen is a little bigger then a US stamp. i searched the original thread but there are over 1500 pages and the search function yeilded no results . so how do i fix the screen size?
The very first page of ACA thread says
"-Starting with 080111 and later, users can edit /sdcard/android/startup.txt prior to booting to adjust LCD_DENSITY, GPS_ZONE, and DATA_SIZE (data.img)
(ie: the default lcd_density of ACA is 167. Edit the lcd_density= value to 240 to get standard sized icons and fonts)"
The part you're looking for is to change the value to 240.
I do agree, its a plague to look through that thread and search ain't no help if you don't search right
RE: Wrong Section
Hi...please put this in the questions and answers section...iron fist will be on you ...here are some solutions I found by simply using the search:
You can increase the density (sort of like changing monitor resolution) on your screen by simply changing the build.prop file. This gives you more viewing area on your screen. The build.prop file contains many user variables that are editable and one of them is the LCD Density. The lower the number, the higher the resolution. The default value is 240, but by simply changing it to 200, you can increase the resolution and see more emails in your email app, more app listings in the market, more room for widget alignment, crisper graphics, and much more!
PERMANENT ROOT SOLUTION:
now that we can do perm root, you can permanently change this by modifying your build.prop file located /system/build.prop. look for ro.sf.lcd_density and modify the number and save and reboot.
Recommended value is 200, though many users like 190. If you are unsure what you like, please try TEST MODE shown below!
Please be sure to download Spare Parts from the Market, and disable Compatibility Mode in the app. This will fix many, many apps from not displaying full-screen, however there are some apps that will not re-size.
This works really well if you pair it with something like Launcher Pro or ADW.Launcher, where you have control over rows/columns and resizing widgets.
Easiest Method -- Go to Market and download one of the LCD Density apps. Search "LCD Density."
Phone-Only Method:
You can use Root Explorer, or any text editor like notepad++ or text edit.
1. Open a File Manager and locate /system/build.prop
2. Make sure "/system" is mounted as R/W (in Root Explorer, click the Mount R/W button at the top.)
2A. MAKE A BACKUP!
3. Open and Edit the file.
4. Find ro.sf.lcd_density=240 and change it to desired value (recommend 200 or 190 for G2).
5. Save the file.
6. Exit and Reboot!
If you use a separate text editor, just copy the file to your SDCard, edit it there, and move it back and overwrite the original. I recommend backing up the original just-in-case.
ADB Method:
at the cmd prompt:
1. adb pull /system/build.prop
2. Go to SDK / Tools folder and open build.prop in a text editor (recommend WORDPAD for Windows).
3. Find ro.sf.lcd_density=240 and change it to desired value (recommend 200 or 190 for G2).
4. Save & Exit
5. go back to cmd prompt and type: adb shell mount -o remount,rw /dev/block/mmcblk0p25 /system
6. type: adb push build.prop /system/
7. exit and reboot phone!
hope this helps you out
Or if that doesn't work, go to spare parts and uncheck "compatibility mode" then reboot phone
Pansi SMS screen size issue
I am using american android 2.3.7.
I have installed Pansi SMS application for messaging but some how it is not coming on the fullscreen of HD2. It is just capturing upper middle part of the screen Neither am i able to open the settings of Pansi SMS. Even the windows key is not working to open its setting.
How can i resolve this.
Is there any other SMS app as good as PANSI ?

set a custom lcd density on I9305

A few have asked so...
To easily set a custom lcd screen setting...
download an app, or
create a file called local.prop containing the line below and save it in /data.
change the number in the line below to suit.
a setting of 320 made everything nice and big for my eyes.
Stock setting in Slimkat is 245.
this setting will over-ride the rom default, without changing the original files.
the below command will copy it there, then reboot to apply changes:
adb push /yourpath/to/local.prop /data
qemu.sf.lcd_density=320
Yep we know, this is nothing new and there are already hundreds of threads detailing this.
Thread closed.

DPI Change

Guys I heard by changing the DPI of Oxygen OS reduces lag..
It even improves the laggy camera app..
Never heard before..
If yes best way to change DPI & how much wil be better?
Root, then install le dpi changer.
It's just "ro.sf.lcd_density" property in build.prop file.
No need to install all kind of special apps. Just edit the file (root needed for editing system file) and reboot.
I found ro.sf.lcd_density=400 to be good enough zoom out,
so more stuff can fit on screen but still things are readable.
Use adb command from your PC: " adb shell wm density XXX" where xxx is your desired dpi. This can be done on rooted or non rooted devices.
I currently use 240 dpi but you can try different ones to find the right one that suits you.
Sent from my ONE A2005 using Tapatalk

Change to build.prop not having any effect

I'm pretty confused... I'm running Cataclysm with regular root (not systemless) and I've modified the build.prop (shows the modified value even after reboot) to change my screen dpi but upon reboot my dpi stays unchanged. Any ideas? I've tried to change the dpi through the adb method and that works but it shows some odd behavior in play store (some icons being too large, etc.) that other people say don't occur if you modify build.prop.
bgymn2000 said:
I'm pretty confused... I'm running Cataclysm with regular root (not systemless) and I've modified the build.prop (shows the modified value even after reboot) to change my screen dpi but upon reboot my dpi stays unchanged. Any ideas? I've tried to change the dpi through the adb method and that works but it shows some odd behavior in play store (some icons being too large, etc.) that other people say don't occur if you modify build.prop.
Click to expand...
Click to collapse
I'm running cataclysm as well. Changing the build prop works fine for me. Maybe it's the file manager application? I've had it happen to me when I first got my 6p and tried using root explorer. Also, make sure that you are actually saving the new build.prop and the values change before doing a FULL reboot
I had this exact problem on stock. I ended up downloading one of those DPI changer apps on the play store and it worked.. I have changed bp many times in the past. Don't know what was happening.
Sent from my Nexus 6P using Tapatalk
I tried dpi changers and build.prop editor apps and nothing works. I can change the model name and see the change reflected in the "about phone" section of settings so I know that the build.prop is being successfully edited. It just seems like my phone refuses to read the lcd_density line.
An update in case someone else runs into this problem. I can get the desired proper scaling if I change the build.prop value and use adb shell wm density with the same value in the build.prop. This fixes the scaling annoyances that I see from using adb shell wm density only to make the dpi smaller. I'm guessing the reason I can't use build.prop only to change the dpi is because I first tried to change the dpi using adb. For some reason that must trigger something and both places have to be changed.

Any way to change dpi without adb ?

I have rooted my BTV-W09 model. When I use 'adb shell wm density 320' from my computer terminal, the dpi setting is adjusted correctly, but it doesn't survive a reboot.
I tried to change the dpi setting with a build.prop editor directly on the tablet and with the Textdroider DPI app, but it doesn't work, it goes back to whatever DPI settings was implied by the display settings (from Small-400dpi to Large-480dpi).
Is there a way to permanently change the DPI setting to 320, or at least a way to do it directly from the tablet (without a computer)?
Why you not reading neighbor topics? Install Xposed, install App Settings module from here for example, activate it and setup whatever DPI you wish.
Thanks Slavon, but I'm speaking of a system-wide change, not just app by app. English is not my first language, sorry if it wasn't clear.
Sorry if I was a bit rude. Try "Pimp my rom" utility. Find it on Google Play. I worked for me and now I'm thinking of how to revert
Edit: if I got it right, this utility adds (modifies?) this key in build.prop: ro.sf.lcd_density
Not at all, I understand how it seemed like I was asking a duplicate question without looking in others threads, sorry again
And thanks a lot for the advice, I'll try Pimp my rom right away !
wlausrsker said:
Not at all, I understand how it seemed like I was asking a duplicate question without looking in others threads, sorry again
And thanks a lot for the advice, I'll try Pimp my rom right away !
Click to expand...
Click to collapse
If you just need to change density, you'd better try changing the value in build.prop first. And in case of any problems after, change the value of the key I wrote previously or restore the original build.prop from backup. Good luck.
Slavon-93 said:
If you just need to change density, you'd better try changing the value in build.prop first. And in case of any problems after, change the value of the key I wrote previously or restore the original build.prop from backup. Good luck.
Click to expand...
Click to collapse
I've tried this morning to change ro.sf.lcd_density to 320 in the build.prop and reboot. After reboot, ro.sf.lcd_density is still set to 320 but the display is still at 400dpi.
It's like ro.sf.lcd_density has no impact on the display dpi except for the display mode (tablet, phone, etc.).
Screen settings/Small + ro.sf.lcd_density=320 -> tablet mode in Chrome and 400dpi
Screen settings/Small + ro.sf.lcd_density=400 -> phone mode in Chrome and 400dpi
Screen settings/Large + ro.sf.lcd_density=320 -> tablet mode in Chrome and 480dpi
Screen settings/Large + ro.sf.lcd_density=400 -> phone mode in Chrome and 480dpi
I think maybe the DPI setting from build.prop is replaced during boot with the screen setting (Small:400dpi, Medium:440dpi, Large:480dpi). Could a init.d script could change the value after boot? I'll try tonight if the tablet allows init.d scripts to run.
Well, ok. I only quickly looked through the decompiled code. Change dpi with the app then, it'll make a backup of build. prop and try to compare both files - new and backup. I could have missed something. Just to mention, I didn't like the way tablet had behaved after changing DPI. EMUI is not well-designed for this. It's much better to set DPI for apps and leave it unmodified for system.
@wlausrsker this is covered in the apps running in phone mode thread. I posted there that the adb dpi change settings will stick after rebooting if you run the command "adb shell wm density 340 && adb reboot"*
*Use whatever density works best for you, I have found that 330 works best for me with the view mode and font set to large.
Slavon-93 said:
Change dpi with the app then, it'll make a backup of build. prop and try to compare both files - new and backup. I could have missed something.
Click to expand...
Click to collapse
johje said:
@wlausrskerI posted there that the adb dpi change settings will stick after rebooting if you run the command "adb shell wm density 340 && adb reboot"
Click to expand...
Click to collapse
johje, thanks but I tried it first and it doesn't survive reboot ("./adb shell wm density 320 && ./adb reboot" since I'm on Mac, it reboots in 400dpi).
Slavon, I've compared the files from before and after changing the dpi setting with the app, only ro.sf.lcd_density is changed, so you didn't miss anything.
Since methods successfully used by you and others don't work for me, it must be something I did differently on setting up my tablet. I used greatslon mod of TWRP and then flashed via TWRP the latest SuperSU (v2.79-SR1). Finally, I installed XposedInstaller and got xposed-v87-sdk23-arm64. Did any of you with reboot-surviving custom dpi setting used something different? (like the SRK Tool)
I'm off this weekend but I'll try next week to start over from scratch.
the reason adb change dpi and even build.prop change doesn't work is because huawei has set lcd_density in boot image. check content of /init.6x.rc
these init files are part of boot.img and will be overwritten at every boot. so what u need is a modified boot.img where this set lcd_density line is removed. Once you install that boot, you can set whatever dpi in build.prop and it will work. even adb dpi change will be persistent.
if you are on b026, i can share my edited boot.img
Thanks for the explanation bark1234, I now understand why everything I tried didn't survive reboot!
Thanks also for proposing your edited B026 boot.img but I'm on BTV-W09C100B005 and I can't find any B026 download for BTV-W09. From what I understand from other threads the latest Chinese OTA for the BTV-W09 is the BTV-W09C233B022, so I couldn't use it. Nevertheless, if you could maybe share it for others, it could help someone with the same problem on a BTV-DL09.
I tried to edit my boot.img but I'm a newbie. I've tried to extract my boot.img but I have no result with "cat /proc/mtd", so I extracted mmcblk0boot0 as a best guess. I tried to install abootimg to edit it but there's not blkid.h on Mac OS so I can't build it. If I give you what I extracted, could you maybe edit it like you did with yours? You would save me from applying at random a bunch of tutorials like I just did and hoping it will result in something usable In the meantime, I'll try and learn how to edit a boot.ini with my setup.
bark1234 said:
the reason adb change dpi and even build.prop change doesn't work is because huawei has set lcd_density in boot image. check content of /init.6x.rc
these init files are part of boot.img and will be overwritten at every boot. so what u need is a modified boot.img where this set lcd_density line is removed. Once you install that boot, you can set whatever dpi in build.prop and it will work. even adb dpi change will be persistent.
if you are on b026, i can share my edited boot.img
Click to expand...
Click to collapse
Just as an FYI, the adb dpi change initiated along with the reboot command has stuck for me after multiple reboots.
wlausrsker said:
Thanks for the explanation bark1234, I now understand why everything I tried didn't survive reboot!
Thanks also for proposing your edited B026 boot.img but I'm on BTV-W09C100B005 and I can't find any B026 download for BTV-W09. From what I understand from other threads the latest Chinese OTA for the BTV-W09 is the BTV-W09C233B022, so I couldn't use it. Nevertheless, if you could maybe share it for others, it could help someone with the same problem on a BTV-DL09.
I tried to edit my boot.img but I'm a newbie. I've tried to extract my boot.img but I have no result with "cat /proc/mtd", so I extracted mmcblk0boot0 as a best guess. I tried to install abootimg to edit it but there's not blkid.h on Mac OS so I can't build it. If I give you what I extracted, could you maybe edit it like you did with yours? You would save me from applying at random a bunch of tutorials like I just did and hoping it will result in something usable In the meantime, I'll try and learn how to edit a boot.ini with my setup.
Click to expand...
Click to collapse
If you are rooted, use flashfire app to get ur current boot.img from ur phone. and then copy it out to edit.
The tool i use for editing works on windows. i too have mac only, i have windows on vm in it.
https://www.dropbox.com/s/x46q5nzv49iauwi/Android Image Kitchen.rar?dl=1
Use above link to download tool i use.
unpackimg.bat will unpack boot img.
your init.x files will be in ramdisk, edit it there.
and then use repackimg.bat, it will create new boot.img.
johje said:
Just as an FYI, the adb dpi change initiated along with the reboot command has stuck for me after multiple reboots.
Click to expand...
Click to collapse
bark1234 said:
If you are rooted, use flashfire app to get ur current boot.img from ur phone. and then copy it out to edit.
The tool i use for editing works on windows. i too have mac only, i have windows on vm in it.
https://www.dropbox.com/s/x46q5nzv49iauwi/Android Image Kitchen.rar?dl=1
Use above link to download tool i use.
unpackimg.bat will unpack boot img.
your init.x files will be in ramdisk, edit it there.
and then use repackimg.bat, it will create new boot.img.
Click to expand...
Click to collapse
johje, it won't stuck for me, no matter how I try. Did you root by flashing the latest SuperSU? Did you installed xposed framework?
bark1234, thank you very much for the detailled explanation, I'll use Flashfire app to extract my boot.img and I'll try tomorrow at work on my Windows machine to edit it.
@wlausrsker I have not yet rooted my tablet. Once I got the dpi/phone apps issue fixed, it reduced my urgency for rooting. However, I will be rooting it soon, since a way has been found to enable the 5Ghz wireless adapter for the US version of the tablet. I will let you know if I am able to keep the dpi settings after rooting.
bark1234 said:
If you are rooted, use flashfire app to get ur current boot.img from ur phone. and then copy it out to edit.
unpackimg.bat will unpack boot img.
your init.x files will be in ramdisk, edit it there.
and then use repackimg.bat, it will create new boot.img.
Click to expand...
Click to collapse
Thanks again for the link and the explanation, it was really a painless process.
I used Flashfire app on my tablet to backup my boot.img (it resulted in a boot.lz4 file).
On my Windows machine, in a cmd window:
Code:
lz4 boot.lz4
unpackimg.bat boot
I then opened in Notepad++ the /ramdisk/init.61262.rc file to remove the line setprop ro.sf.lcd_density 560 in the on early-init and on boot sections of the file and saved.
In the cmd window:
Code:
repackimg.bat
rename image-new.img boot.img
I now have an edited boot.img to flash in TWRP. Does it seems to you that I did the editing correctly? The edited boot.img is 13.35Mb (about the same as the boot.lz4) but the extracted boot file before the unpacking was 32.77Mb. Is it normal?
13.9 is correct size. install this boot.img
For those of us following along. Does the edited boot image have to be flashed by TWRP in zip form? Or can we use Fastboot to flash it? or both will work?
I've done the edit's and have what I believe is a flashable zip. I personally like to use fastboot.
I have DPI set and holding by adb as I mentioned before but this is still nice to have.
Thanks
OP - here's a really easy way to change dpi and make it stick: https://play.google.com/store/apps/details?id=com.texdroider.texdroider_dpi
I'm using it on my MediaPad M3 without issues. PS - 320 is my preferred dpi as well, but I found it caused some issues like Settings would crash. I'm using 322 now without any issue for the last couple weeks. Enjoy

Categories

Resources