CN110008685A - Permission detects setting method, mobile terminal and computer readable storage medium - Google Patents
Permission detects setting method, mobile terminal and computer readable storage medium Download PDFInfo
- Publication number
- CN110008685A CN110008685A CN201910291946.0A CN201910291946A CN110008685A CN 110008685 A CN110008685 A CN 110008685A CN 201910291946 A CN201910291946 A CN 201910291946A CN 110008685 A CN110008685 A CN 110008685A
- Authority
- CN
- China
- Prior art keywords
- permission
- activity
- terminal system
- transparent
- dangerous
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/45—Structures or tools for the administration of authentication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Human Computer Interaction (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Telephone Function (AREA)
Abstract
The invention discloses a kind of permission detection setting method, mobile terminal and computer readable storage mediums, this method comprises: detecting whether there is the target application needed using dangerous permission in terminal system;The target application using dangerous permission is needed if it exists, then preset transparent Activity is started based on the service Service in the terminal system;The dangerous permission is handled in the transparent Activity, and closes the transparent Activity in after treatment.The present invention improves the efficiency of mobile terminal application permission processing.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of permission detection setting methods, mobile terminal and meter
Calculation machine readable storage medium storing program for executing.
Background technique
In android system, system limits the application of dangerous permission, it is desirable that detects permission and bullet when in use
Dialog box allows user's manual authorisation out.But it is equipped in Activity and Fragment only in systems at present relevant
Api interface come detect permission, request permissions and receive user agree to or refusal after readjustment, it is same without providing Service
The function of sample, when so as to cause using some dangerous permission in Service, user needs the set interface of system to correlation
It is very inconvenient using progress manual authorisation, and in the set interface of currently marketed most of mobile terminal, directly shield
Covered mobile terminal application in permission switch interface, if that is, user applying right is not set in the code of mobile terminal
Limit will be unable to carrying out manual authorisation for application.Therefore, the efficiency for how improving the processing of mobile terminal application permission becomes mesh
Preceding technical problem urgently to be resolved.
Summary of the invention
The main purpose of the present invention is to provide a kind of permission detection setting method, mobile terminal and computer-readable deposit
Storage media, it is intended to solve the low technical problem of mobile terminal application permission treatment effeciency.
To achieve the above object, the present invention provides a kind of permission detection setting method, and the permission detects setting method packet
Include following steps:
Detect whether there is the target application needed using dangerous permission in terminal system;
The target application using dangerous permission is needed if it exists, then is opened based on the service Service in the terminal system
Move preset transparent Activity;
The dangerous permission is handled in the transparent Activity, and described transparent in after treatment closing
Activity。
Optionally, the target application needed if it exists using dangerous permission, then based on the clothes in the terminal system
The step of business Service starts preset transparent Activity, comprising:
The target application using dangerous permission is needed if it exists, then obtains the corresponding application function of the dangerous permission, and
Determine whether the terminal system supports the application function;
If the terminal system supports the application function, based on the service Service starting in the terminal system
Preset transparent Activity.
Optionally, the described the step of dangerous permission is handled in the transparent Activity, comprising:
The first instruction of user's input is received in the transparent Activity, and determines whether first instruction is to award
Power instruction;
If first instruction is authorized order, the dangerous permission is authorized based on the authorized order, and
Start the application function.
Optionally, after the step of whether determination first instruction is authorized order, comprising:
If first instruction is refusal authorized order, based on refusal authorized order refusal to the dangerous permission
It is authorized, and stops starting the application function.
Optionally, the step of Service based in the terminal system starts preset transparent Activity, packet
It includes:
It is obtained in the Service of the terminal system and is intended to intent and method startActivity;
The intent is transferred to the startActivity, to start the transparent Activity.
Optionally, it is described detect whether to exist in terminal system the step of needing the target application using dangerous permission it
Before, comprising:
Create Activity in terminal system, and by the inventory file in the terminal system by the Activity
Be converted to transparent Activity.
Optionally, described that Activity is created in terminal system, and will by the inventory file in the terminal system
The step of Activity is converted to transparent Activity, comprising:
Activity is created in terminal system, and is stated in the inventory file in the terminal system;
Theme theme is configured in the inventory file, is turned the Activity based on the theme after setting
It is changed to transparent Activity.
Optionally, described that theme is configured in the inventory file, it will be described based on the theme after setting
Activity is converted to the step of transparent Activity, comprising:
It sets theme in the inventory file not show state, and does not show that state will be described according to described
Activity is converted to transparent Activity.
In addition, to achieve the above object, the present invention also provides a kind of mobile terminals;
The mobile terminal includes: memory, processor and is stored on the memory and can be on the processor
The computer program of operation, in which:
The computer program realizes the step of permission detection setting method as described above when being executed by the processor.
In addition, to achieve the above object, the present invention also provides a kind of computer readable storage mediums;
Computer program is stored on the computer readable storage medium, when the computer program is executed by processor
Realize the step of detecting setting method such as above-mentioned permission.
The present invention in terminal system by detecting whether there is the target application needed using dangerous permission;It needs if it exists
To use the target application of dangerous permission, then it is preset transparent based on the service Service starting in the terminal system
Activity;The dangerous permission is handled in the transparent Activity, and described in after treatment closing
Bright Activity.Transparent activity is set in terminal system by elder generation, is needed so as to detect using dangerous permission
Target application when, transparent Activity directly called by Service, and to the progress of dangerous permission in transparent Activity
Processing, avoid in the prior art can not in Service direct processing authority problem, and needs in permission configuration interface into
The phenomenon that row manual authorisation, occurs, and improves the efficiency of mobile terminal application permission processing.
Detailed description of the invention
Fig. 1 is the hardware structural diagram of the embodiment of the present invention one optional mobile terminal;
Fig. 2 is the wireless communication device schematic diagram of mobile terminal in Fig. 1;
Fig. 3 is the flow diagram that permission of the present invention detects setting method first embodiment;
Fig. 4 is the flow diagram that permission of the present invention detects setting method second embodiment;
Fig. 5 is the flow diagram that permission of the present invention detects the processing authority problem in Service in setting method.
The object of the invention is realized, the embodiments will be further described with reference to the accompanying drawings for functional characteristics and advantage.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element
Be conducive to explanation of the invention, itself there is no a specific meaning.Therefore, " module ", " component " or " unit " can mix
Ground uses.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as mobile phone, plate
Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable
Media player (Portable Media Player, PMP), navigation device, wearable device, Intelligent bracelet, pedometer etc. move
The fixed terminals such as dynamic terminal, and number TV, desktop computer.
It will be illustrated by taking mobile terminal as an example in subsequent descriptions, it will be appreciated by those skilled in the art that in addition to special
For moving except purpose element, the construction of embodiment according to the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, a kind of hardware structural diagram of its mobile terminal of each embodiment to realize the present invention, the shifting
Dynamic terminal 100 may include: RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit
103, A/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit
108, the components such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1
Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal may include components more more or fewer than diagram,
Perhaps certain components or different component layouts are combined.
It is specifically introduced below with reference to all parts of the Fig. 1 to mobile terminal:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal sends and receivees, specifically, by base station
Downlink information receive after, to processor 110 handle;In addition, the data of uplink are sent to base station.In general, radio frequency unit 101
Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating
Frequency unit 101 can also be communicated with network and other equipment by wireless communication.Any communication can be used in above-mentioned wireless communication
Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications
System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code
Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division
Multiple Access, wideband code division multiple access), TD-SCDMA (Time Division-Synchronous Code
Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division
Duplexing-Long Term Evolution, frequency division duplex long term evolution) and TDD-LTE (Time Division
Duplexing-Long Term Evolution, time division duplex long term evolution) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102
Sub- mail, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 1 shows
Go out WiFi module 102, but it is understood that, and it is not belonging to must be configured into for mobile terminal, it completely can be according to need
It to omit within the scope of not changing the essence of the invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100
When under the isotypes such as formula, speech recognition mode, broadcast reception mode, by radio frequency unit 101 or WiFi module 102 it is received or
The audio data stored in memory 109 is converted into audio signal and exports to be sound.Moreover, audio output unit 103
Audio output relevant to the specific function that mobile terminal 100 executes can also be provided (for example, call signal receives sound, disappears
Breath receives sound etc.).Audio output unit 103 may include loudspeaker, buzzer etc..
A/V input unit 104 is for receiving audio or video signal.A/V input unit 104 may include graphics processor
(Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode
Or the image data of the still image or video obtained in image capture mode by image capture apparatus (such as camera) carries out
Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited
Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike
Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042
Quiet down sound (audio data), and can be audio data by such acoustic processing.Audio that treated (voice) data can
To be converted to the format output that can be sent to mobile communication base station via radio frequency unit 101 in the case where telephone calling model.
Microphone 1042 can be implemented various types of noises elimination (or inhibition) algorithms and send and receive sound to eliminate (or inhibition)
The noise generated during frequency signal or interference.
Mobile terminal 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 1061, and proximity sensor can close when mobile terminal 100 is moved in one's ear
Display panel 1061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify the application of mobile phone posture
(such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;
The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer,
The other sensors such as hygrometer, thermometer, infrared sensor, details are not described herein.
Display unit 106 is for showing information input by user or being supplied to the information of user.Display unit 106 can wrap
Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used
Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with mobile terminal
Family setting and the related key signals input of function control.Specifically, user input unit 107 may include touch panel 1071 with
And other input equipments 1072.Touch panel 1071, also referred to as touch screen collect the touch operation of user on it or nearby
(for example user uses any suitable objects or attachment such as finger, stylus on touch panel 1071 or in touch panel 1071
Neighbouring operation), and corresponding attachment device is driven according to preset formula.Touch panel 1071 may include touch detection
Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band
The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it
It is converted into contact coordinate, then gives processor 110, and order that processor 110 is sent can be received and executed.In addition, can
To realize touch panel 1071 using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel
1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap
It includes but is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc.
It is one or more, specifically herein without limitation.
Further, touch panel 1071 can cover display panel 1061, when touch panel 1071 detect on it or
After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing
The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, touch panel 1071 and display panel
1061 be the function that outputs and inputs of realizing mobile terminal as two independent components, but in certain embodiments, it can
The function that outputs and inputs of mobile terminal is realized so that touch panel 1071 and display panel 1061 is integrated, is not done herein specifically
It limits.
Interface unit 108 be used as at least one external device (ED) connect with mobile terminal 100 can by interface.For example,
External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing
Line data port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number
It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with
For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storing software program and various data, and memory 109 can be situated between for a kind of storage of computer
Matter, the memory 109 are stored with prompting message program of the present invention.Memory 109 can mainly include storing program area and storage number
According to area, wherein storing program area can application program needed for storage program area, at least one function (for example sound plays function
Energy, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as audio data,
Phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, it can also include non-volatile memories
Device, for example, at least a disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection
A part by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage
Data in device 109 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Such as
Processor 110 executes the prompting message program in memory 109, to realize the step of each embodiment of message prompt method of the present invention
Suddenly.
Processor 110 may include one or more processing units;Optionally, processor 110 can integrate application processor and
Modem processor, wherein the main processing operation system of application processor, user interface and application program etc., modulation /demodulation
Processor mainly handles wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110
In.
Mobile terminal 100 can also include the power supply 111 (such as battery) powered to all parts, optionally, power supply 111
Can be logically contiguous by power-supply management system and processor 110, to realize management charging by power-supply management system, put
The functions such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also be including bluetooth module etc., and details are not described herein.
Embodiment to facilitate the understanding of the present invention, the communications network system that mobile terminal of the invention is based below into
Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention, the communication network system
System is the LTE system of universal mobile communications technology, which includes UE (User Equipment, the use of successively communication connection
Family equipment) (the land Evolved UMTS Terrestrial Radio Access Network, evolved UMTS 201, E-UTRAN
Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation
204。
Specifically, UE201 can be above-mentioned terminal 100, and details are not described herein again.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning
Journey (backhaul) (such as X2 interface) is connect with other eNodeB2022, and eNodeB2021 is connected to EPC203,
ENodeB2021 can provide the access of UE201 to EPC203.
EPC203 may include MME (Mobility Management Entity, mobility management entity) 2031, HSS
(Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way,
Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and
Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and
The control node of signaling, provides carrying and connection management between EPC203.HSS2032 is all to manage for providing some registers
Such as the function of home location register (not shown) etc, and preserves some related service features, data rates etc. and use
The dedicated information in family.All customer data can be sent by SGW2034, and PGW2035 can provide the IP of UE 201
Address distribution and other functions, PCRF2036 are strategy and the charging control strategic decision-making of business data flow and IP bearing resource
Point, it selects and provides available strategy and charging control decision with charge execution function unit (not shown) for strategy.
IP operation 204 may include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia
System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art should know the present invention is not only
Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with
And the following new network system etc., herein without limitation.
Based on above-mentioned mobile terminal hardware configuration and communications network system, propose that permission detection setting method of the present invention is each
A embodiment.
The present invention provides a kind of permission detection setting method, and permission detection setting method is mainly used in mobile terminal and sets
It is standby upper, but it is not limited to mobile terminal, it is also possible to other intelligent terminal, permission detection setting method includes:
Detect whether there is the target application needed using dangerous permission in terminal system;
The target application using dangerous permission is needed if it exists, then is opened based on the service Service in the terminal system
Move preset clear applications program assembly Activity;
The dangerous permission is handled in the transparent Activity, and described transparent in after treatment closing
Activity。
Referring to Fig. 3, the present invention provides a kind of permission detection setting method, detects setting method first embodiment in permission
In, permission detect setting method the following steps are included:
Step S10 detects whether there is the target application needed using dangerous permission in terminal system;
In the present embodiment, elder generation is needed
All permissions can be divided into common permission and dangerous permission in the terminal.Wherein, common permission refers to those
The permission of user security and privacy will not be threatened, this part permission system can help us to be authorized without user automatically
It is operated manually, and dangerous permission then indicates that those may touch user security privacy or cause shadow to equipment safety
Loud permission, such as obtain mobile phone contact information permission, applicant part permission must have user receive click authorization just may be used
With otherwise program is not available corresponding function.Therefore, whether need to detect in currently running application in terminal system needs
To use the target application of dangerous permission.Wherein, currently running application includes application and the terminal front end of system background operation
The application of operation, target application are the applications needed in currently running application using dangerous permission.When by judgement discovery
There are in need using dangerous permission after, then it needs to be determined that whether terminal can support the corresponding application of danger permission
Function, and need to get the authorization of user.But when by judgement discovery, there is no answering using dangerous permission in need
Used time then keeps the normal operation of currently running application.
Wherein, it is detected whether in terminal system in the presence of before the target application needed using dangerous permission, it is also necessary to
An Activity is created in terminal system, is needed after the completion of creation in AndroidManifest.xml file (inventory file)
In stated, and set "@android:style/ for theme (theme) in AndroidManifest.xml file
Theme.NoDisplay ", that is, it is any do not show, only run activity, but do not show in terminal display interface
Anything.Activity reforms into transparent activity at this time, that is, creates one thoroughly before detecting dangerous permission
Bright activity.
Step S20 needs the target application using dangerous permission if it exists, then based on the service in the terminal system
Service starts preset clear applications program assembly Activity;
Activity (application component) is exactly the interactive interface for being covered with entire window or being suspended on other windows.
One Activity is usually exactly an individual screen (window).It is communicated between each Activity by Intent.
Each Activity has to state in AndroidManifest.xml configuration file in Android application, otherwise
Nonrecognition is not also executed Activity by system.The content that Activity is shown can be divided into two kinds of statement modes, the first is
It is stated by xml configuration file, second is stated by view subclass.Service is used to complete on backstage
The operation that user specifies is one of android system component, it is similar with the rank of Activity, but cannot be certainly
Row operation, can only running background, and can be interacted with other components.Service is the long life cycle at not interface
Code.Service is a kind of program, can be run for a long time, but does not have user interface, for example, opening a music
After the program of player, if user wants to check some webpage at this time, then the program that can open browser is entered the Web page
Interface, at this time it can be seen that while browser program operation, there is no stop for playback of songs.Wherein, playing function is exactly
It is controlled by the Service of broadcasting music.
When after judgement finds to have the target application needed using dangerous permission, so that it may by striding course mode,
Call the method in Service, needing to use the place of dangerous permission using intent (intention) and
StartActivity method jumps to transparent Activity.Wherein, intent is the interaction between assisting android to apply
With communication, i.e. intent is responsible for the movement of once-through operation in application, movement is related to data, additional data is described,
Android system then can find corresponding component according to the description of intent, and intent is transmitted to the component of calling, and
Complete the calling of component.
Step S30 handles the dangerous permission in the transparent Activity, and closes in after treatment
The transparent Activity.
When after transparent activity is opened, it is also necessary to determine that the corresponding application function of danger permission is energy in the terminal
It is enough performed, that is, determines whether this terminal has this application function, and when determining that terminal has application function, need to obtain
The authorization or refusal authorized order that family inputs in transparent activity are taken, and according to different instructions, is executed different
Operation, and in after treatment, close transparent activity.Wherein, the authorization that user inputs in transparent activity is obtained
Or the mode of refusal authorized order is the dialog box of pop-up application permission on a terminal screen, i.e., pops up inside activity
It is exactly original from the user's point of view for agreeing to or refusing the small interface of authorization, and since this activity is transparent
The interface dialog box being hit by a bullet out.
Supplemented by assistant's solution processing authority problem directly in Service mode, be exemplified below.
For example, as shown in figure 5, in the terminal create an Activity, in AndroidManifest.xml file will
Theme is set as "@android:style/Theme.NoDisplay ", sets transparent Activity for the Activity, and
By striding course mode, that is, the method for calling Service, needing to use the place of dangerous permission using intent and
StartActivity jumps to a transparent Activity.And the interface that calling system API is provided in Activity, inspection
Permission is surveyed, applies for permission, and the logic in callback method after processing authority refusal/authorization, finish is (complete after being disposed
At) Activity.
In the present embodiment, by detecting whether there is the target application needed using dangerous permission in terminal system;
Need the target application using dangerous permission if it exists, then it is preset based on the service Service starting in the terminal system
Clear applications program assembly Activity;The dangerous permission is handled in the transparent Activity, and is being handled
After close the transparent Activity.Transparent activity is set in terminal system by elder generation, so as to detect
When needing the target application using dangerous permission, transparent Activity is directly called by Service, and in transparent Activity
In dangerous permission is handled, avoid in the prior art can not in Service direct processing authority problem, and need exist
The phenomenon that manual authorisation is carried out in permission configuration interface generation, improves the efficiency of mobile terminal application permission processing.
Further, on the basis of first embodiment of the invention, the of permission of the present invention detection setting method is proposed
Two embodiments, the present embodiment are the step S20 of first embodiment of the invention, need to answer using the target of dangerous permission if it exists
With the refinement for the step of then starting preset transparent Activity based on the service Service in the terminal system, referring to figure
4, comprising:
Step S21, needs the target application using dangerous permission if it exists, then obtains the corresponding application of the dangerous permission
Function, and determine whether the terminal system supports the application function;
After detecting the presence of the target application needed using dangerous permission in the terminal, it is also necessary to obtain and need using dangerous
The corresponding application function of the target application of permission, for example need to obtain each contact information in terminal;It either needs to obtain eventually
Camera permission etc. in end.And after getting dangerous permission corresponding application function, it is also necessary to determine whether terminal system is supported
The application function just needs at this time for example, it is assumed that a certain application, which needs to obtain the camera permission in terminal, further to be run
Judge whether this terminal has camera function, and only could further judge whether to award when terminal has camera function
This is given using camera permission.When application function corresponding by the dangerous permission of judgement discovery terminal system support, then need
Determine whether this application has the camera permission to user, and determines whether according to definitive result to assign that target application is corresponding to answer
Use function.But it when by judging that discovery terminal system does not support the corresponding application function of dangerous permission, then can directly close
Close this application function.
Step S22, if the terminal system supports the application function, based on the service in the terminal system
Service starts preset transparent Activity.
When application function corresponding by the dangerous permission of judgement discovery terminal system support, then it can pass through terminal system
In Service (service) Lai Qidong terminal system in preset transparent Activity, and in transparent Activity receive use
The instruction of family input, instruction includes authorization or refusal authorization, and executes different operations according to different instructions, that is,
Dangerous permission is handled according to the instruction of user.
In the present embodiment, by determining whether terminal system supports the corresponding application function of dangerous permission, and in terminal
When system supports this application function, just dangerous permission is handled, to ensure the efficiency that terminal handles dangerous permission.
Further, the step of dangerous permission being handled in the transparent Activity, comprising:
Step S31, receives the first instruction of user's input in the transparent Activity, and determines first instruction
It whether is authorized order;
When receiving the first instruction of user's input in transparent activity, need to judge whether the first instruction is to award
Power instruction then can directly authorize this dangerous permission when by judge the first instruction of discovery for authorized order, allow mesh
Mark application can normally execute the corresponding application function of dangerous permission.But when by judging that the first instruction of discovery is awarded for refusal
When power instruction, then terminal system can be refused to authorize this dangerous permission, and target application can not just obtain and run danger at this time
The corresponding application function of dangerous permission.Wherein, the first instruction may include authorized order and refusal authorized order.
Step S32 carries out the dangerous permission based on the authorized order if first instruction is authorized order
Authorization, and start the application function.
When by judging the first instruction of discovery for authorized order, then dangerous permission can be carried out according to this authorized order
Authorization allows target application that can normally start this corresponding application function of danger permission, to meet the needs of users.
In the present embodiment, it by determining terminal system support application function, and receives the first of user's input and refers to
When order is authorized order, just dangerous permission is authorized, to meet the demand of user, improves the usage experience of user
Sense.
Specifically, it is determined that after the step of whether first instruction is authorized order, comprising:
Step S33 is refused based on the refusal authorized order to described if first instruction is refusal authorized order
Dangerous permission is authorized, and stops starting the application function.
When by judging the first instruction of discovery for refusal authorized order, then terminal system can refuse authorized order according to this
Refuse to authorize this dangerous permission, and stop target application needing application function to be used, to ensure terminal system
Safety.
When in the present embodiment, by determining the first instruction to refuse authorized order, refusal authorizes dangerous permission,
To ensure the safety of terminal system.
Specifically, the step of preset transparent Activity being started based on the service Service in the terminal system, packet
It includes:
Step S221 is obtained in the Service of the terminal system and is intended to intent and method startActivity;
When exist in terminal system by judgement discovery need the target application using dangerous permission when, then can be
Intent and startActivity is obtained in Service, that is, determines the transparent activity for needing to open.
The intent is transferred to the startActivity by step S222, to start the transparent Activity.
Start the startActivity method in terminal system, and transmits intent to startActivity method, with
Start transparent Activity, that is, obtain the class name and content information for needing destination address to be started by intent, then
The class name of destination address and content information are transmitted to startActivity again, and started by startActivity transparent
Activity。
In the present embodiment, by the way that when determining the target application for existing and needing to use dangerous permission, intent is transmitted
To startActivity to start transparent Activity, to ensure the accuracy of the transparent Activity of starting.
Further, the present invention first to second embodiment any one on the basis of, propose permission of the present invention inspection
The 3rd embodiment of setting method is surveyed, the present embodiment is the step S10 of first embodiment of the invention, and detecting in terminal system is
Before the step of no target application that there are needs using dangerous permission, comprising:
Step S60 creates Activity in terminal system, and will be described by the inventory file in the terminal system
Activity is converted to transparent Activity.
Before detecting dangerous permission, need to create an Activity in terminal system, and creating
It is stated in AndroidManifest.xml file (inventory file) at rear needs, and in AndroidManifest.xml
Set "@android:style/Theme.NoDisplay " for theme (theme) in file, that is, it is any do not show,
Activity has only been run, but has not shown anything in terminal display interface.Activity reforms into transparent at this time
Activity, that is, a transparent activity is created before detecting dangerous permission.
In the present embodiment, by creating transparent Activity in the terminal, to be subsequent directly in Service
Reason rights concerns provide the foundation, and improve the usage experience sense of user.
Specifically, Activity is created in terminal system, and will be described by the inventory file in the terminal system
Activity is converted to the step of transparent Activity, comprising:
Step S11 creates Activity, and the carry out sound in the inventory file in the terminal system in terminal system
It is bright;
In terminal system after creation activity, it is also necessary to it is stated in the inventory file in terminal system,
To indicate that newly-built activity can be applied by terminal system.
Step S12 is configured theme theme in the inventory file, will be described based on the theme after setting
Activity is converted to transparent Activity.
It needs to be configured theme in inventory file, to guarantee that the theme after setting can convert activity
For transparent activity.Wherein, it should be noted that carrying out different settings to theme in inventory file, it can achieve and allow
Activity can have different display effects.For example, android:theme="@android:style/Theme ", at this point,
Activity is just default conditions, i.e., if theme does not fill out any attribute here, is defaulted as Theme.In another example android:
Theme="@android:style/Theme.NoTitleBar ", does not show that state, terminal system are only run with regard to Wie at this time
Activity, but anything is not shown.
In the present embodiment, by creating Activity in terminal system, and theme is set in inventory file
It sets, Activity is being converted into transparent Activity, so that it is transparent to have ensured that terminal system can be created efficiently
Activity。
Specifically, theme is configured in the inventory file, it will be described based on the theme after setting
Activity is converted to the step of transparent Activity, comprising:
Step S121 sets theme in the inventory file not show state, and does not show state according to described
The Activity is converted into transparent Activity.
When being set as theme not show state in inventory file, then shape can not shown according to this in the terminal
Activity is converted to transparent Activity by state, to allow user when watching just as popping up dialog box in original interface.
In the present embodiment, after by setting not display state for theme, Activity is converted to transparent
Activity, to improve the efficiency for establishing transparent Activity.
The present invention also provides a kind of mobile terminal, the mobile terminal include: memory, processor, communication bus and
The permission detection setting program being stored on the memory:
The communication bus is for realizing the connection communication between processor and memory;
The processor is for executing the permission detection setting program, to realize above-mentioned permission detection each reality of setting method
The step of applying.
The present invention also provides a kind of computer readable storage medium, the computer-readable recording medium storage has one
Perhaps more than one program the one or more programs can also be executed by one or more than one processor with
The step of embodiment each for realizing above-mentioned permission detection setting method.
Computer readable storage medium specific embodiment of the present invention and above-mentioned permission detect each embodiment base of setting method
This is identical, and details are not described herein.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone,
Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of permission detects setting method, which is characterized in that the permission detection setting method the following steps are included:
Detect whether there is the target application needed using dangerous permission in terminal system;
Need the target application using dangerous permission if it exists, then it is pre- based on the service Service starting in the terminal system
If clear applications program assembly Activity;
The dangerous permission is handled in the transparent Activity, and described transparent in after treatment closing
Activity。
2. permission as described in claim 1 detects setting method, which is characterized in that described to be needed if it exists using dangerous permission
Target application, then based in the terminal system service Service start preset transparent Activity the step of, packet
It includes:
The target application using dangerous permission is needed if it exists, then obtains the corresponding application function of the dangerous permission, and determine
Whether the terminal system supports the application function;
It is default based on the service Service starting in the terminal system if the terminal system supports the application function
Transparent Activity.
3. permission as claimed in claim 2 detects setting method, which is characterized in that described right in the transparent Activity
The step of danger permission is handled, comprising:
The first instruction of user's input is received in the transparent Activity, and determines whether first instruction is that authorization refers to
It enables;
If first instruction is authorized order, the dangerous permission is authorized based on the authorized order, and starts
The application function.
4. permission as claimed in claim 3 detects setting method, which is characterized in that determination first instruction whether be
After the step of authorized order, comprising:
If first instruction is refusal authorized order, the dangerous permission is carried out based on refusal authorized order refusal
Authorization, and stop starting the application function.
5. permission as claimed in claim 2 detects setting method, which is characterized in that the clothes based in the terminal system
The step of business Service starts preset transparent Activity, comprising:
It is obtained in the Service of the terminal system and is intended to intent and method startActivity;
The intent is transferred to the startActivity, to start the transparent Activity.
6. the permission as described in claim 1 to 5 any one detects setting method, which is characterized in that described in terminal system
In detect whether to exist the step of needing the target application using dangerous permission before, comprising:
Activity is created in terminal system, and is converted the Activity by the inventory file in the terminal system
For transparent Activity.
7. permission as claimed in claim 6 detects setting method, which is characterized in that described to be created in terminal system
Activity, and the Activity is converted to by the inventory file in the terminal system step of transparent Activity
Suddenly, comprising:
Activity is created in terminal system, and is stated in the inventory file in the terminal system;
Theme theme is configured in the inventory file, is converted to the Activity based on the theme after setting
Transparent Activity.
8. permission as claimed in claim 7 detects setting method, which is characterized in that described right in the inventory file
The step of theme is configured, and the Activity is converted to transparent Activity based on the theme after setting, comprising:
It sets theme in the inventory file not show state, and does not show that state will be described according to described
Activity is converted to transparent Activity.
9. a kind of mobile terminal, which is characterized in that the mobile terminal includes: memory, processor and is stored in the storage
On device and the permission detection setting program that can run on the processor, permission detection setting program is by the processor
The step of permission as described in any one of claims 1 to 7 detects setting method is realized when execution.
10. a kind of computer readable storage medium, which is characterized in that storage has permission inspection on the computer readable storage medium
Setting program is surveyed, the permission detection setting program is realized as described in any one of claims 1 to 7 when being executed by processor
Permission detects the step of setting method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910291946.0A CN110008685A (en) | 2019-04-09 | 2019-04-09 | Permission detects setting method, mobile terminal and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910291946.0A CN110008685A (en) | 2019-04-09 | 2019-04-09 | Permission detects setting method, mobile terminal and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110008685A true CN110008685A (en) | 2019-07-12 |
Family
ID=67171278
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910291946.0A Pending CN110008685A (en) | 2019-04-09 | 2019-04-09 | Permission detects setting method, mobile terminal and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110008685A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111984340A (en) * | 2020-08-20 | 2020-11-24 | 北京像素软件科技股份有限公司 | Application program starting method and device, readable storage medium and electronic equipment |
-
2019
- 2019-04-09 CN CN201910291946.0A patent/CN110008685A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111984340A (en) * | 2020-08-20 | 2020-11-24 | 北京像素软件科技股份有限公司 | Application program starting method and device, readable storage medium and electronic equipment |
CN111984340B (en) * | 2020-08-20 | 2024-05-14 | 北京像素软件科技股份有限公司 | Application program starting method and device, readable storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108227833A (en) | Control method, terminal and the computer readable storage medium of flexible screen terminal | |
CN109151169A (en) | Camera right management method, mobile terminal and computer readable storage medium | |
CN108282771A (en) | A kind of network access management method, mobile terminal and computer readable storage medium | |
CN108196750A (en) | The method, apparatus and computer readable storage medium of screen interface sectional drawing | |
CN107040541A (en) | A kind of Ad blocking method, device and computer-readable medium | |
CN108052845A (en) | file display control method, terminal and computer readable storage medium | |
CN108833690A (en) | authority control method, terminal and computer readable storage medium | |
CN109040441A (en) | Using display methods of attending to anything else, mobile terminal and computer readable storage medium | |
CN109739571A (en) | Application program launching method, mobile terminal and computer readable storage medium | |
CN108549826A (en) | Method of calibration, terminal, server and the readable storage medium storing program for executing of application program | |
CN110187808A (en) | Dynamic wallpaper setting method, device and computer readable storage medium | |
CN107180184A (en) | Application program right management method, device and computer-readable recording medium | |
CN109842725A (en) | A kind of method for controlling volume of mobile terminal, mobile terminal and storage medium | |
CN107613130A (en) | A kind of application management method, mobile terminal and computer-readable recording medium | |
CN107247617A (en) | The concocting method of resources of virtual machine, platform on probation and readable storage medium storing program for executing | |
CN110052024A (en) | Method of adjustment, adjustment device, mobile terminal and the storage medium of game vibration | |
CN109309762A (en) | Message treatment method, device, mobile terminal and storage medium | |
CN109101301A (en) | A kind of display control method, mobile terminal and computer readable storage medium | |
CN108196773A (en) | Control method, terminal and the computer readable storage medium of flexible screen terminal | |
CN110187934A (en) | Application control method, terminal and computer readable storage medium | |
CN110008685A (en) | Permission detects setting method, mobile terminal and computer readable storage medium | |
CN110045903A (en) | Interface operation response method, mobile terminal, device and computer storage medium | |
CN109195173A (en) | A kind of hotspot connection method, terminal and computer readable storage medium | |
CN109033773A (en) | Double screen terminal operation right management method, terminal and computer readable storage medium | |
CN109714460A (en) | Press key expansion device, terminal, key expansion method and storage medium |
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 |