Or Continue to Thread: [GUIDE][MOD][CM9-11] LCD Densi…
Find Your Device:
23rd March 2014, 12:18 AM   |  #1  
K_TECH's Avatar
OP Recognized Contributor
Flag Sidoarjo
Thanks Meter: 1,133
600 posts
Join Date:Joined: Feb 2013
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
- 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

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>
    <string-array name="entries_lcd_density">
    <string-array name="lcd_density_entries">
    <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 name="lcd_density_stock_values">
- Settings.apk\res\values\ids.xml
add this lines to end of it before </resources>
    <item type="id" name="dpi">false</item>
    <item type="id" name="dpi_edit">false</item>
- Settings.apk\res\values\strings.xml
add this lines to end of it before </resources>
    <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>
- 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>
    <PreferenceScreen android:title="@string/lcd_density_title" android:key="lcd_density_setup" android:fragment="com.android.settings.adi.fragments.DensityChanger" />
- Settings.apk\AndroidManifest.xml
add this line
        <activity android:label="@string/lcd_density_wizard" android:name=".fragments.DensityChanger">
                <action android:name="android.intent.action.CREATE_SHORTCUT"/>
                <category android:name="android.intent.category.DEFAULT"/>
- Decompile Settings.apk
- Sign Settings.apk
- then Recompile again

Compare the code below with your public

- Settings\smali\com\android\settings\adi\fragments
	#56		0x7f07083b	type="string" name="clear_market_data_cleared"

	#52		0x7f0a023b	type="id" name="dpi_edit"
	#120	0x7f070844	type="string" name="custom_density_summary_invalid"
	#582	0x7f07083b	type="string" name="clear_market_data_cleared"
	#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"

#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, 109 views)
File Type: zip Settings.zip - [Click for QR Code] (22.1 KB, 235 views)
Last edited by K_TECH; 23rd March 2014 at 11:21 PM.
The Following 9 Users Say Thank You to K_TECH For This Useful Post: [ View ]