An embodiment of the invention provides a method and device for reading and writing a storage device, which relates to the electronic technology field, so as to solve the problem that the existing technology is unable to read and write the storage device because of the insufficient authority of the application program. This method includes: obtaining the operation instructions triggered by the application, the operation instruction used to indicate the reading / writing operation of the storage device by the backstage service program, and sending the operation instruction to the backstage service program, so that the backstage service program can read / write to the storage device according to the operation instruction; receive the backstage service process. The operation result corresponding to the operation instruction sent by the order; and the result of the operation is sent to the application. The invention can be used for reading and writing storage devices.
【技术实现步骤摘要】
一种读写存储设备的方法本申请是2015年03月05日提出的专利技术名称为“一种读写存储设备的方法及装置”的中国专利技术专利申请201510097761.8的分案申请。
本专利技术涉及电子
,尤其涉及一种读写存储设备的方法及装置。
技术介绍
Android系统是一种基于Linux内核的操作系统,主要应用于移动设备,如手机、平板电脑等。Android系统是一个多进程系统,Android系统中的应用程序(AndroidPackage,简称apk)都在自己的进程中运行,而Android系统和apk之间的安全性是通过Linux的工具在进程级别强制实现的。现有Android安全架构的中心思想是:apk在默认情况下,其最高权限为系统(system)权限,在该权限下,apk不可以执行任何对其他apk、Android系统或者用户带来负面影响的操作。比如读写存储设备中的用户的私有数据(联系人数据或email数据),读写另一个apk,建立网络连接,以及保持设备处于非睡眠状态等。但是,当apk不能读取存储设备中的数据时,会带来一些不必要的麻烦。例如,若直播过程中的直播流是加密数据,则apk在播放该数据的过程中,需要首先对该数据进行解密,然后才能完成正常播放。但是,解密的数据存放在存储设备(如闪存(flash))中,apk如果想要正常播放该数据,就需要能够读写flash上的解密数据。而现有技术中,apk的最高权限为system权限,该权限下,apk无法直接调用底层的flash驱动接口读取flash中的解密数据,从而不能对直播流数据进行解密,导致直播流无法正常播放。
技术实现思路
...
【技术保护点】
1.一种读写存储设备的方法,其特征在于,所述方法包括:获取由应用程序触发的操作指令,所述操作指令用于指示后台服务程序对存储设备进行读取/写入操作;其中,在所述后台服务程序初始化时,init进程对Linux初始化脚本文件inti.rc中定义的所述后台服务程序进行创建,以使所述后台服务程序具有高于system权限的root权限;其中,所述应用程序集成了client端,所述应用程序通过调用client端的函数建立与所述后台服务程序之间的通信链路;发送所述操作指令给所述后台服务程序,以使得所述后台服务程序根据所述操作指令对所述存储设备进行读取/写入操作;接收所述后台服务程序发送的与所述操作指令相对应的操作结果;将所述操作结果发送给所述应用程序。
【技术特征摘要】
1.一种读写存储设备的方法,其特征在于,所述方法包括:获取由应用程序触发的操作指令,所述操作指令用于指示后台服务程序对存储设备进行读取/写入操作;其中,在所述后台服务程序初始化时,init进程对Linux初始化脚本文件inti.rc中定义的所述后台服务程序进行创建,以使所述后台服务程序具有高于system权限的root权限;其中,所述应用程序集成了client端,所述应用程序通过调用client端的函数建立与所述后台服务程序之间的通信链路;发送所述操作指令给所述后台服务程序,以使得所述后台服务程序根据所述操作指令对所述存储设备进行读取/写入操作;接收所述后台服务程序发送的与所述操作指令相对应的操作结果;将所述操作结果发送给所述应用程序。2.根据权利要求...
【专利技术属性】
技术研发人员:周岩滨,
申请(专利权)人:青岛海信宽带多媒体技术有限公司,
类型:发明
国别省市:山东,37
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。