GravityBox/GravityBox — pull request #837 by theknut (2014-05-17 14:04:44+00:00)
Title: ModLauncher: Hook DeviceProfile

It's actually better to hook DeviceProfile. You can hook the DeviceProfile constructor which has cols and rows as parameters in it's method interface. This way you can change the values with param.args[x] instead of actually knowing the name of the variable.

With GNL being obfuscated now you only need to know the name of the DeviceProfil class if you use my approach. You can easily find the class by searching for "All Device Profiles must have an odd number of hotseat spaces" which is a [RuntimeException](http://androidxref.com/4.4.2_r1/xref/packages/apps/Launcher3/src/com/android/launcher3/DynamicGrid.java#103) thrown in this class.

You can find the source code of DeviceProfile on [Android XREF](http://androidxref.com/4.4.2_r1/xref/packages/apps/Launcher3/src/com/android/launcher3/DynamicGrid.java#54).

I haven't been able to test it since GB refused to launch "GravityBox System Framework is not responding". But it should work and it's the same implementation used in [Xposed GEL Settings](https://github.com/theknut/XposedGELSettings/blob/master/src/de/theknut/xposedgelsettings/hooks/Homescreen/DeviceProfileConstructorHook.java#L14).

I also added [Trebuchet](https://github.com/CyanogenMod/android_packages_apps_Trebuchet/blob/cm-11.0/src/com/android/launcher3/DynamicGrid.java#L57) as it's using the same launcher base. If you keep it, make sure to also edit the strings for the settings fragment.