CN104063284A - Method and device operating application program - Google Patents

Method and device operating application program Download PDF

Info

Publication number
CN104063284A
CN104063284A CN201310086196.6A CN201310086196A CN104063284A CN 104063284 A CN104063284 A CN 104063284A CN 201310086196 A CN201310086196 A CN 201310086196A CN 104063284 A CN104063284 A CN 104063284A
Authority
CN
China
Prior art keywords
routine
setup code
program
auxiliary routine
system program
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.)
Granted
Application number
CN201310086196.6A
Other languages
Chinese (zh)
Other versions
CN104063284B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310086196.6A priority Critical patent/CN104063284B/en
Publication of CN104063284A publication Critical patent/CN104063284A/en
Application granted granted Critical
Publication of CN104063284B publication Critical patent/CN104063284B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides a method and a device operating an application program. A main program of the application program is operated in a sandbox; when the main program needs to conduct operation provided with systematical limit of authority, an operation request is sent to an auxiliary program of the application program through process communication; the auxiliary program of the application program is operated outside the sandbox, and performs operation corresponding to the operation request; an operation result is sent back to the main program through the process communication. After adoption of the method and the device operating the application program, the application program is provided with systematical limit of authority.

Description

The method and apparatus running application
Technical field
The present invention relates to computer technology, relate in particular to a kind of method and apparatus running application.
Background technology
In iOS system, application program is operation in sandbox (being called for short sandbox) all.
The application program of moving in sandbox can only be accessed the file under this application catalog.When application program operates in sandbox, this application program does not have System Privileges, thereby can not access the file under other catalogue, cannot call limited application programming interface (Application ProgrammingInterface is called for short API) yet.For example, the word processing program moving in sandbox cannot be opened the short message of storing in short message inbox.
Summary of the invention
First aspect of the present invention is to provide a kind of method running application, and in order to solve defect of the prior art, makes application program have System Privileges.
Another aspect of the present invention is to provide a kind of device running application, and in order to solve defect of the prior art, makes application program have System Privileges.
First aspect of the present invention is to provide a kind of method running application, and comprising:
In sandbox, move the master routine of described application program, when described master routine need to have the operation of System Privileges, the auxiliary routine transmit operation request by process communication to described application program;
The auxiliary routine of the described application program of operation outside sandbox, described auxiliary routine is carried out operation corresponding to described operation requests, by process communication, to described master routine, returns to operating result.
Method as above, wherein,
Described auxiliary routine is mounted in system program by hook technology.
Method as above, wherein, before the described master routine that moves described application program in sandbox, also comprises:
The setup code of standby system program;
Adopt hook technology, the setup code of current system program is replaced with to the setup code of described auxiliary routine, the setup code of described auxiliary routine comprises the code of the process communication that realizes described auxiliary routine and described master routine;
Call the setup code of the system program of backup;
The anti-setup code of standby system program;
Adopt hook technology, the anti-setup code of current system program is replaced with to the anti-setup code of described auxiliary routine;
Call the anti-setup code of the system program of backup.
Method as above, wherein, the program that described auxiliary routine is independent operating.
Another aspect of the present invention is to provide a kind of device running application, and comprising:
Sandbox, for moving the master routine of described application program, when described master routine need to have the operation of System Privileges, the auxiliary routine transmit operation request by process communication to described application program;
Auxiliary routine unit, for moving described auxiliary routine, described auxiliary routine is carried out operation corresponding to described operation requests, by process communication, to described master routine, returns to operating result.
Device as above, wherein, described auxiliary routine unit is by the system program unit of auxiliary routine described in hook technology carry.
Device as above, wherein, described system program unit comprises:
Initialization subelement, setup code for standby system program, adopt hook technology the setup code of current system program to be replaced with to the setup code of described auxiliary routine, the setup code of described auxiliary routine comprises the code of the process communication that realizes described auxiliary routine and described master routine, calls the setup code of the system program of backup;
Anti-initialization subelement, for the anti-setup code of standby system program, adopts hook technology the anti-setup code of current system program to be replaced with to the anti-setup code of described auxiliary routine, calls the anti-setup code of the system program of backup.
Device as above, wherein, described auxiliary routine unit is program running unit independently.
From foregoing invention content, the master routine running application at sandbox, beyond sandbox, move the auxiliary routine of this application program, between master routine and auxiliary routine by process communication, if master routine need to have the operation of System Privileges, master routine by process communication message to auxiliary routine transmit operation request, by auxiliary routine, carry out this operation, and operating result is returned to master routine by process communication message, therefore, master routine can be carried out the operation with System Privileges by auxiliary routine, thereby make this application program there is System Privileges.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the method running application of the embodiment of the present invention one;
Fig. 2 is the process flow diagram of the method running application of the embodiment of the present invention two;
Fig. 3 is the structural representation of the device running application of the embodiment of the present invention three;
Fig. 4 is the structural representation of the device running application of the embodiment of the present invention four.
Embodiment
In each embodiment of the present invention, application program is divided into master routine and auxiliary routine, master routine and auxiliary routine adopt process communication mode to communicate, wherein, master routine is for carrying out each function of this application program, comprising the function that needs System Privileges to realize, when master routine need to be realized above-mentioned while needing function that System Privileges could realize, master routine is informed auxiliary routine by process communication, and auxiliary routine is for carrying out the various operations that need System Privileges to carry out that master routine relates to.The method and apparatus running application that the present invention proposes is as described in following each embodiment.
Fig. 1 is the process flow diagram of the method running application of the embodiment of the present invention one.As shown in Figure 1, the method comprises following process.
Step 101: the master routine running application in sandbox, the auxiliary routine transmit operation request by process communication to described application program.
In this step, the master routine running application in sandbox, when described master routine need to have the operation of System Privileges, the auxiliary routine transmit operation request by process communication to described application program.
Step 102: the auxiliary routine running application outward at sandbox, auxiliary routine is carried out operation corresponding to described operation requests, returns to operating result by process communication to master routine.
In this step, auxiliary routine moves outward at sandbox, and auxiliary routine is carried out operation corresponding to described operation requests, by process communication, to master routine, returns to operating result.
In the embodiment of the present invention one, application program is divided into master routine and auxiliary routine, the master routine running application in sandbox, at sandbox, move the auxiliary routine of this application program outward, between master routine and auxiliary routine, set up process communication, if master routine need to have the operation of System Privileges, master routine by process communication to auxiliary routine transmit operation request, by auxiliary routine, carry out this operation, and operating result is returned to master routine by process communication, therefore, master routine can be carried out the operation with System Privileges by auxiliary routine, thereby make this application program there is System Privileges.
In the invention described above embodiment mono-, auxiliary routine can be mounted in system program by hook technology, or auxiliary routine can also be the program of an independent operating.
Fig. 2 is the process flow diagram of the method running application of the embodiment of the present invention two.In the embodiment of the present invention two, it is example that the auxiliary routine of only take is mounted in system program by hook technology.As shown in Figure 2, the method comprises following process.
First, auxiliary routine is mounted in system program by hook (being called for short Hook) technology, particularly, this process can comprise the following steps that 201 to step 206.
Step 201: the setup code of standby system program.
Before this step is carried out, the setup code of current system program is the setup code of original system program, in this step, the setup code of said system program is backed up.After completing backup operation, the setup code of the system program of storage backup, is used for follow-up step 203, and, for the setup code of current system program, carry out following steps 202.
Step 202: adopt hook technology, the setup code of current system program is replaced with to the setup code of auxiliary routine.
In this step, adopt hook technology, the setup code of current system program is replaced with to the setup code of auxiliary routine.Wherein, the setup code of auxiliary routine comprises the code of the process communication that realizes described auxiliary routine and described master routine.The embodiment of the present invention does not limit the implementation of process communication, for example, can adopt socket (be called for short Socket) mode, pipe method or other can support any mode of process communication.
Step 203: the setup code that calls the system program of backup.
In this step, call the setup code of the system program of backup, namely call the setup code of original system program, thereby guarantee that the hook processing of step 202 can not affect systemic-function.
Step 204: the anti-setup code of standby system program.
Before this step is carried out, the anti-setup code of current system program is the anti-setup code of original system program, in this step, the anti-setup code of said system program is backed up.After completing backup operation, the anti-setup code of the system program of storage backup, is used for follow-up step 206, and, for the anti-setup code of current system program, carry out following steps 205.
Step 205: adopt hook technology, the anti-setup code of current system program is replaced with to the anti-setup code of described auxiliary routine.
Step 206: the anti-setup code that calls the system program of backup.
In this step, call the anti-setup code of the system program of backup, namely call the anti-setup code of original system program, thereby guarantee that the hook processing of step 205 can not affect systemic-function.
After execution of step 206, completed by hook technology the auxiliary routine of application program has been mounted to the process in system program, next, the master routine running application and auxiliary routine.
Step 207: the master routine running application in sandbox, when master routine need to have the operation of System Privileges, the auxiliary routine transmit operation request by process communication to application program.
In this step, the master routine running application in sandbox, when master routine need to have the operation of System Privileges, auxiliary routine transmit operation request by from process communication to application program, for example, master routine sends the first process communication message to auxiliary routine, and this first process communication message comprises operation requests.Take word-processing application as example, its master routine operates in sandbox, when user uses the short message of storing in this word-processing application short message reading breath inbox, because this short message is not under the catalogue of this word-processing application, therefore this is operating as the operation with System Privileges, the master routine of this word-processing application is by process communication to auxiliary routine transmit operation request, and this operation requests represents: the short message of storing in request short message reading breath inbox.
Step 208: the operation that the request of auxiliary routine executable operations is corresponding, by process communication, to master routine, return to operating result.
In this step, the operation that the request of auxiliary routine executable operations is corresponding, returns to operating result by process communication to master routine, and for example, auxiliary routine returns to the second process communication message to master routine, and this second process communication message comprises operating result.It is example that the user of still take uses the short message of storing in word-processing application short message reading breath inbox, this word-processing application operates in sandbox, the master routine of this word-processing application by process communication after auxiliary routine transmit operation request, this auxiliary routine is according to this operation requests, carry out the operation of the short message of storing in short message reading breath inbox, the operating result of this operation is the content of this short message, auxiliary routine returns to aforesaid operations result by process communication to master routine, thereby makes master routine can cross the content that obtains this short message.
In the embodiment of the present invention two, by application program being divided into master routine and auxiliary routine, the master routine running application in sandbox, at sandbox, move the auxiliary routine of this application program outward, this auxiliary routine, for carrying out the operation with System Privileges, is set up process communication, thereby is made master routine to carry out the operation with System Privileges by auxiliary routine between master routine and auxiliary routine, that is, application program has System Privileges.
And, adopt the said method of the embodiment of the present invention one and the embodiment of the present invention two, when carrying out the popularization of application program and propagating, in its routine package, can only comprise the master routine of this application program, and do not comprise auxiliary routine, the auxiliary routine of this application program can be when master routine moves, and the renewal process by master routine sends user to, thus make user convenient, obtain application program quickly.
Fig. 3 is the structural representation of the device running application of the embodiment of the present invention three.As shown in Figure 3, this device comprises: sandbox 31 and auxiliary routine unit 32.
Wherein, sandbox 31 is for moving the master routine of described application program, when described master routine need to have the operation of System Privileges, and the auxiliary routine transmit operation request by process communication to described application program.
Auxiliary routine unit 32 is for moving described auxiliary routine, and described auxiliary routine is carried out operation corresponding to described operation requests, by process communication, to described master routine, returns to operating result.
On the basis of technique scheme, further, auxiliary routine unit 32 can be for by the system program unit of auxiliary routine described in hook technology carry, or auxiliary routine unit 32 can also be program running unit independently.
Fig. 4 is the structural representation of the device running application of the embodiment of the present invention four.In the embodiment of the present invention 4, the situation that auxiliary routine unit is the system program unit by hook technology carry auxiliary routine of take is example.As shown in Figure 4, this device comprises: sandbox 41 and auxiliary routine unit 42.
Wherein, described auxiliary routine can be stored in dynamic base.Described system program unit comprises: initialization subelement 421 and anti-initialization subelement 422.Dynamic base is connected to above-mentioned initialization subelement 421 and anti-initialization subelement 422 by hook technology.Wherein, initialization subelement 421 is for the setup code of standby system program, adopt hook technology the setup code of current system program to be replaced with to the setup code of described auxiliary routine, the setup code of described auxiliary routine comprises the code of the process communication that realizes described auxiliary routine and described master routine, calls the setup code of the system program of backup.Anti-initialization subelement 422, for the anti-setup code of standby system program, adopts hook technology the anti-setup code of current system program to be replaced with to the anti-setup code of described auxiliary routine, calls the anti-setup code of the system program of backup.
Sandbox 41 is for moving the master routine of described application program, when described master routine need to have the operation of System Privileges, auxiliary routine transmit operation request by from process communication to described application program, specifically can be to the auxiliary routine transmit operation request of the described application program in above-mentioned dynamic base.Auxiliary routine unit 42 is for moving described auxiliary routine, and described auxiliary routine is carried out operation corresponding to described operation requests, by process communication, to described master routine, returns to operating result.Particularly, the dynamic base in auxiliary routine unit 42 is moved described auxiliary routine, and described auxiliary routine is carried out operation corresponding to described operation requests, by process communication, to described master routine, returns to operating result.
The method running application that the device running application of the embodiment of the present invention three and the embodiment of the present invention four can be recorded for carrying out the invention described above embodiment mono-and the embodiment of the present invention two, its executive mode and technique effect can, referring to described in the embodiment of the present invention one and the embodiment of the present invention two, not repeat them here.
In each embodiment of the invention described above, system program specifically can adopt main screen program (being called for short SpringBoard) or mobile phone program (being called for short MobilePhone) or other multiple systems program.
One of ordinary skill in the art will appreciate that: all or part of step that realizes above-mentioned each embodiment of the method can complete by the relevant hardware of programmed instruction.Aforesaid program can be stored in a computer read/write memory medium.This program, when carrying out, is carried out the step that comprises above-mentioned each embodiment of the method; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CDs.
Finally it should be noted that: each embodiment, only in order to technical scheme of the present invention to be described, is not intended to limit above; Although the present invention is had been described in detail with reference to aforementioned each embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or some or all of technical characterictic is wherein equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.

Claims (8)

1. the method running application, is characterized in that, comprising:
In sandbox, move the master routine of described application program, when described master routine need to have the operation of System Privileges, the auxiliary routine transmit operation request by process communication to described application program;
The auxiliary routine of the described application program of operation outside sandbox, described auxiliary routine is carried out operation corresponding to described operation requests, by process communication, to described master routine, returns to operating result.
2. method according to claim 1, is characterized in that,
Described auxiliary routine is mounted in system program by hook technology.
3. method according to claim 1 and 2, is characterized in that, before the described master routine that moves described application program in sandbox, also comprises:
The setup code of standby system program;
Adopt hook technology, the setup code of current system program is replaced with to the setup code of described auxiliary routine, the setup code of described auxiliary routine comprises the code of the process communication that realizes described auxiliary routine and described master routine;
Call the setup code of the system program of backup;
The anti-setup code of standby system program;
Adopt hook technology, the anti-setup code of current system program is replaced with to the anti-setup code of described auxiliary routine;
Call the anti-setup code of the system program of backup.
4. method according to claim 1, is characterized in that,
Described auxiliary routine is the program of independent operating.
5. the device running application, is characterized in that, comprising:
Sandbox, for moving the master routine of described application program, when described master routine need to have the operation of System Privileges, the auxiliary routine transmit operation request by process communication to described application program;
Auxiliary routine unit, for moving described auxiliary routine, described auxiliary routine is carried out operation corresponding to described operation requests, by process communication, to described master routine, returns to operating result.
6. device according to claim 5, is characterized in that,
Described auxiliary routine unit is by the system program unit of auxiliary routine described in hook technology carry.
7. device according to claim 6, is characterized in that, described system program unit comprises:
Initialization subelement, setup code for standby system program, adopt hook technology the setup code of current system program to be replaced with to the setup code of described auxiliary routine, the setup code of described auxiliary routine comprises the code of the process communication that realizes described auxiliary routine and described master routine, calls the setup code of the system program of backup;
Anti-initialization subelement, for the anti-setup code of standby system program, adopts hook technology the anti-setup code of current system program to be replaced with to the anti-setup code of described auxiliary routine, calls the anti-setup code of the system program of backup.
8. device according to claim 7, is characterized in that, described auxiliary routine unit is program running unit independently.
CN201310086196.6A 2013-03-18 2013-03-18 The method and apparatus running application program Active CN104063284B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310086196.6A CN104063284B (en) 2013-03-18 2013-03-18 The method and apparatus running application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310086196.6A CN104063284B (en) 2013-03-18 2013-03-18 The method and apparatus running application program

Publications (2)

Publication Number Publication Date
CN104063284A true CN104063284A (en) 2014-09-24
CN104063284B CN104063284B (en) 2016-07-06

Family

ID=51551007

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310086196.6A Active CN104063284B (en) 2013-03-18 2013-03-18 The method and apparatus running application program

Country Status (1)

Country Link
CN (1) CN104063284B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105701398A (en) * 2015-12-30 2016-06-22 北京金山安全软件有限公司 Method and device for opening auxiliary function permission and electronic equipment
CN106886692A (en) * 2017-03-23 2017-06-23 北京金山安全软件有限公司 Application program using method and device and electronic equipment
CN109284605A (en) * 2018-09-30 2019-01-29 联想(北京)有限公司 Information processing method and device
CN109710429A (en) * 2014-12-26 2019-05-03 北京奇虎科技有限公司 The method and device of method call is carried out between process
CN110046000A (en) * 2019-04-24 2019-07-23 上海连尚网络科技有限公司 Small routine operation method and device
WO2020221090A1 (en) * 2019-04-29 2020-11-05 上海连尚网络科技有限公司 Method for use in combined operation of guest applications, and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100138639A1 (en) * 2008-12-02 2010-06-03 Microsoft Corporation Sandboxed execution of plug-ins
CN102542187A (en) * 2010-12-23 2012-07-04 盛趣信息技术(上海)有限公司 Method for improving safety performance of computers on basis of safety sandbox

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100138639A1 (en) * 2008-12-02 2010-06-03 Microsoft Corporation Sandboxed execution of plug-ins
CN102542187A (en) * 2010-12-23 2012-07-04 盛趣信息技术(上海)有限公司 Method for improving safety performance of computers on basis of safety sandbox

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710429A (en) * 2014-12-26 2019-05-03 北京奇虎科技有限公司 The method and device of method call is carried out between process
CN109710429B (en) * 2014-12-26 2021-08-31 北京奇虎科技有限公司 Method and device for inter-process method calling
CN105701398A (en) * 2015-12-30 2016-06-22 北京金山安全软件有限公司 Method and device for opening auxiliary function permission and electronic equipment
CN105701398B (en) * 2015-12-30 2019-06-21 北京金山安全软件有限公司 Method and device for opening auxiliary function permission and electronic equipment
CN106886692A (en) * 2017-03-23 2017-06-23 北京金山安全软件有限公司 Application program using method and device and electronic equipment
CN109284605A (en) * 2018-09-30 2019-01-29 联想(北京)有限公司 Information processing method and device
CN110046000A (en) * 2019-04-24 2019-07-23 上海连尚网络科技有限公司 Small routine operation method and device
CN110046000B (en) * 2019-04-24 2022-03-11 上海连尚网络科技有限公司 Applet running method and device
WO2020221090A1 (en) * 2019-04-29 2020-11-05 上海连尚网络科技有限公司 Method for use in combined operation of guest applications, and device

Also Published As

Publication number Publication date
CN104063284B (en) 2016-07-06

Similar Documents

Publication Publication Date Title
CN104063284B (en) The method and apparatus running application program
CN102346697A (en) Method and system for backing up and recovering Android package (APK) and mobile terminal
CN101763418A (en) File resource access method and device
CN107861691B (en) Load balancing method and device of multi-control storage system
WO2016078263A1 (en) Upgrading control device and terminal, terminal upgrading method and system, and storage medium
CN110716845B (en) Log information reading method of Android system
CN106170757A (en) A kind of date storage method and device
CN104375933A (en) Unit testing method and device
CN103034592A (en) Data processing method and device
CN103838521A (en) Data processing method and data processing device
CN103218428A (en) Dynamic link method and system
CN104205780A (en) Data storage method and device
CN102662796B (en) Method and system for recovering data
CN104035728A (en) Hard disk hot plug handling method, device and node
CN107193693A (en) A kind of online data storage optimization method based on storage system
CN104517067A (en) Method, device and system for data access
CN104268097A (en) Metadata processing method and system
CN106383667A (en) Method and apparatus for LUN migration in business operation
CN104866388A (en) Data processing method and device
CN103984621B (en) log separation method and system
CN105260266A (en) Snapshot volume writing method and dependent snapshot system
CN108170376A (en) The method and system that storage card is read and write
CN103795806A (en) Method for achieving cloud storage for mobile terminal
CN103744626A (en) Data writing method based on memory replacement
CN103246611B (en) A kind of document handling method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant