Method, system, computer device and storage medium for acquiring shell execution authority

A technology of permissions and execution results, which is applied in the field of computer device permission control, can solve problems that affect user experience, be easily attacked by rogue software, and cannot be used in time, and achieve the effect of reducing the trouble of running permissions

Active Publication Date: 2021-08-06
SHENZHEN ONETHING TECH CO LTD
View PDF10 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] (1) Usually in order to obtain the root authority of the android mobile phone, because the ROM has the anti-root function, it needs to be realized by flashing the phone, which is time-consuming and energy-consuming;
[0004] (2) The rooted android system itself becomes unsafe due to the opening of the root authority, and is easily attacked by rogue software;
[0005] (3) The rooted android system can no longer continue to follow the manufacturer's version to continuously upgrade, cannot use new functions in time, fix existing bugs, and affect the user experience

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method, system, computer device and storage medium for acquiring shell execution authority
  • Method, system, computer device and storage medium for acquiring shell execution authority
  • Method, system, computer device and storage medium for acquiring shell execution authority

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049] figure 1 is a flowchart of a method for obtaining shell execution authority provided by an embodiment of the present invention. The method for obtaining shell execution authority is applied to a computer device, and is used to obtain the shell execution authority of the computer device.

[0050] Referring to 1, the method for obtaining shell execution permission specifically includes the following steps:

[0051] S101. Receive a shell command.

[0052] The shell command is used to access the services of the operating system kernel.

[0053] Shell commands are in the form of strings. For example, the shell command is "am start –ncom.example.hello / .MainActivity".

[0054] Shell commands can include file and directory operation commands, such as the ls command, which is used to display information about files and directories; another example is the cd command, which is used to rename a directory; and another example is the diff command, which is used to compare file co...

Embodiment 2

[0096] figure 2The structural diagram of a preferred embodiment of the system for obtaining shell execution authority provided by the embodiment of the present invention. The system for obtaining shell execution authority is applied to a computer device, and is used to obtain the shell execution authority of the computer device.

[0097] like figure 2 As shown, the system 10 for obtaining shell execution authority may include: a receiving unit 201 , a privilege escalation unit 202 , and an execution unit 203 .

[0098] The receiving unit 201 is configured to receive a shell command.

[0099] The shell command is used to access the services of the operating system kernel.

[0100] Shell commands are in the form of strings. For example, the shell command is "am start –ncom.example.hello / .MainActivity".

[0101] Shell commands can include file and directory operation commands, such as the ls command, which is used to display information about files and directories; another...

Embodiment 3

[0143] This embodiment provides a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps in the above-mentioned method embodiment for acquiring shell execution authority are implemented, for examplefigure 1 S101-S106 shown:

[0144] S101, receiving a shell command;

[0145] S102, constructing the first child process whose parent process ID is 1;

[0146] S103. Create a new session in the first sub-process, set the first sub-process as the main process of the session, and set the process group ID, process user ID, and process effective user of the first sub-process ID, process group user ID;

[0147] S104. Create a second subprocess in the first subprocess;

[0148] S105. Execute the shell command through the second subprocess;

[0149] S106. Obtain an execution result of the shell command through the first subprocess.

[0150] Alternatively, when the compute...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The present invention provides a method for acquiring shell execution authority, comprising: receiving a shell command; constructing a first child process whose parent process ID is 1; creating a new session in the first child process, and converting the first child process to Be set as the main process of the session, set the process group ID, process user ID, process effective user ID, process group user ID of the first sub-process; create a second sub-process in the first sub-process; pass The second subprocess executes the shell command; the execution result of the shell command is obtained through the first subprocess. The present invention also provides a system, a computer device and a computer-readable storage medium for obtaining shell execution authority. The invention can conveniently, safely and reliably obtain shell execution authority.

Description

technical field [0001] The present invention relates to the technical field of computer device authority management and control, in particular to a method, system, computer device and computer-readable storage medium for acquiring shell execution authority. Background technique [0002] The original method of obtaining shell execution permission for the android system is generally implemented by calling jni (JavaNative Interface) from the app, and both need to root the system to obtain the root permission of the system. This method is undoubtedly the most direct way , but there are the following problems: [0003] (1) Usually in order to obtain the root authority of the android mobile phone, because the ROM has the anti-root function, it needs to be realized by flashing the phone, which is time-consuming and energy-consuming; [0004] (2) The rooted android system itself becomes unsafe due to the opening of the root authority, and is easily attacked by rogue software; [0...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F21/52G06F21/12
Inventor 唐成
Owner SHENZHEN ONETHING TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products