CN109542246B - 一种Android输入法应用输入关键字拦截的方法 - Google Patents

一种Android输入法应用输入关键字拦截的方法 Download PDF

Info

Publication number
CN109542246B
CN109542246B CN201811310952.8A CN201811310952A CN109542246B CN 109542246 B CN109542246 B CN 109542246B CN 201811310952 A CN201811310952 A CN 201811310952A CN 109542246 B CN109542246 B CN 109542246B
Authority
CN
China
Prior art keywords
input
input method
keywords
android
intercepting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811310952.8A
Other languages
English (en)
Other versions
CN109542246A (zh
Inventor
王伟
桂艳峰
丁俊一
陈电波
田旭宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhizhangyi Technology Co ltd
Original Assignee
Beijing Zhizhangyi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhizhangyi Technology Co ltd filed Critical Beijing Zhizhangyi Technology Co ltd
Priority to CN201811310952.8A priority Critical patent/CN109542246B/zh
Publication of CN109542246A publication Critical patent/CN109542246A/zh
Application granted granted Critical
Publication of CN109542246B publication Critical patent/CN109542246B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/82Protecting input, output or interconnection devices
    • G06F21/83Protecting input, output or interconnection devices input devices, e.g. keyboards, mice or controllers thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Telephone Function (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

本发明公开了一种Android输入法应用输入关键字拦截的方法,包括以下步骤:步骤1:启动Android输入法应用;步骤2:代理输入法应用的输入通道,并提交到系统输入法管理系统;步骤3:用户在输入法应用端输入内容;步骤4:通过拦截输入通道来获取到用户输入的内容;步骤5:获取输入内容后,对输入的关键字进行处理;步骤6:将关键字处理后的内容提交进系统输入法管理系统,并通过控件进行显示。本发明采用上述方法,能够很方便地实现输入法中敏感词汇等关键词的拦截,且兼容性高,有利于推广应用。

Description

一种Android输入法应用输入关键字拦截的方法
技术领域
本发明属于关键字拦截领域,具体涉及一种Android输入法应用输入关键字拦截的方法。
背景技术
目前,android智能手机已经十分普及了,对于一些行业对关键信息比较看重的领域,或者对用户输入信息进行大数据审计分析的领域,信息的输入显得特别重要。怎样才能在不改变输入法源码的状态下,安全、快速实现关键字拦截,成为了眼下的一个研究课题。目前,现有的一些现成方案或多或少都存在一定的缺陷:
1)修改输入法源码,这就需要处理很多与版本、系统相关的处理逻辑,时间成本、研发成本较高。
2)自己定制输入法,需要很高的成本,且兼容性不高,不能和市场主流的输入法相抗衡,难以推广。
发明内容
为了克服现有技术的不足,本发明提出一种Android输入法应用输入关键字拦截的方法,解决现有的拦截方法成本较高,且兼容性不高,难以推广的问题。
本发明为实现上述目的,采用以下技术方案实现:
一种Android输入法应用输入关键字拦截的方法,包括以下步骤:
步骤1:启动Android输入法应用;
步骤2:代理输入法应用的输入通道,并提交到系统输入法管理系统;
步骤3:用户在输入法应用端输入内容;
步骤4:通过拦截输入通道来获取到用户输入的内容;
步骤5:获取输入内容后,对输入的关键字进行处理;
步骤6:将关键字处理后的内容提交进系统输入法管理系统,并通过控件进行显示。
进一步地,作为优选技术方案,所述步骤2中,hook机制下,代理InputmethodService.java中的相关变量。
进一步地,作为优选技术方案,所述步骤2中,hook机制下,代理InputmethodService.java中的InputConnection来获取输入通道。
进一步地,作为优选技术方案,所述InputmethodService.java用于实现输入法的内部逻辑、键盘布局及选词,并最终把选出的字符显示出来。
进一步地,作为优选技术方案,所述InputmethodService.java由InputMethodManagerService.java管理,InputMethodManagerService.java还管理WindowManagerService和InputManager,WindowManagerService负责显示输入法和接收用户事件,InputManager由UI控件调用,用来操作输入法。
进一步地,作为优选技术方案,所述步骤5中,对关键字的处理包括替换、过滤、记录及上报。
本发明与现有技术相比,具有以下优点及有益效果:
(1)本发明通过采用拦截输入法的输入通道,而输入法端最后会通过InputConnection逻辑来传递文本信息给应用端,通用性比较强,能够兼容android 4.0到android 8.0,andorid系统在更改其api时,本发明不需要做改动就能很好地兼容市面上的所有输入法。
(2)本发明对于企业管理者来说,可以对员工的输入内容进行管控、监控,避免企业机密的泄露,当然,管理者还可以对员工的输入行为、使用词汇及输入习惯进行分析,起到辅助了解员工的目的。
(3)本发明可以准确记录整个手机或者平板电脑的输入信息,对整个手机用户的输入信息进行拦截上报,对手机使用者的输入信息进行大数据的分析统计,分析用户的心理状态以及性格等,对大数据分析来说有着重要的意义。
附图说明
图1为本发明的方法流程图;
图2为本发明的拦截过程示意图。
具体实施方式
下面结合实施例对本发明作进一步地详细说明,但本发明的实施方式不限于此。
实施例:
如图1、图2所示,本实施例所述的一种Android输入法应用输入关键字拦截的方法,包括以下步骤:
步骤1:启动Android输入法应用;
步骤2:代理输入法应用的输入通道,并提交到系统输入法管理系统;
步骤3:用户在输入法应用端输入内容;
步骤4:通过拦截输入通道来获取到用户输入的内容;
步骤5:获取输入内容后,对输入的关键字进行处理,比如替换、过滤、记
录及上报等;
步骤6:将关键字处理后的内容提交进系统输入法管理系统,并通过控件进行显示。
本实施例是基于输入法的动态拦截,故在步骤2中,本实施例可采用java动态代理InputmethodService.java中的相关变量,替换掉系统的运行时对象,在调用过程中,先调用系统的方法,再调用本发明基于关键字的处理方法,这样,本发明就可以通过这些接口,获取用户的输入,获取输入之后,可以根据原先下发的关键字进行匹配、过滤、替换等操作,之后调用其代理之后的方法,返回到原来的系统中。
本实施例中,由于拦截了输入法的输入通道,而输入法端最后会通过InputConnection逻辑来传递文本信息给应用端,因此,采用java动态代理InputmethodService.java中的InputConnection来获取输入通道,通用性比较强,可以兼容android 4.0到android 8.0,且andorid系统在更改其api时,本发明不需要做改动就能很好地兼容市面上的所有输入法,比如搜狗、百度等等。
另外,由于提交到显示框的相关文本是通过InputConnection接口的相关方法实现的,对于输入法的拦截,本发明在应用启动时,通过代理其相关InputConnection的相关方法获取输入的通道,因此,只需要选择合适的hook点,即可达到拦截的目的。
本实施例中,InputMethodManagerService.java是整个系统的总控制中心,它通过管理三个模块来实现系统的输入法框架,分别是WindowManagerService、InputMethodService以及InputManager,WindowManagerService负责显示输入法,接收用户事件;InputMethodService负责输入法内部逻辑,键盘布局,选词等,并最终把选出的字符显示出来,具体地,通过commitText提交出来;InputManager由UI控件(View、TextView、EditText等)调用,用来操作输入法,比如打开、关闭、切换输入法等。
本发明通过采用上述方法,能够在使用该输入法的人员处于无感知的状态下,正确地记录使用人员的输入内容,且对一些敏感词汇进行替换、记录或者上报等操作。
上述方法还能够针对一些特殊情况进行规避,比如军队人员等特殊机构不允许人员向网络发送敏感词汇或者关键信息,运用本发明,可很好地解决这一问题。
对于企业管理者来说,可以对员工的输入内容进行管控、监控,避免企业机密的泄露,当然,管理者还可以对员工的输入行为、使用词汇及输入习惯进行分析,起到辅助了解员工的目的。
更进一步地,上述方法还可以准确记录整个手机或者平板电脑的输入信息,对整个手机用户的输入信息进行拦截上报,对手机使用者的输入信息进行大数据的分析统计,分析用户的心理状态以及性格等,对大数据分析来说有着重要的意义。
以上所述,仅是本发明的较佳实施例,并非对本发明做任何形式上的限制,凡是依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化,均落入本发明的保护范围之内。

Claims (3)

1.一种Android输入法应用输入关键字拦截的方法,其特征在于,包括以下步骤:
步骤1:启动Android输入法应用;
步骤2:hook机制下,代理InputmethodService.java中的相关变量,hook机制下,代理InputmethodService.java中的InputConnection来获取输入通道,并提交到系统输入法管理系统;所述InputmethodService.java用于实现输入法的内部逻辑、键盘布局及选词,并最终把选出的字符显示出来;
步骤3:用户在输入法应用端输入内容;
步骤4:通过拦截输入通道来获取到用户输入的内容;
步骤5:获取输入内容后,对输入的关键字进行处理;
步骤6:将关键字处理后的内容提交进系统输入法管理系统,并通过控件进行显示。
2.根据权利要求1所述的一种Android输入法应用输入关键字拦截的方法,其特征在于,所述Inputmethod Service.java由InputMethodManagerService.java管理,InputMethodManagerService.java还管理WindowManagerService和InputManager,WindowManagerService负责显示输入法和接收用户事件,InputManager由UI控件调用,用来操作输入法。
3.根据权利要求1所述的一种Android输入法应用输入关键字拦截的方法,其特征在于,所述步骤5中,对关键字的处理包括替换、过滤、记录及上报。
CN201811310952.8A 2018-11-06 2018-11-06 一种Android输入法应用输入关键字拦截的方法 Active CN109542246B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811310952.8A CN109542246B (zh) 2018-11-06 2018-11-06 一种Android输入法应用输入关键字拦截的方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811310952.8A CN109542246B (zh) 2018-11-06 2018-11-06 一种Android输入法应用输入关键字拦截的方法

Publications (2)

Publication Number Publication Date
CN109542246A CN109542246A (zh) 2019-03-29
CN109542246B true CN109542246B (zh) 2022-10-28

Family

ID=65846101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811310952.8A Active CN109542246B (zh) 2018-11-06 2018-11-06 一种Android输入法应用输入关键字拦截的方法

Country Status (1)

Country Link
CN (1) CN109542246B (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073542A (zh) * 2010-12-22 2011-05-25 浙大网新科技股份有限公司 Linux应用在Android手机上运行时整合中文输入法的方法
CN102750005A (zh) * 2012-06-11 2012-10-24 迪尔码国际营销服务(北京)有限公司 一种基于输入法录入信息拦截替换的方法
CN103092969A (zh) * 2013-01-22 2013-05-08 上海量明科技发展有限公司 对输入法候选项进行流媒体检索的方法、客户端及系统
CN104281385A (zh) * 2014-09-17 2015-01-14 北京搜狗科技发展有限公司 输入法虚拟键盘的调整方法和输入法装置
CN105898740A (zh) * 2016-06-12 2016-08-24 Tcl集团股份有限公司 一种基于移动设备通讯的信息加密解密方法及系统
WO2017124945A1 (zh) * 2016-01-19 2017-07-27 阿里巴巴集团控股有限公司 输入法操作处理方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073542A (zh) * 2010-12-22 2011-05-25 浙大网新科技股份有限公司 Linux应用在Android手机上运行时整合中文输入法的方法
CN102750005A (zh) * 2012-06-11 2012-10-24 迪尔码国际营销服务(北京)有限公司 一种基于输入法录入信息拦截替换的方法
CN103092969A (zh) * 2013-01-22 2013-05-08 上海量明科技发展有限公司 对输入法候选项进行流媒体检索的方法、客户端及系统
CN104281385A (zh) * 2014-09-17 2015-01-14 北京搜狗科技发展有限公司 输入法虚拟键盘的调整方法和输入法装置
WO2017124945A1 (zh) * 2016-01-19 2017-07-27 阿里巴巴集团控股有限公司 输入法操作处理方法和装置
CN105898740A (zh) * 2016-06-12 2016-08-24 Tcl集团股份有限公司 一种基于移动设备通讯的信息加密解密方法及系统

Also Published As

Publication number Publication date
CN109542246A (zh) 2019-03-29

Similar Documents

Publication Publication Date Title
US11656859B2 (en) Data model API for live applications in a cloud collaboration platform
US7191326B2 (en) Method and apparatus for making and using test verbs
CA2684822C (en) Data transformation based on a technical design document
US20050144530A1 (en) Method and apparatus for making and using wireless test verbs
US9245256B2 (en) Assigning and managing reviews of a computing file
US20190287168A1 (en) System and platform for execution of consolidated resource-based action
US20090276728A1 (en) Arrangements for Managing Assistance Requests for Computer Services
US10990359B2 (en) Use and advancements of assistive technology in automation for the visually-impaired workforce
US11348448B1 (en) Enhanced alert generation system based on real-time manipulation of datasets
US9807169B2 (en) Distributed tagging of data in a hybrid cloud environment
US20230048310A1 (en) System and method for identifying members of a dynamic target segment
US9104573B1 (en) Providing relevant diagnostic information using ontology rules
CN109542246B (zh) 一种Android输入法应用输入关键字拦截的方法
US10635458B2 (en) Systems and methods for generating a self-updating maintenance page
US11995033B2 (en) Data deletion system and method
CN114063868A (zh) 一种ai拖拽建模系统、方法、计算机设备及应用
CN109558728B (zh) 一种Android应用内输入关键字拦截的方法
US10635573B2 (en) Auto-generated multiple input variants
US20200201609A1 (en) Metadata-Driven Design-Time Tooling
CN111831527A (zh) 扫描数据库性能问题的方法、装置、电子设备、及介质
US20240077989A1 (en) User interface for managing retargeting of dashboard content
CN116302211B (zh) 策略执行器的配置方法、装置、计算机设备及存储介质
CN117193990B (zh) http接口的调度管理方法、装置、设备及存储介质
US20240020593A1 (en) User interface presenting integrated enterprise services
WO2024050057A1 (en) Retargeting dashboard content as interactive data snapshots for collaboration platforms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant