[Galaxy S6 Themes and Apps] dagrim1:
EDIT

Updated the toolkit, missed the landscape values which also need to be edited. Fixed this now...

This is chaging dimens.xml file in <name_output_folder>\res\values-land\ folder if that exists, this contains the landscape mode values.

EDIT2/U]

New version of toolkit simply searches for all dimens.xml files and changes them all...

*** Make samsung system apk multidpi compatible ***

Install APKTool v2

https://ibotpeaches.github.io/Apktool/

Copy Framework-res.apk and twframework-res.apk from framework folder to computer

Install frameworks in apktool using the following commands:

apktool if Framework-res.apk

apktool if twframework-res.apk

Copy relevant apk to folder

Decompile using apktool with the following command:

apktool d <name>.apk -o <name_output_folder>

Edit the dimens.xml file in <name_output_folder>\res\values\ folder (And also the dimens.xml file in <name_output_folder>\res\values-land\ folder if that exists, this contains the landscape mode values)

Change all the values "xxxdip", where xxx is a number, to "yyypx" where yyy is 4 times xxx. So "640dip" would become "2560px"

I created an awk script for this, which uses gawk on windows: replace_xml.awk. First copy the xml file to be edited (%xml_file%) to another location (%xml_copy%)

Next call the awk script on the copy, outputting to the xml file:

gawk -f replace_xml.awk %xml_copy% > %xml_file%

Recompile the apk, keeping the original META-INF content (which can be done because we don't change the manifest.xml file) using the following command:

apktool c <name_output_folder> -o <name_output_apk>

*** Contacts/Dialer & Patching Services.jar***

For the contacts/dialer an extra step has to be taken, that is patching services.jar to skip checks for properly signed files

Using the following method: http://xdaforums.com/showthread.php?t=2725233

Copy services.jar from system\framework to computer

Decompile it:

apktool d services.jar -o services_jar

Open services_jar\smali\com\android\server\pm\PackageManagerService.smali ( I used notepad++ )

Change the following part (might not be the exact same):

.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.locals 7
.parameter "s1"
.parameter "s2"

.prologue
.line 2160
if-nez p0, :cond_8

.line 2161
if-nez p1, :cond_6

const/4 v6, 0x1

.line 2180
:goto_5
return v6

.line 2161
:cond_6
const/4 v6, -0x1

goto :goto_5

.line 2165
:cond_8
if-nez p1, :cond_c

.line 2166
const/4 v6, -0x2

goto :goto_5

.line 2168
:cond_c
new-instance v3, Ljava/util/HashSet;

invoke-direct {v3}, Ljava/util/HashSet;-><init>()V

.line 2169
.local v3, set1:Ljava/util/HashSet;,"Ljava/util/HashSet<Landroid/content/pm/Signature;>;"
move-object v0, p0

.local v0, arr$:[Landroid/content/pm/Signature;
array-length v2, v0

.local v2, len$:I
const/4 v1, 0x0

.local v1, i$:I
:goto_14
if-ge v1, v2, :cond_1e

aget-object v5, v0, v1

.line 2170
.local v5, sig:Landroid/content/pm/Signature;
invoke-virtual {v3, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

.line 2169
add-int/lit8 v1, v1, 0x1

goto :goto_14

.line 2172
.end local v5 #sig:Landroid/content/pm/Signature;
:cond_1e
new-instance v4, Ljava/util/HashSet;

invoke-direct {v4}, Ljava/util/HashSet;-><init>()V

.line 2173
.local v4, set2:Ljava/util/HashSet;,"Ljava/util/HashSet<Landroid/content/pm/Signature;>;"
move-object v0, p1

array-length v2, v0

const/4 v1, 0x0

:goto_26
if-ge v1, v2, :cond_30

aget-object v5, v0, v1

.line 2174
.restart local v5 #sig:Landroid/content/pm/Signature;
invoke-virtual {v4, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

.line 2173
add-int/lit8 v1, v1, 0x1

goto :goto_26

.line 2177
.end local v5 #sig:Landroid/content/pm/Signature;
:cond_30
invoke-virtual {v3, v4}, Ljava/util/HashSet;->equals(Ljava/lang/Object;)Z

move-result v6

if-eqz v6, :cond_38

.line 2178
const/4 v6, 0x0

goto :goto_5

.line 2180
:cond_38
const/4 v6, -0x3

goto :goto_5
.end method

TO:

.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.locals 7

const/4 v0, 0x0

return v0
.end method

Recompile the edited folder

apktool c services_jar -o services.jar

*** Toolkit ***

I created a toolkit with the various scripts to make all this a bit easier. Installing the frameworks still has to be done

but the other parts are more automated...

Basically running the apk_process.bat in the archive will make it go through the input folder, decompile all apk and jar files found in there. If it's an apk it will ask you if you want to patch the dimens.xml file. Then it will aks you to do any other modifications before continuing. Next it will recompile the apk and jar files placing them in the output folder...

Download dpi_mod_kit.zip and extract

This will give you a number of folders:

- input: Place apk and jar files which need to be edited here

- output: This is where the patched apk and jarfiles will be created

- decompiled: This is where the decompiled files will be put (here is where you can find the xml and other files to be edited)

- files: The various files, binaries, scripts and batch files used in this kit

apk_process.bat: The main file, run this to do decompilation, patching and rebuilding for all files in ínput'folder.

Place the (original) apk and jar file(s) in the input folder (don't use subdirectories)

Run apk_process.bat and wait a bit

The patched files can be found in the output folder. Copy these to your phone...