[Xposed Framework Modules] Roughy:
Exi for Swiftkey 2.6.6 release

2.6.6 [18.03.2020 ] - Bug fixes( Stable: 7.5.0.11 Beta: 7.5.1.5 )

Changes in 2.6.6

Fixed

- Compatibility targeting 7.5.1.5 ( ClassHunter library update )

Added

- Separate size modifier for emoji/gif/sticker panels

Changed

- Replaced toolbar toggle button with vertical swipe when maximize predictions enabled

The Xposed Installer app does not appear to be refreshing properly and may not list the latest version.

Please download it directly from the Xposed Repository below using a browser.

Download:

Exi for Swiftkey on Xposed module repository

My own mirror of all versions

Notes:

Compatibility

Beta only issue at the time of writing.

As you may know, Swiftkey is heavily obfuscated and classnames and such change for every release.

To combat this we create profiles describing the various fields and methods present in each class, and then scan through Swiftkey at runtime to find the classes we need to hook.

During the obufscation process, the app is also minified. This process includes discarding stuff that will never actually never be used.

When loading a class to compare it to our profile we have to load it in its entirety, and java predictably has a bit of a seizure.

This is fine though. It throws a ClassNotFound exception which we catch and deal with appropriately. Until now this is the only exception I've observed here.

Which brings us to Swiftkey 7.5.1.5. We've got our profile, it's loading up a bunch of classes and comparing each category and then...

2020-03-18 06:39:52.965 4773-4773/? W/System.err: java.lang.AssertionError: impossible
2020-03-18 06:39:52.966 4773-4773/? W/System.err: at java.lang.Enum$1.create(Enum.java:269)
2020-03-18 06:39:52.966 4773-4773/? W/System.err: at java.lang.Enum$1.create(Enum.java:260)
2020-03-18 06:39:52.967 4773-4773/? W/System.err: at libcore.util.BasicLruCache.get(BasicLruCache.java:58)
2020-03-18 06:39:52.967 4773-4773/? W/System.err: at java.lang.Enum.getSharedConstants(Enum.java:286)
2020-03-18 06:39:52.967 4773-4773/? W/System.err: at java.lang.Class.getEnumConstantsShared(Class.java:2291)
2020-03-18 06:39:52.967 4773-4773/? W/System.err: at java.lang.Class.getEnumConstants(Class.java:2279)
2020-03-18 06:39:52.967 4773-4773/? W/System.err: at com.mayulive.xposed.classhunter.profiles.ClassProfile.getEnumSimilarity(ClassProfile.java:182)
2020-03-18 06:39:52.967 4773-4773/? W/System.err: at com.mayulive.xposed.classhunter.profiles.ClassProfile.getSimilaritySingleSimplified(ClassProfile.java:441)
2020-03-18 06:39:52.968 4773-4773/? W/System.err: at com.mayulive.xposed.classhunter.profiles.ClassProfile.getSimilarity(ClassProfile.java:347)
2020-03-18 06:39:52.968 4773-4773/? W/System.err: at com.mayulive.xposed.classhunter.profiles.ClassProfile.getSimilarity(ClassProfile.java:16)

java.lang.AssertionError: impossible, and yet here we are.

In this particular case it's happening when we attempt to read the enum values. If we can't read the values of an Enum then we probably won't be able to use it for anything anyway, so give it a similarity score of 0 and move on.

Emoji/gif/sticker size modifier [MENTION=5881351]alwynjoshy[/MENTION]

Just below "Keyboard size multiplier" in the settings, you will now find an identical "Emoji panel size multiplier" option.

Despite its name it applies to the gif and sticker panels as well.

The modifier value will be multiplied by the keyboard size multiplier, so keep that in mind when setting it.

https://streamable.com/13fli

The emoji, gif, and sticker panels are always recreated from scratch when opened, so we rely on this to know when to change the size.

Likewise we also keep track of the current keyboard layout, which luckily triggers when returning back to the keyboard.

However, for some silly reason the keyboard layout method is NOT called when using the back button in the upper left corner of the keyboard, resulting in the keyboard being the wrong size.

It works fine when using the ABC button in the lower left right though, or just closing and opening the keyboard again.

The bottom bar will end up being a bit large, but we adjust the top bar to match the normal keyboard size multiplier, and not the emoji one.

This works regardless of whether you're using the stock or Exi emoji panels, but if using the stock one the top bar will be as large as the bottom bar.

The reason for this is that the size gets reset every time you swipe to the next panel, and trying to find a solution for that would be a pain.

You might have to open and close the emoji panel once after changing the setting for it to apply.

Toolbar vertical swipe toggle testure [MENTION=4176944]Gruber008[/MENTION] [MENTION=2243346]flexoduss[/MENTION]

The Maximize Predictions options will remove the empty space at the sides of the predictions, but we left the button to toggle the toolbar because... well, you kinda need it.

When Maximize Predictions in enabled, the toolbar toggle button is now completely removed. Instead you can swipe up or down to show or hide it. The direction does not matter.

If you're completely hiding the predictions you will have the old tiny button.

https://streamable.com/3biam

NSFW gifs and stuff [MENTION=3608157]reaperfromhell[/MENTION]

There should be a proper stacktrace printed along with those other messages, but Swiftkey itself prints it so it doesn't end up in the xposed logs, nor is it tagged with /exi.

The most likely scenario that comes to mind is another infinite loop bug though, as we invoke the same method we're hooking in inside the hook.

With old vanilla Xposed this isn't a problem, but the behavior has changed in EdExposed which has bitten us a few times in the past. Possibly fixed.

However! While looking into this I realized that I was not really getting any NSFW result when enabling the option.

It turns out Bing has started doing some region-specific filtering, and depending on what country you're in you will not get any NSFW images. Period.

If you use Bing on a desktop you can change your region to the US using the menu in the corner and get your normal degenerate results back. We can make Exi include an extra parameter in Swiftkey, but that would also lock your region to the US.

I'm not entirely sure if I should do that, or if it's even necessary. Are you people really using Swiftkey to insert penis gifs into your chats?

Let me know I guess. Could technically make it configurable I guess, though ideally I would just tie it to the NSFW results option.

Skipped implementing that for now.