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

Search This thread

cbarth3

Senior Member
Nov 8, 2009
346
81
Denton, TX
1. To change the long press delay

In PointerTracker:
Code:

###################################################
# Change the long press delay to 200ms from 500ms #
###################################################
8

Trying to learn a little and make these changes on my own. Can't seem to find PointerTracker??

I did find the SwiftkeyQwertyLatinInputModule at this location

smali>com>diotek>ime>framework>input>SwiftkeyQwertyLatinInputModule.smali

thanks for the help

---------- Post added at 03:52 PM ---------- Previous post was at 03:50 PM ----------

Any chance for you to make a MC2 version? I can provide the apk :)

If i can figure out where the PointerTracker.smali is I can post up the MC2 version I am editing now.
 
  • Like
Reactions: kwazytazz

kwazytazz

Senior Member
Jan 2, 2009
453
50
Brooklyn, N.Y.
Trying to learn a little and make these changes on my own. Can't seem to find PointerTracker??

I did find the SwiftkeyQwertyLatinInputModule at this location

smali>com>diotek>ime>framework>input>SwiftkeyQwertyLatinInputModule.smali

thanks for the help

---------- Post added at 03:52 PM ---------- Previous post was at 03:50 PM ----------



If i can figure out where the PointerTracker.smali is I can post up the MC2 version I am editing now.

Any luck with it?
 

cbarth3

Senior Member
Nov 8, 2009
346
81
Denton, TX
I pretty sure I found the PointerTracker.smali but there are some differences in the code compared to what was given and what i found. looking at the other versions (ma7) to see if it is the same.

I can give you the MC2 version with auto correct only if you want
 
  • Like
Reactions: kwazytazz

kwazytazz

Senior Member
Jan 2, 2009
453
50
Brooklyn, N.Y.
I pretty sure I found the PointerTracker.smali but there are some differences in the code compared to what was given and what i found. looking at the other versions (ma7) to see if it is the same.

I can give you the MC2 version with auto correct only if you want

Yeah I would like that! I really only cared about the auto correct :) If you can upload it for me that would be awesome!
 

cbarth3

Senior Member
Nov 8, 2009
346
81
Denton, TX
kwazytazz try this out. I have not tested it in any way I just made the changes and repacked and uploaded.





FYI i am in no way responsible if something breaks ;)
 

Attachments

  • SamsungIME.apk
    7.2 MB · Views: 78
  • Like
Reactions: kwazytazz

kwazytazz

Senior Member
Jan 2, 2009
453
50
Brooklyn, N.Y.
kwazytazz try this out. I have not tested it in any way I just made the changes and repacked and uploaded.





FYI i am in no way responsible if something breaks ;)

Thanks! I'll make sure to do a backup lol :D

---------- Post added at 12:39 AM ---------- Previous post was at 12:15 AM ----------

It works ! I'm typing on it right now thanks! If you have time would you be able to post the steps and programs to edit the apk so if a newer update comes out I would be able to edit it?

Sent from my SPH-L900 using Tapatalk 2
 

cbarth3

Senior Member
Nov 8, 2009
346
81
Denton, TX
Yeah I am using http://www.virtuous-ten-studio.com/ use this page to help set it up http://www.virtuous-ten-studio.com/index.php/getting-started/88-setting-up-your-first-project

it has allowed me to be able to make all the mods that digiblur has posted.

for this mod the smali that needs to be edited is
smali>com>diotek>ime>framework>input>SwiftkeyQwertyLatinInputModule.smali

the other one for long press delay is smali\com\diotek\ime\framework\view\tracker\PointerTracker.smali

I just figured out that there is a way to compare the old and the new. so I would take the MC2 version and compare it to the MA7 version I already had.
 

bklm1234

Senior Member
Jul 13, 2010
220
43
I'm on rooted stock MC2 ROM. I downloaded cbarth3's apk above. I renamed the .odex and .apk files to .orig and put the cbarth3's apk in /system/app. Rebooted the device. It works. Thanks so much.

---------- Post added at 03:48 PM ---------- Previous post was at 03:27 PM ----------

One problem now that auto correct works is if it's a word that's not in the dictionary, there's no way to input the word, for example my handle bklm1234. Is there a way I can enter new words in the dictionary?
 

bklm1234

Senior Member
Jul 13, 2010
220
43
I looked back at the thread somebody already said touch the typed word to add the word to the dictionary. Cool. But it'd be great to just edit the dictionary file it existed and editable
 

kwazytazz

Senior Member
Jan 2, 2009
453
50
Brooklyn, N.Y.
I looked back at the thread somebody already said touch the typed word to add the word to the dictionary. Cool. But it'd be great to just edit the dictionary file it existed and editable

It stopped working with the mc2 keyboard. It doesn't add the words anymore no matter where I touched after typing the word. When I had ljc keyboard it worked but sadly not anymore

Sent from my SPH-L900 using Tapatalk 2
 

podface

Senior Member
Nov 12, 2010
154
8
London
I couldn't get this working to save my life so finally i decided to pull the .odex file left over from the original stock file and now auto correct works perfectly thank you so much for this!
Thanks man took me ages to work out how to do this and found your super helpful comment... as you can see absolutely no spelling mistakes ;) thanks
 

jamalkhaffaf

Senior Member
Mar 26, 2013
125
17
It's not working for me. When I go to messages the keyboard shows up black. And there is no keys. It's a black board without the keys lol. In settings when I try to open it crashes.

I replaced it at system / app
As for permission I checked everything. And also did wipe cache and dalvik.

Still nothing. I have a galaxy note 2 T889 from T-Mobile.

Thanks

Sent from my SGH-T889 using xda app-developers app
 

black-raven

Member
Apr 19, 2009
12
0
Well done on your mod.
I was wondering how much effort is it to include arrows into that keyboard like AI keyboard has?
I would like to modify the the Samsung keyboard with auto correct and next to the spacebar put a button that gives the arrow functions.
 

Carpe-Dimi

Senior Member
Jul 13, 2011
478
196
Is this still supported?

I'm trying this on a samsung keyboard for galaxy ace II with android 4.1.2
The long press delay one works flawlessly on this keyboard, as that's just a hexadecimal code that needed changing :D

But i'm having problems with the auto-correction :(
I've found the area I need to be editing stuff in, but copying the codes in only makes the keyboard crash and then the phone enters a bootloop.

Here's what I've done: (my comments in red, edited code in blue)
Code:
    .line 273	[COLOR="Red"]this line compare to line 312 in first post, but there's no condition below it and i've no idea what condition to add (if it needs adding at all)[/COLOR]

[COLOR="Blue"]    iget-object v7, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mComposing:Ljava/lang/StringBuilder; [COLOR="Red"]Also tried this with v1[/COLOR]

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->length()I [COLOR="Red"]Also tried this with v1[/COLOR]

    move-result v7 [COLOR="Red"]Also tried this with v1[/COLOR]

    if-lez v7, :cond_new [COLOR="Red"]Also tried this with v1, Used cond_new as i don't know wether to use an exisitng condition or not, but it doesn't look like ts did either[/COLOR]

    iget-object v7, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mEngineManager:Lcom/diotek/ime/framework/engine/InputEngineManager; [COLOR="Red"]Also tried this with v1[/COLOR]

    iget-object v8, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mComposing:Ljava/lang/StringBuilder; [COLOR="Red"]Also tried this with v2[/COLOR]

    invoke-interface {v7, v8, v9}, Lcom/diotek/ime/framework/engine/InputEngineManager;->getCharSequence(Ljava/lang/StringBuilder;I)I [COLOR="Red"]And tried this with v1, v2, v3[/COLOR]

    invoke-virtual {p0}, Lcom/diotek/ime/framework/input/SwiftkeyQwertyLatinInputModule;->updateSuggestion()V

    invoke-virtual {p0}, Lcom/diotek/ime/framework/input/SwiftkeyQwertyLatinInputModule;->setComposingText()V
	
   :cond_new[/COLOR]
    invoke-virtual {p0}, Lcom/diotek/ime/framework/input/SwiftkeyQwertyLatinInputModule;->clearCandidateList()V

    .line 274
    iget-object v1, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mEngineManager:Lcom/diotek/ime/framework/engine/InputEngineManager;

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

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

    .line 275

Any help would be much appreciated :D
 

cbarth3

Senior Member
Nov 8, 2009
346
81
Denton, TX
MK4 Keyboard with shortened long press delay

Here is the 4.3 MK4 keyboard with the long press delay shortened to 200.

Backup your old and move this into the /system/app folder and make sure you have the correct permissions rw- r-- r--

FYI I am in no way responsible if something breaks
 

Attachments

  • SamsungIME.apk
    7.7 MB · Views: 61

josephpatrick

Senior Member
Jan 24, 2012
1,213
237
Bangalore
Is this still supported?

I'm trying this on a samsung keyboard for galaxy ace II with android 4.1.2
The long press delay one works flawlessly on this keyboard, as that's just a hexadecimal code that needed changing :D

But i'm having problems with the auto-correction :(
I've found the area I need to be editing stuff in, but copying the codes in only makes the keyboard crash and then the phone enters a bootloop.

Here's what I've done: (my comments in red, edited code in blue)
Code:
    .line 273	[COLOR="Red"]this line compare to line 312 in first post, but there's no condition below it and i've no idea what condition to add (if it needs adding at all)[/COLOR]

[COLOR="Blue"]    iget-object v7, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mComposing:Ljava/lang/StringBuilder; [COLOR="Red"]Also tried this with v1[/COLOR]

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->length()I [COLOR="Red"]Also tried this with v1[/COLOR]

    move-result v7 [COLOR="Red"]Also tried this with v1[/COLOR]

    if-lez v7, :cond_new [COLOR="Red"]Also tried this with v1, Used cond_new as i don't know wether to use an exisitng condition or not, but it doesn't look like ts did either[/COLOR]

    iget-object v7, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mEngineManager:Lcom/diotek/ime/framework/engine/InputEngineManager; [COLOR="Red"]Also tried this with v1[/COLOR]

    iget-object v8, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mComposing:Ljava/lang/StringBuilder; [COLOR="Red"]Also tried this with v2[/COLOR]

    invoke-interface {v7, v8, v9}, Lcom/diotek/ime/framework/engine/InputEngineManager;->getCharSequence(Ljava/lang/StringBuilder;I)I [COLOR="Red"]And tried this with v1, v2, v3[/COLOR]

    invoke-virtual {p0}, Lcom/diotek/ime/framework/input/SwiftkeyQwertyLatinInputModule;->updateSuggestion()V

    invoke-virtual {p0}, Lcom/diotek/ime/framework/input/SwiftkeyQwertyLatinInputModule;->setComposingText()V
	
   :cond_new[/COLOR]
    invoke-virtual {p0}, Lcom/diotek/ime/framework/input/SwiftkeyQwertyLatinInputModule;->clearCandidateList()V

    .line 274
    iget-object v1, p0, Lcom/diotek/ime/framework/input/AbstractInputModule;->mEngineManager:Lcom/diotek/ime/framework/engine/InputEngineManager;

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

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

    .line 275

Any help would be much appreciated :D

Not sure about your phone but for Galaxy S2, I simpky replaced the entire code under function ".method private processWordSeparator(I[I)V" in the .smali file 'SwiftkeyQwertyLatinInputModule' from the code used by Note 2 (from the apk file attached to OP). Extracted code is attached.

It works for me for few words, looks like an issue with the dictionary.
 

Attachments

  • code.txt
    10.5 KB · Views: 9

Top Liked Posts

  • There are no posts matching your filters.
  • 35
    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
    4
    Op here, glad this is still working! I should get a GS4 soon and will make a more generic version for all Galaxy variants

    Sent from my SPH-L710 using xda premium
    2
    Care to share it?

    Sent from my SPH-L900 using xda premium

    See the post a few above yours.

    Found this link to a working stock keyboard with auto correct for ma7 I've been using it all day and haven't had a single problem just loving my auto correct! =D so anyways go to
    http://xdaforums.com/showthread.php?t=2110841 and click spoiler in the op at the bottom of the list is the keyboard for sprint. It says to flash it but I just unzipped the zip file and manually moved the apk to system/app and deleted the .odex file. If I helped at all please thank me =)

    Sent from my SPH-L900 using xda app-developers app
    2
    Found this link to a working stock keyboard with auto correct for ma7 I've been using it all day and haven't had a single problem just loving my auto correct! =D so anyways go to
    http://xdaforums.com/showthread.php?t=2110841 and click spoiler in the op at the bottom of the list is the keyboard for sprint. It says to flash it but I just unzipped the zip file and manually moved the apk to system/app and deleted the .odex file. If I helped at all please thank me =)

    Sent from my SPH-L900 using xda app-developers app
    2
    This is the keyboard from deodexed international 4.1.2

    http://db.tt/Xy3xGJbk

    Hope you can make one for us.