Post Reply

[GUIDE][MOD][CM9-11] LCD Density Changer

OP K_TECH

22nd March 2014, 11:18 PM   |  #1  
K_TECH's Avatar
OP Senior Member
Flag Sidoarjo
Thanks Meter: 594
 
428 posts
Join Date:Joined: Feb 2013
More
Hello guys, i want to share to you this guide. I took code and smalis from @Adi Aisiteru Reborn. So special thanks to him

by using this mod guide, you'll be able to change LCD Density whatever you want via Settings.apk

Ok lets go to Guide:
first of all need some requirement for this MOD-GUIDE
REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk
- notepad++
- Tool for decompiling, : APKTOOL 2.0.0 beta 9 or latest version
- Tool for Sign apk, : CM Signer

STEP 1
Decompile your settings.apk
- Download attached file and merge it to your decompiled Settings.apk
- Settings.apk\res\values\arrays.xml
add this lines to end of it before </resources>
Code:
    <string-array name="entries_lcd_density">
        <item>240</item>
        <item>242</item>
        <item>244</item>
        <item>246</item>
        <item>248</item>
        <item>250</item>
        <item>252</item>
        <item>254</item>
        <item>256</item>
        <item>258</item>
        <item>260</item>
        <item>262</item>
        <item>264</item>
        <item>266</item>
        <item>268</item>
        <item>270</item>
        <item>272</item>
        <item>274</item>
        <item>276</item>
        <item>278</item>
        <item>280</item>
        <item>282</item>
        <item>284</item>
        <item>285</item>
        <item>286</item>
        <item>288</item>
        <item>290</item>
        <item>292</item>
        <item>294</item>
        <item>296</item>
        <item>298</item>
        <item>300</item>
        <item>302</item>
        <item>304</item>
        <item>306</item>
        <item>308</item>
        <item>310</item>
        <item>312</item>
        <item>314</item>
        <item>316</item>
        <item>318</item>
        <item>320</item>
        <item>322</item>
        <item>324</item>
        <item>326</item>
        <item>328</item>
        <item>330</item>
        <item>332</item>
        <item>334</item>
        <item>336</item>
        <item>338</item>
        <item>340</item>
        <item>342</item>
        <item>344</item>
        <item>346</item>
        <item>348</item>
        <item>350</item>
        <item>352</item>
        <item>354</item>
        <item>356</item>
        <item>358</item>
        <item>360</item>
    </string-array>
    <string-array name="lcd_density_entries">
        <item>160</item>
        <item>182</item>
        <item>200</item>
        <item>220</item>
        <item>240</item>
        <item>245</item>
        <item>268</item>
        <item>280</item>
        <item>300</item>
        <item>320</item>
        <item>340</item>
        <item>361</item>
        <item>420</item>
        <item>480</item>
        <item>@string/custom_density</item>
    </string-array>
    <string-array name="lcd_density_stock_entries">
        <item>213 -- nexus7</item>
        <item>240 -- hdpi</item>
        <item>320 -- xhdpi</item>
        <item>480 -- xxhdpi</item>
    </string-array>
    <string-array name="lcd_density_stock_values">
        <item>213</item>
        <item>240</item>
        <item>320</item>
        <item>480</item>
    </string-array>
</resources>
- Settings.apk\res\values\ids.xml
add this lines to end of it before </resources>
Code:
    <item type="id" name="dpi">false</item>
    <item type="id" name="dpi_edit">false</item>
</resources>
- Settings.apk\res\values\strings.xml
add this lines to end of it before </resources>
Code:
    <string name="title_ui">General UI</string>
    <string name="title_ui_summary">Change the LCD Density</string>
    <string name="dpi">DPI</string>
    <string name="lcd_density_title">LCD Density</string>
    <string name="lcd_density_summary">unknown</string>
    <string name="current_lcd_density">"Current LCD Density: "</string>
    <string name="lcd_density_wizard">LCD Density Wizard</string>
    <string name="follow_through_title">Follow through!</string>
    <string name="follow_through_summary">Make sure you follow the steps one-by-one and complete each one before proceeding to the next.</string>
    <string name="stock_density_title">Change to preset values</string>
    <string name="stock_density_summary">Tablets and older phones use 160. Most phones use 240.</string>
    <string name="stock_density_changed_summary">"Density set to: "</string>
    <string name="reboot_title">Reboot NOW!</string>
    <string name="reboot_summary">Come back here after the reboot and complete the rest of the steps!</string>
    <string name="clear_market_data_title">3. Clear all relevant market data.</string>
    <string name="clear_market_data_summary">This step clears data from market, google play services and google services framework.</string>
    <string name="clear_market_data_cleared">Data successfully cleared</string>
    <string name="clear_market_data_donot_cleared">"Data couldn't be cleared, please clear it yourself!"</string>
    <string name="reboot_cleardata_title">4. Reboot!</string>
    <string name="reboot_cleardata_summary">Come back here after the reboot and complete the rest of the steps!</string>
    <string name="open_market_title">5. Open Market and hit accept</string>
    <string name="open_market_summary">Press back when done to return here.</string>
    <string name="open_market_summary_could_not_open">"Couldn't open the market! If you're sure it's installed, open it yourself from the launcher."</string>
    <string name="custom_density_title">Change density to whatever you like!</string>
    <string name="custom_density_summary">Some values may cause compatibility issues with apps and the playstore, use at your own RISK!</string>
    <string name="custom_density_summary_invalid">INVALID DENSITY!</string>
    <string name="stock_density">320 stock</string>
    <string name="custom_density">custom</string>
    <string name="set_custom_density_title">Set custom density</string>
    <string name="set_custom_density_set">Set</string>
    <string name="custom_density_dialog_title">WARNING!</string>
    <string name="custom_density_dialog_summary">Changing your LCD density can cause unexpected app behavior. If you encounter market app incompatibility please return here and restart the process from step 1.</string>
    <string name="custom_density_dialog_button_got">Got it!</string>
    <string name="custom_density_dialog_button_reboot">Reboot now</string>
    <string name="su_dialog_error_title">Warning</string>
    <string name="su_dialog_error_message">"An error occurred.

Please check for root access. To activate go into superuser settings and enable root access."</string>
    <string name="lcd_warning_title">LCD Density Warning</string>
    <string name="lcd_warning">Be Advised that it is recommended to use a Multi-DPI Play Store to avoid any issues with apps after changing your system density. Do you understand?</string>
    <string name="lcd_warning_yes">YES</string>
    <string name="lcd_warning_no">NO</string>
</resources>
- Settings.apk\res\xml\display_settings.xml *you can put the line below whereever you like, system_settings.xml/system_ui_settings,etc
add this line to end of it before </PreferenceScreen>
Code:
    <PreferenceScreen android:title="@string/lcd_density_title" android:key="lcd_density_setup" android:fragment="com.android.settings.adi.fragments.DensityChanger" />
</PreferenceScreen>
- Settings.apk\AndroidManifest.xml
add this line
Code:
        <activity android:label="@string/lcd_density_wizard" android:name=".fragments.DensityChanger">
            <intent-filter>
                <action android:name="android.intent.action.CREATE_SHORTCUT"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
- Decompile Settings.apk
- Sign Settings.apk
- then Recompile again

STEP 2
Compare the code below with your public

- Settings\smali\com\android\settings\adi\fragments
Code:
DensityChanger$1.smali
	#56		0x7f07083b	type="string" name="clear_market_data_cleared"

DensityChanger$4.smali
	#52		0x7f0a023b	type="id" name="dpi_edit"
	#120	0x7f070844	type="string" name="custom_density_summary_invalid"
	
DensityChanger$ClearMarketDataTask.smali
	#582	0x7f07083b	type="string" name="clear_market_data_cleared"
	
DensityChanger.smali
	#199	0x7f07084d	type="string" name="su_dialog_error_title"
	#204	0x7f07084e	type="string" name="su_dialog_error_message"
	#209	0x7f070487	type="string" name="ok"
	#239	0x7f050058	type="xml" name="adi_lcd_density_setup"
	#277	0x7f07084f	type="string" name="lcd_warning_title"
	#283	0x7f070850	type="string" name="lcd_warning"
	#289	0x7f070852	type="string" name="lcd_warning_no"
	#299	0x7f070851	type="string" name="lcd_warning_yes"
	#388	0x7f070486	type="string" name="cancel"
	#407	0x7f040095	type="layout" name="adi_alert_dialog_text_entry"
	#427	0x7f070847	type="string" name="set_custom_density_title"
	#445	0x7f070848	type="string" name="set_custom_density_set"
	#496	0x7f070849	type="string" name="custom_density_dialog_title"
	#510	0x7f07084a	type="string" name="custom_density_dialog_summary"
	#530	0x7f07084b	type="string" name="custom_density_dialog_button_got"
	#548	0x7f07084c	type="string" name="custom_density_dialog_button_reboot"
	#627	0x7f070846	type="string" name="custom_density"
	#709	0x7f070836	type="string" name="stock_density_changed_summary"
	#887	0x7f070841	type="string" name="open_market_summary_could_not_open"

NOTE!
DensityChanger$1.smali
#56 0x7f07083b type="string" name="clear_market_data_cleared"
blue = line in smali
red = code in smali and public
green = public
- Decompile Settings.apk
- Sign Settings.apk
- Push Settings.apk in system/app

done ,
have a nice Moding
Good luck
Attached Files
File Type: zip ApkMultitools_CM_signer.zip - [Click for QR Code] (5.4 KB, 82 views)
File Type: zip Settings.zip - [Click for QR Code] (22.1 KB, 166 views)
Last edited by K_TECH; 23rd March 2014 at 10:21 PM.
The Following 9 Users Say Thank You to K_TECH For This Useful Post: [ View ]
22nd March 2014, 11:23 PM   |  #2  
K_TECH's Avatar
OP Senior Member
Flag Sidoarjo
Thanks Meter: 594
 
428 posts
Join Date:Joined: Feb 2013
More
Somes screenshoot



Last edited by K_TECH; 22nd March 2014 at 11:37 PM.
The Following User Says Thank You to K_TECH For This Useful Post: [ View ]
23rd March 2014, 01:30 AM   |  #3  
D2Y aka E's Avatar
Senior Member
Flag muara wahau (borneo)
Thanks Meter: 52
 
230 posts
Join Date:Joined: Feb 2014
More
successfully implemented in a custom rom galaxy mini device cm10.1 2 ... thank you for the tutorial mastah ...
Last edited by D2Y aka E; 5th April 2014 at 05:16 PM.
23rd March 2014, 03:15 PM   |  #4  
Senior Member
Flag Tanjungpandan
Thanks Meter: 55
 
110 posts
Join Date:Joined: Apr 2013
More
try on stockrom 4.2.2 ...got error in smali/com/android/settings/adi/fragment when recompile it bro...
param 1... I don't know about smali bro... any solution for me...
23rd March 2014, 05:05 PM   |  #5  
lacoursiere18's Avatar
Recognized Themer
Flag LbTs
Thanks Meter: 4,618
 
3,291 posts
Join Date:Joined: Jan 2013
Donate to Me
More
Quote:
Originally Posted by sitifire

try on stockrom 4.2.2 ...got error in smali/com/android/settings/adi/fragment when recompile it bro...
param 1... I don't know about smali bro... any solution for me...

Post the error here.. You'll prob have to go through all the smali you added and delete those line it states..
23rd March 2014, 05:13 PM   |  #6  
Senior Member
Flag Tanjungpandan
Thanks Meter: 55
 
110 posts
Join Date:Joined: Apr 2013
More
Quote:
Originally Posted by lacoursiere18

Post the error here.. You'll prob have to go through all the smali you added and delete those line it states..

it solved bro...thanks for your reply...
I replace all smali in fragments folder with bean ning rom from Adi. I place it in root of Adi's folder,edit display_setting.xml just in last words to replace fragments.DensityChanger with .DensityChanger & don't need to edit AndroidManifest...
I attach my screenshot after I change density to nexus7 213dpi
Click image for larger version

Name:	uploadfromtaptalk1395591106885.jpg
Views:	161
Size:	81.4 KB
ID:	2645867
thanks...

Sent from my GT-I9152 using Tapatalk
23rd March 2014, 05:47 PM   |  #7  
Junior Member
Flag Jakarta
Thanks Meter: 1
 
13 posts
Join Date:Joined: May 2011
work
23rd March 2014, 06:54 PM   |  #8  
Kameirus's Avatar
Senior Member
Flag Red Bluff, California
Thanks Meter: 2,288
 
5,810 posts
Join Date:Joined: Feb 2010
Donate to Me
More
or just use rom toolbox and avoid all the editing of the apk
especially if you flash alot of roms
Last edited by Kameirus; 23rd March 2014 at 07:26 PM.
24th March 2014, 01:21 AM   |  #9  
K_TECH's Avatar
OP Senior Member
Flag Sidoarjo
Thanks Meter: 594
 
428 posts
Join Date:Joined: Feb 2013
More
NOTE!! IMPORTANT!!
Use APKTOOL V2.0.0 beta 9(latest version) to compile apk, or you'll get error when Recompiling
12th April 2014, 07:17 PM   |  #10  
Junior Member
Thanks Meter: 6
 
19 posts
Join Date:Joined: Jun 2012
Quote:
Originally Posted by sitifire

it solved bro...thanks for your reply...
I replace all smali in fragments folder with bean ning rom from Adi. I place it in root of Adi's folder,edit display_setting.xml just in last words to replace fragments.DensityChanger with .DensityChanger & don't need to edit AndroidManifest...
I attach my screenshot after I change density to nexus7 213dpi
Attachment 2645867
thanks...

Sent from my GT-I9152 using Tapatalk

can u teach me how coz i've got an error too in jb 4.2.2 or can you give me your settings....thx before...

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Themes by ThreadRank