Post Reply

[MOD] Add auto-correct to Samsung Keyboard and shorten long-press delay

OP eclipxe

11th January 2013, 08:02 AM   |  #1  
OP Member
Thanks Meter: 84
 
68 posts
Join Date:Joined: Jan 2007
Hey all, this is my first mod, but it was driving me crazy that the stock samsung keyboard didn't support auto-correct - and the timeout delay was way too long.

I'm working on an auto-patcher in the next couple of days.

EDIT:
I attached the APK: /system/app/
Make sure to set the proper permissions, then reboot.

The code changed is below

Here's a first stab at fixing both, would love some feedback.

1. To change the long press delay
In PointerTracker:
Code:
        ###################################################
	# Change the long press delay to 200ms from 500ms #
	###################################################
    .line 498
    const/16 v0, 0xc8

    .line 499
    .local v0, delay:I
    packed-switch p1, :pswitch_data_0

    .line 504
    const/16 v0, 0xc8

    .line 507
    :goto_0
    int-to-long v1, v0

    return-wide v1

    .line 501
    :pswitch_0
    const/16 v0, 0xc8
2. To add auto-correct

In SwiftkeyQwertyLatinInputModule
Code:
    .line 312
    :cond_3
	
	##################################################
	# Add support for auto-correct on word separator # 
	##################################################
	#check if the user has entered text
    iget-object v7, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mComposing:Ljava/lang/StringBuilder;
    invoke-virtual {v7}, Ljava/lang/StringBuilder;->length()I
    move-result v7
    if-lez v7, :cond_10
	
    iget-object v7, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mEngineManager:Lcom/diotek/ime/framework/engine/InputEngineManager;
    iget-object v8, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mComposing:Ljava/lang/StringBuilder;
    invoke-interface {v7, v8, v9}, Lcom/diotek/ime/framework/engine/InputEngineManager;->getCharSequence(Ljava/lang/StringBuilder;I)I
	invoke-virtual {p0}, Lcom/diotek/ime/framework/input/SwiftkeyQwertyLatinInputModule;->updateSuggestion()V
	invoke-virtual {p0}, Lcom/diotek/ime/framework/input/SwiftkeyQwertyLatinInputModule;->setComposingText()V
	##################################################
	# End support for auto-correct on word separator #
	##################################################

   #move clearCandidateList from beginning of processWordSeparator to after we do correct
   :cond_10
    invoke-virtual {p0}, Lcom/diotek/ime/framework/input/SwiftkeyQwertyLatinInputModule;->clearCandidateList()V
	
   #code below is not changed - just for reference	
    iget-object v7, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mEngineManager:Lcom/diotek/ime/framework/engine/InputEngineManager;

    iget-object v8, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mCandidates:Ljava/util/ArrayList;

    invoke-interface {v7, v8}, Lcom/diotek/ime/framework/engine/InputEngineManager;->getSuggestion(Ljava/util/ArrayList;)I

    .line 313
Attached Files
File Type: apk SamsungIME.apk - [Click for QR Code] (6.54 MB, 1841 views)
Last edited by eclipxe; 11th January 2013 at 07:13 PM.
The Following 35 Users Say Thank You to eclipxe For This Useful Post: [ View ]
11th January 2013, 08:43 AM   |  #2  
brooon's Avatar
Senior Member
Thanks Meter: 138
 
754 posts
Join Date:Joined: May 2009
Looks very promising! As I donīt know where to add the code, Iīm patiently waiting for your patcher!
11th January 2013, 11:15 AM   |  #3  
Senior Member
Thanks Meter: 256
 
644 posts
Join Date:Joined: Nov 2012
Looking forward for patcher or flashable zip... Thank you for sharing
11th January 2013, 01:47 PM   |  #4  
zkyevolved's Avatar
Senior Member
Flag Madrid, Spain
Thanks Meter: 281
 
1,504 posts
Join Date:Joined: Apr 2008
More
Or even an APK that can be installed as a keyboard itself for the people that aren't Rooted :$
11th January 2013, 02:00 PM   |  #5  
devynbf's Avatar
Senior Member
Thanks Meter: 316
 
976 posts
Join Date:Joined: Oct 2012
Would love to see a flashable mod here, thanks

Sent from a potato.
11th January 2013, 03:15 PM   |  #6  
Member
Thanks Meter: 5
 
36 posts
Join Date:Joined: Feb 2010
More
This would be awesome as an "Xposed" framework apk. No need to bake into other roms.

Not sure if you have seen the below link.

http://forum.xda-developers.com/show....php?t=1574401

Here are some other examples of "patches". I'm using this on stock rooted.

Multiwindow apk:
http://forum.xda-developers.com/show....php?t=2048668

Per App DPI apk:
http://forum.xda-developers.com/show....php?t=2067303
Last edited by ultra74; 11th January 2013 at 03:18 PM.
11th January 2013, 05:39 PM   |  #7  
OP Member
Thanks Meter: 84
 
68 posts
Join Date:Joined: Jan 2007
Yeah! I actually originally started by trying Xposed - in fact, I'll send you the Xposed module I built for changing the timeout delay - it didn't work though! I might have followed an outdated tutorial, but I kept banging my head against the wall trying to get Xposed to work, when it was just a simple smali change.

For the auto-correct, I'm not entirely sure how I would do it in exposed. I don't want to necessarily replace a method, I need to hook in at a precise execution point. How would I do that?

Quote:
Originally Posted by ultra74

This would be awesome as an "Xposed" framework apk. No need to bake into other roms.

Not sure if you have seen the below link.

http://forum.xda-developers.com/show....php?t=1574401

Here are some other examples of "patches". I'm using this on stock rooted.

Multiwindow apk:
http://forum.xda-developers.com/show....php?t=2048668

Per App DPI apk:
http://forum.xda-developers.com/show....php?t=2067303

11th January 2013, 06:29 PM   |  #8  
samevo's Avatar
Senior Member
Flag Boise
Thanks Meter: 72
 
118 posts
Join Date:Joined: Jun 2011
More
I cant wait to try this out. Samsung innovated so much with this phone its a shame they couldnt add this in too.
11th January 2013, 07:03 PM   |  #9  
Member
Thanks Meter: 5
 
36 posts
Join Date:Joined: Feb 2010
More
Quote:
Originally Posted by eclipxe

Yeah! I actually originally started by trying Xposed - in fact, I'll send you the Xposed module I built for changing the timeout delay - it didn't work though! I might have followed an outdated tutorial, but I kept banging my head against the wall trying to get Xposed to work, when it was just a simple smali change.

For the auto-correct, I'm not entirely sure how I would do it in exposed. I don't want to necessarily replace a method, I need to hook in at a precise execution point. How would I do that?

That would be cool. I'm just a noob programmer, but I would like to take a look at what you have and see what I can do.

Thanks!
11th January 2013, 07:06 PM   |  #10  
OP Member
Thanks Meter: 84
 
68 posts
Join Date:Joined: Jan 2007
Quote:
Originally Posted by zkyevolved

Or even an APK that can be installed as a keyboard itself for the people that aren't Rooted :$

I uploaded the APK - give it a try and let me know how it works for you guys. Open to suggestions. Also working on the patcher in case you wanted to customize it.
Last edited by eclipxe; 11th January 2013 at 07:12 PM.

The Following User Says Thank You to eclipxe For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
keyboard, mod
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Sprint Galaxy Note II Themes and Apps by ThreadRank