Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method, a system, a device and a storage medium for dynamically limiting installation and uninstallation of an Android system of a cloud mobile phone, and solves the problem of limited number of public network IP addresses.
The technical scheme of the invention is realized as follows: in a first aspect, an embodiment of the present invention provides a method for dynamically limiting installation and uninstallation of an Android system of a cloud mobile phone, including the following steps:
the method comprises the steps that a broadcast receiver is established in an Android system of the cloud mobile phone and used for receiving a user instruction and determining the type of the user instruction; the value of the user instruction comprises an enable installation uninstall instruction and a disable installation uninstall instruction;
calling a corresponding class function in the API function through the broadcast receiver according to the received user instruction, and determining whether the value of the user instruction is consistent with the value of the corresponding class function in the API function;
if not, the restriction processing is carried out, otherwise, the restriction processing is not carried out.
Optionally, when the type of the user instruction is an installation and uninstallation enabled instruction, according to the received user instruction, the broadcast receiver calls a corresponding class function in the API function, and the step of determining whether the type of the user instruction matches a value of the corresponding class function in the API function includes:
calling a getUserRestriction function in an API function through a broadcast receiver according to a received user instruction, and taking out values of types of UserManager, DISALLOW _ INSTALL _ APPS and UserManager, DISALLOW _ UNINSTALL _ APPS;
and comparing the extracted value with the value of the user instruction to determine whether the values are consistent.
Optionally, when the type of the user instruction is a disable installation and uninstallation instruction, according to the received user instruction, the broadcast receiver calls a corresponding class function in the API function, and the step of determining whether the type of the user instruction matches a value of the corresponding class function in the API function includes:
calling a getUserRestriction function in an API function through a broadcast receiver according to a received user instruction, and taking out values of types of UserManager, DISALLOW _ INSTALL _ APPS and UserManager, DISALLOW _ UNINSTALL _ APPS;
and comparing the extracted value with the value of the user instruction to determine whether the values are consistent.
Optionally, if the two are not matched, performing a limiting process, otherwise, performing a non-processing step including,
according to the compared values, if the values do not accord with each other, a user manager type setUserRestriction function of the API is called, the values of the parameters of user manager, DISALLOW _ INSTALL _ APPS and user manager, DISALLOW _ UNINSTALL _ APPS are transmitted, if the values are installation and uninstallation enabling instructions, the installation and uninstallation instructions are limited, and if the values are installation and uninstallation disabling instructions, the installation and uninstallation instructions are not limited.
If the data match, the data are not processed.
In a second aspect, an embodiment of the present invention provides a system for dynamically limiting installation and uninstallation of an Android system of a cloud mobile phone, where the system includes:
the receiving module is used for creating a broadcast receiver in the Android system of the cloud mobile phone, receiving a user instruction and determining the type of the user instruction; the value of the user instruction comprises an enable installation uninstall instruction and a disable installation uninstall instruction;
the judging module is used for calling a corresponding class function in the API function through the broadcast receiver according to the received user instruction and determining whether the value of the user instruction is consistent with the value of the corresponding class function in the API function or not;
and the processing module is used for performing restriction processing if the data are not consistent with each other, or else, not performing the restriction processing.
Optionally, when the type of the user instruction is an install and uninstall enable instruction, the determining module includes:
a calling unit, configured to call, by a broadcast receiver, a getuserrection function in an API function according to a received user instruction, and take out values of user manager, loss _ instal _ APPS, and user manager, loss _ unitstal _ APPS types;
and the comparison unit is used for comparing the extracted value with the value of the user instruction and determining whether the extracted value is consistent with the value of the user instruction.
Optionally, when the type of the user instruction is a disable installation and uninstallation instruction, the determining module includes:
a calling unit, configured to call, by a broadcast receiver, a getuserrection function in an API function according to a received user instruction, and take out values of user manager, loss _ instal _ APPS, and user manager, loss _ unitstal _ APPS types;
and the comparison unit is used for comparing the extracted value with the value of the user instruction and determining whether the extracted value is consistent with the value of the user instruction.
Optionally, if the two are not matched, performing a limiting process, otherwise, performing a non-processing step including,
and the processing unit is used for calling a UserManager setUserRestriction function of the API according to the compared values if the compared values do not accord with each other, transmitting values of the types of the parameters UserManager, DISALLOW _ INSTALL _ APPS and UserManager, DISALLOW _ UNINSTALL _ APPS, and limiting the installation and uninstallation instructions if the values are the installation and uninstallation enabling instructions, or not limiting the installation and uninstallation instructions if the values are the installation and uninstallation disabling instructions.
And the standing unit is used for not processing if the data are consistent.
In a third aspect, an embodiment of the present invention provides a device for dynamically limiting installation and uninstallation of an Android system of a cloud mobile phone, including:
a memory for storing a program;
the processor is used for executing a program, and the program enables the processor to execute the method for dynamically limiting installation and uninstallation of the Android system of the cloud mobile phone according to any one of claims 1-4.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which includes a computer program, and when the computer program runs on a computer, the method for dynamically limiting installation and uninstallation of the Android system of a cloud mobile phone according to any one of claims 1 to 4 is executed.
Compared with the prior art, the invention has the following advantages: compared with the traditional effect of modifying the source code, firstly setting two values in the system configuration and then restarting the cloud mobile phone system, the invention completes the game maintenance operation without restarting the cloud mobile phone system, does not need to add additional system configuration to match with the installation and uninstallation limit, increases the safety of the cloud mobile phone system, protects the integrity of the trial play data and reduces the equipment maintenance operation cost.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for dynamically limiting installation and uninstallation of an Android system of a cloud mobile phone according to an embodiment of the present invention.
The embodiment of the invention discloses a method for dynamically limiting installation and uninstallation of an Android system of a cloud mobile phone. The method comprises
S101, a broadcast receiver is established in an Android system of a cloud mobile phone and used for receiving a user instruction and determining the type of the user instruction; the value of the user instruction comprises an enable installation uninstall instruction and a disable installation uninstall instruction;
s102, calling a corresponding function in the API function through the broadcast receiver according to the received user instruction, and determining whether the value of the user instruction is consistent with the value of the corresponding function in the API function;
and S103, if the data are not matched, performing restriction processing, otherwise, not processing.
Specifically, when the type of the user instruction is an install uninstall enable instruction, step S102 includes:
s1021a, according to the received user instruction, calling the getuserrestroction function in the API function through the broadcast receiver, and taking out the values of the user manager, loss _ instal _ APPS, and user manager, loss _ unitstal _ APPS types;
s1022a, the retrieved value is compared with the value instructed by the user to determine whether the retrieved value matches the value instructed by the user.
Correspondingly, step S103 includes:
and S1031, according to the compared values, if the values do not match, calling a UserManager setUserRestriction function of the API, and introducing values of the types of the parameters UserManager, DISALLOW _ INSTALL _ APPS and UserManager, DISALLOW _ UNINSTALL _ APPS, wherein if the values are installation and unloading enabling instructions, the installation and unloading instructions are limited, and if the values are installation and unloading disabling instructions, the installation and unloading instructions are not limited.
S1032, if yes, no processing is performed.
In a specific embodiment, a broadcast receiver for receiving a user instruction is established in an Android system of a cloud mobile phone, when an object of the instruction is a user or an operator and an input instruction is an installation enabling instruction, according to the received instruction, a getUserRestriction function in an API function is called through the broadcast receiver, a value of a UserManager, DISALLOW _ INSTALL _ APPS type is taken out, the taken value is compared with the value of the user instruction, if the taken value is consistent with the value of the user instruction, the value is not processed, if the taken value is not consistent with the value, a setUserManagerRestriction function of the UserManager type of the API is called, and a value of a parameter, UserManager, DISALLOW _ INSTALL _ APPS type is introduced; when the value of the type disables the install instruction, the install instruction is not restricted.
In another specific embodiment, a broadcast receiver for receiving a user instruction is created in the Android system of the cloud mobile phone, when an object of the instruction is a user or an operator and the input instruction is an unload enabling instruction, according to the received instruction, a getuserrection function in an API function is called by the broadcast receiver, a value of a usermanger, free _ unitstal _ APPS type is taken out, the taken out value is compared with a value of the user instruction, if the taken out value is consistent, no processing is performed, if the taken out value is not consistent, a usermanger setuserrection function of the API is called, and a value of a parameter usermanger, free _ unitstal _ APPS type is introduced. When the value of the type disables the offload instruction, the offload instruction is not restricted.
When the type of the user instruction is the installation and uninstallation instruction forbidding, the step 2 comprises the following steps:
s1021b, according to the received user instruction, calling the getuserrestroction function in the API function through the broadcast receiver, and taking out the values of the user manager, loss _ instal _ APPS, and user manager, loss _ unitstal _ APPS types;
s1022b, the retrieved value is compared with the value instructed by the user to determine whether the retrieved value matches the value instructed by the user.
Correspondingly, step S103 includes:
and S1031, according to the compared values, if the values do not match, calling a UserManager setUserRestriction function of the API, and introducing values of the types of the parameters UserManager, DISALLOW _ INSTALL _ APPS and UserManager, DISALLOW _ UNINSTALL _ APPS, wherein if the values are installation and unloading enabling instructions, the installation and unloading instructions are limited, and if the values are installation and unloading disabling instructions, the installation and unloading instructions are not limited.
S1032, if yes, no processing is performed.
In a specific embodiment, a broadcast receiver for receiving a user instruction is created in an Android system of a cloud mobile phone, when an object of the instruction is a user or an operator and an input instruction is an installation prohibition instruction, according to the received instruction, a getuserrection function in an API function is called by the broadcast receiver, a value of a usermanger, free _ instlal _ APPS type is taken out, the taken out value is compared with a value of the user instruction, if the taken out value is consistent, no processing is performed, if the taken out value is not consistent, a usermanger type setuserrection function of the API is called, and a value of a parameter, usermanger, free _ instlal _ APPS type, is introduced. When the value of the type is an enable install instruction, then the install instruction is restricted.
In another specific embodiment, a broadcast receiver for receiving a user instruction is created in the Android system of the cloud mobile phone, when an object of the instruction is a user or an operator and an input instruction is an instruction for prohibiting uninstallation, a getuserrection function in an API function is called by the broadcast receiver according to the received instruction, a value of a usermanger, disable _ unittall _ APPS type is taken out, the taken out value is compared with a value of the user instruction, if the taken out value is consistent, no processing is performed, if the taken out value is not consistent, a usermanger setuserrection function of the API is called, and a value of a parameter usermanger, disable _ unittall _ APPS type is introduced. When the value of the type is an enable offload instruction, then the offload instruction limits.
In a specific embodiment, a method for dynamically limiting installation and uninstallation of an Android system of a cloud mobile phone takes a system for dynamically limiting installation and uninstallation of the Android system of the cloud mobile phone as an execution object, or takes each module in the system as an execution object of a step; specifically, step S101 takes the receiving module as an execution target; step S102 takes the determination module as an execution object, step S1021 takes the retrieval unit as an execution object, and step S1022 takes the comparison unit as an execution object; step S103 is an execution target step with a processing module, step S102 is an execution target with a treatment unit, and step S102 is an execution target with a standing unit.
As shown in fig. 2, a system for dynamically limiting installation and uninstallation of an Android system of a cloud mobile phone includes:
the receiving module is used for creating a broadcast receiver in the Android system of the cloud mobile phone, receiving a user instruction and determining the type of the user instruction; the value of the user instruction comprises an enable installation uninstall instruction and a disable installation uninstall instruction;
the judging module is used for calling a corresponding class function in the API function through the broadcast receiver according to the received user instruction and determining whether the value of the user instruction is consistent with the value of the corresponding class function in the API function or not;
and the processing module is used for performing restriction processing if the data are not consistent with each other, or else, not performing the restriction processing.
Specifically, when the type of the user instruction is the installation and uninstallation enabling instruction, the judging module comprises a calling unit and a comparing unit.
A calling unit, calling a getUserRestriction function in the API function through a broadcast receiver according to the received user instruction, and taking out the values of UserManager, DISALLOW _ INSTALL _ APPS and UserManager, DISALLOW _ UNINSTALL _ APPS types;
and the comparison unit is used for comparing the extracted value with the value of the user instruction and determining whether the extracted value is consistent with the value of the user instruction.
Correspondingly, the processing module comprises:
and the processing unit is used for calling a UserManager setUserRestriction function of the API according to the compared values if the compared values do not accord with each other, transmitting values of the types of the parameters UserManager, DISALLOW _ INSTALL _ APPS and UserManager, DISALLOW _ UNINSTALL _ APPS, and limiting the installation and uninstallation instructions if the values are the installation and uninstallation enabling instructions, or not limiting the installation and uninstallation instructions if the values are the installation and uninstallation disabling instructions.
And the standing unit is used for not processing if the data are consistent.
In a specific embodiment, a receiver is created in a receiving module of an Android system of a cloud mobile phone for receiving a user instruction broadcast. When the object of the instruction is a user or an operator and the input instruction is an installation enabling instruction, the calling unit of the judgment module calls a getUserRestriction function in the API function through a broadcast receiver according to the received instruction, takes out a value of a UserManager, DISALLOW _ INSTALL _ APPS type, and takes out the value after the specific type is taken out; the comparison unit compares the extracted value with a value of the user instruction. After the comparison is finished, if the taken values are consistent, the processing module invokes the standing unit to not process, and if the taken values are not consistent, the handling unit calls a user manager setUserRestriction function of the API and transmits a parameter user manager, DISALLOW _ INSTALL _ APPS type value; when the value of the type is a disable install instruction, the install instruction is not limited.
In another specific embodiment, a receiver is created in a receiving module of the Android system of the cloud mobile phone for receiving a user instruction broadcast receiver. When the object of the instruction is a user or an operator and the input instruction is an unloading enabling instruction, the calling unit of the judgment module calls a getUserRestriction function in the API function through the broadcast receiver according to the received instruction, takes out a value of a UserManager, DISALLOW _ UNINSTALL _ APPS type, and takes out the value after the specific type; the comparison unit compares the extracted value with a value of the user instruction. After the comparison is finished, if the taken values are consistent, the processing module invokes the standing unit not to process, and if the taken values are not consistent, the handling unit calls a user manager setuserrestroction function of the API and transmits a parameter user manager, DISALLOW _ UNINSTALL _ APPS type value; when the value of the type is a disable offload instruction, the offload instruction is not restricted.
Specifically, when the type of the user instruction is a disable installation and uninstallation instruction, the judging module includes a calling unit and a comparing unit.
A calling unit, calling a getUserRestriction function in the API function through a broadcast receiver according to the received user instruction, and taking out the values of UserManager, DISALLOW _ INSTALL _ APPS and UserManager, DISALLOW _ UNINSTALL _ APPS types;
and the comparison unit is used for comparing the extracted value with the value of the user instruction and determining whether the extracted value is consistent with the value of the user instruction.
Correspondingly, the processing module comprises:
and the processing unit is used for calling a UserManager setUserRestriction function of the API according to the compared values if the compared values do not accord with each other, transmitting values of the types of the parameters UserManager, DISALLOW _ INSTALL _ APPS and UserManager, DISALLOW _ UNINSTALL _ APPS, and limiting the installation and uninstallation instructions if the values are the installation and uninstallation enabling instructions, or not limiting the installation and uninstallation instructions if the values are the installation and uninstallation disabling instructions.
And the standing unit is used for not processing if the data are consistent.
In a specific embodiment, a receiver is created in a receiving module of an Android system of a cloud mobile phone for receiving a user instruction broadcast. When the object of the instruction is an operator and the input instruction is a forbidden installation instruction, the calling unit of the judgment module calls a getUserRestriction function in the API function through a broadcast receiver according to the received instruction, takes out a value of a UserManager. The comparison unit compares the extracted value with a value of the user instruction. After the comparison is finished, if the taken values are consistent, the processing module invokes the standing unit to not process, and if the taken values are not consistent, the handling unit calls a user manager setUserRestriction function of the API and transmits a parameter user manager, DISALLOW _ INSTALL _ APPS type value; when the value of the type is an install enable instruction, then an uninstall instruction limit is installed.
In another specific embodiment, a receiver is created in a receiving module of the Android system of the cloud mobile phone for receiving a user instruction broadcast receiver. When the object of the instruction is an operator and the input instruction is a forbidden uninstalling instruction, the calling unit of the judgment module calls a getUserRestriction function in the API function through a broadcast receiver according to the received instruction, takes out a value of a UserManager, DISALLOW _ UNINSTALL _ APPS type, and takes out the value after the specific value is taken out; the comparison unit compares the extracted value with a value of the user instruction. After the comparison is finished, if the taken values are consistent, the processing module invokes the standing unit not to process, and if the taken values are not consistent, the handling unit calls a user manager setuserrestroction function of the API and transmits a parameter user manager, DISALLOW _ UNINSTALL _ APPS type value; when the value of the type is an enable offload instruction, then the offload instruction limits.
In summary, by using the technical scheme of the invention, the game maintenance operation can be completed without restarting the cloud mobile phone system, additional system configuration is not required to be added to match with installation and uninstallation limits, the security of the cloud mobile phone system is increased, the integrity of the trial play data is protected, and the equipment maintenance operation cost is reduced.
According to an embodiment of the present invention, there is also provided a storage medium having a program product stored thereon, which is capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above-mentioned "exemplary methods" section of the present description, when the program product is run on the terminal device. Which may employ a portable compact disc read only memory (CD-ROM) and include program code and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPRO or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Similarly, according to an embodiment of the present invention, there is also provided a processor on which a computer program is stored, which is executable by the processor, and in some possible implementations, various aspects of the present invention may also be implemented in the form of a program product including program code for causing a terminal device to perform the steps according to various exemplary implementations of the present invention described in the above section "exemplary method" of the present specification, when the program product is run on the terminal device.
The following disclosure provides many different embodiments or examples for implementing different configurations of embodiments of the invention. In order to simplify the disclosure of embodiments of the invention, the components and arrangements of specific examples are described below. Of course, they are merely examples and are not intended to limit the present invention. Furthermore, embodiments of the invention may repeat reference numerals and/or reference letters in the various examples, which have been repeated for purposes of simplicity and clarity and do not in themselves dictate a relationship between the various embodiments and/or arrangements discussed. In addition, embodiments of the present invention provide examples of various specific processes and materials, but one of ordinary skill in the art may recognize applications of other processes and/or use of other materials.
In the description herein, references to the description of the terms "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example" or "some examples" or the like mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processing module-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of embodiments of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.