[Galaxy Tab 2 7" Android Development] Tsjoklat:
Deodex patches for 5.0.2 and 5.1

Here are the patches I have created for 5.0.2 and 5.1 gapps to compensate for the deodex bugs. Notice that there are actually two different bugs. One bug is replacing normal class calls with NOP calls and the other bug is just not recognizing the difference between two different class calls and using only one call for both.

Patch for SetupWizard.apk for 5.0.2:

diff -ru SetupWizard-out/com/google/android/setupwizard/user/GoogleServicesActivity.smali SetupWizard.tab-out/com/google/android/setupwizard/user/GoogleServicesActivity.smali
--- SetupWizard-out/com/google/android/setupwizard/user/GoogleServicesActivity.smali	2015-03-17 16:20:52.070509917 +0100
+++ SetupWizard.tab-out/com/google/android/setupwizard/user/GoogleServicesActivity.smali	2015-03-17 16:21:00.262509911 +0100
@@ -66,9 +66,7 @@

const/4 v0, 0x0

- nop
-
- nop
+ check-cast v0, Ljava/lang/String;

invoke-static {v1, v0}, Lcom/google/android/setupwizard/util/GservicesValue;->value(Ljava/lang/String;Ljava/lang/String;)Lcom/google/android/setupwizard/util/GservicesValue;

diff -ru SetupWizard-out/com/google/android/setupwizard/util/GservicesChangedReceiver.smali SetupWizard.tab-out/com/google/android/setupwizard/util/GservicesChangedReceiver.smali
--- SetupWizard-out/com/google/android/setupwizard/util/GservicesChangedReceiver.smali	2015-03-17 16:20:52.114509917 +0100
+++ SetupWizard.tab-out/com/google/android/setupwizard/util/GservicesChangedReceiver.smali	2015-03-17 16:21:00.322509911 +0100
@@ -56,9 +56,7 @@

const/4 v0, 0x0

- nop
-
- nop
+ check-cast v0, Ljava/lang/String;

invoke-static {v1, v0}, Lcom/google/android/setupwizard/util/GservicesValue;->value(Ljava/lang/String;Ljava/lang/String;)Lcom/google/android/setupwizard/util/GservicesValue;

Patch for SetupWizard.apk for 5.1:

diff -ru SetupWizard-out/com/google/android/gms/internal/bu.smali SetupWizard.tab-out/com/google/android/gms/internal/bu.smali
--- SetupWizard-out/com/google/android/gms/internal/bu.smali	2015-03-17 16:22:11.270509855 +0100
+++ SetupWizard.tab-out/com/google/android/gms/internal/bu.smali	2015-03-17 16:22:19.226509849 +0100
@@ -234,9 +234,7 @@

move-object v0, v1

- nop
-
- nop
+ check-cast v0, Ljava/lang/String;

invoke-static {v2, v0}, Lcom/google/android/gms/internal/bu;->b(Ljava/lang/String;Ljava/lang/String;)Lcom/google/android/gms/internal/jp;

@@ -272,9 +270,7 @@

move-object v0, v1

- nop
-
- nop
+ check-cast v0, Ljava/lang/String;

invoke-static {v2, v0}, Lcom/google/android/gms/internal/bu;->b(Ljava/lang/String;Ljava/lang/String;)Lcom/google/android/gms/internal/jp;

@@ -346,9 +342,7 @@

move-object v0, v1

- nop
-
- nop
+ check-cast v0, Ljava/lang/String;

invoke-static {v2, v0}, Lcom/google/android/gms/internal/bu;->b(Ljava/lang/String;Ljava/lang/String;)Lcom/google/android/gms/internal/jp;

@@ -366,9 +360,7 @@

const-string v0, "gads:request_builder:singleton_webview_experiment_id"

- nop
-
- nop
+ check-cast v1, Ljava/lang/String;

invoke-static {v0, v1}, Lcom/google/android/gms/internal/bu;->b(Ljava/lang/String;Ljava/lang/String;)Lcom/google/android/gms/internal/jp;

diff -ru SetupWizard-out/com/google/android/setupwizard/util/CountryHelper.smali SetupWizard.tab-out/com/google/android/setupwizard/util/CountryHelper.smali
--- SetupWizard-out/com/google/android/setupwizard/util/CountryHelper.smali	2015-03-17 16:22:12.358509855 +0100
+++ SetupWizard.tab-out/com/google/android/setupwizard/util/CountryHelper.smali	2015-03-17 16:22:20.138509849 +0100
@@ -33,9 +33,7 @@

const/4 v0, 0x0

- nop
-
- nop
+ check-cast v0, Ljava/lang/String;

invoke-static {v1, v0}, Lcom/google/android/setupwizard/util/GservicesValue;->value(Ljava/lang/String;Ljava/lang/String;)Lcom/google/android/setupwizard/util/GservicesValue;

Patch for com.google.android.maps.jar for 5.0.2:

diff -ru com.google.android.maps.bug-out/com/google/android/maps/InternalR$styleable.smali com.google.android.maps-out/com/google/android/maps/InternalR$styleable.smali
--- com.google.android.maps.bug-out/com/google/android/maps/InternalR$styleable.smali	2015-03-23 23:25:01.255478582 +0100
+++ com.google.android.maps-out/com/google/android/maps/InternalR$styleable.smali	2015-03-23 23:25:06.571478578 +0100
@@ -56,9 +56,7 @@

check-cast v0, [I

- nop
-
- nop
+ check-cast v0, [I

sput-object v0, Lcom/google/android/maps/InternalR$styleable;->MapView:[I

diff -ru com.google.android.maps.bug-out/com/google/android/maps/MapController$1.smali com.google.android.maps-out/com/google/android/maps/MapController$1.smali
--- com.google.android.maps.bug-out/com/google/android/maps/MapController$1.smali	2015-03-23 23:25:01.311478582 +0100
+++ com.google.android.maps-out/com/google/android/maps/MapController$1.smali	2015-03-23 23:25:06.663478578 +0100
@@ -41,7 +41,7 @@

sget-object v1, Lcom/google/android/maps/MapController$VertPanState;->UP:Lcom/google/android/maps/MapController$VertPanState;

- invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
+ invoke-virtual {v1}, Lcom/google/android/maps/MapController$VertPanState;->ordinal()I

move-result v1

@@ -57,7 +57,7 @@

sget-object v1, Lcom/google/android/maps/MapController$VertPanState;->DOWN:Lcom/google/android/maps/MapController$VertPanState;

- invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
+ invoke-virtual {v1}, Lcom/google/android/maps/MapController$VertPanState;->ordinal()I

move-result v1

@@ -73,7 +73,7 @@

sget-object v1, Lcom/google/android/maps/MapController$VertPanState;->NONE:Lcom/google/android/maps/MapController$VertPanState;

- invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
+ invoke-virtual {v1}, Lcom/google/android/maps/MapController$VertPanState;->ordinal()I

move-result v1

@@ -100,7 +100,7 @@

sget-object v1, Lcom/google/android/maps/MapController$HorizPanState;->LEFT:Lcom/google/android/maps/MapController$HorizPanState;

- invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
+ invoke-virtual {v1}, Lcom/google/android/maps/MapController$HorizPanState;->ordinal()I

move-result v1

@@ -116,7 +116,7 @@

sget-object v1, Lcom/google/android/maps/MapController$HorizPanState;->RIGHT:Lcom/google/android/maps/MapController$HorizPanState;

- invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
+ invoke-virtual {v1}, Lcom/google/android/maps/MapController$HorizPanState;->ordinal()I

move-result v1

@@ -132,7 +132,7 @@

sget-object v1, Lcom/google/android/maps/MapController$HorizPanState;->NONE:Lcom/google/android/maps/MapController$HorizPanState;

- invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
+ invoke-virtual {v1}, Lcom/google/android/maps/MapController$HorizPanState;->ordinal()I

move-result v1

Note: Notice how "Ljava/lang/Enum;->ordinal()I" is the same for "Lcom/google/android/maps/MapController$HorizPanState;" and "Lcom/google/android/maps/MapController$VertPanState;". There should be some distinction between these calls, but there isnt. The actual code has different calls for VertPanState and HorizPanState, but the deodexed version is using only one call for both.

Patch for com.google.android.maps.jar for 5.1:

diff -ru com.google.android.maps.bug-out/com/google/android/maps/InternalR$styleable.smali com.google.android.maps-out/com/google/android/maps/InternalR$styleable.smali
--- com.google.android.maps.bug-out/com/google/android/maps/InternalR$styleable.smali	2015-03-23 23:23:29.951478653 +0100
+++ com.google.android.maps-out/com/google/android/maps/InternalR$styleable.smali	2015-03-23 23:23:22.863478659 +0100
@@ -56,9 +56,7 @@

check-cast v0, [I

- nop
-
- nop
+ check-cast v0, [I

sput-object v0, Lcom/google/android/maps/InternalR$styleable;->MapView:[I