CN115617416A - Method and system for preventing android program from being automatically started - Google Patents
Method and system for preventing android program from being automatically started Download PDFInfo
- Publication number
- CN115617416A CN115617416A CN202211256730.9A CN202211256730A CN115617416A CN 115617416 A CN115617416 A CN 115617416A CN 202211256730 A CN202211256730 A CN 202211256730A CN 115617416 A CN115617416 A CN 115617416A
- Authority
- CN
- China
- Prior art keywords
- path
- software
- installation package
- hard link
- starting
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to a method and a system for preventing an android program from being automatically started, wherein the method comprises the following steps: s1, downloading software, storing a software installation package in a path 1, and installing an agent program; s2, when software is started, starting an agent program, and moving the installation package from the path 1 to the path 2 through the hard link 1; s3, the agent program reads the class and the function in the corresponding software installation package from the path 2, stores the class and the function in the corresponding software installation package in a memory, and loads and runs software in a reflection mode for starting; and S4, after the software exits, moving the installation package back to the path 1 through the hard link 2. The invention can realize very quick software installation, and can realize the automatic start prevention of the application without the root authority of the system, thereby avoiding the self-start of the application.
Description
Technical Field
The invention relates to he, especially a method and system for preventing the self-starting of android program.
Background
Many applications of ann's tall and erect often automatic start at present, even pull up the start each other, lead to cell-phone power consumption big, the operation card is pause, is difficult to thoroughly forbid. In the prior art, whether a process is started is detected, and a method for killing the process is disclosed, for example, monitoring start information of a system is disclosed in chinese patent with application numbers CN201610636227.4, publication numbers CN106155704A, and patent names "a method and system for preventing applications from waking up each other", and when a mutual wake-up behavior between applications is detected, a woken application component is disabled, and a process of the woken application is killed. Although the method can prevent the application programs from waking up each other through process management and effectively control background application, in practice, some codes are executed in the process, and then codes for killing the process are executed, and even the mobile phone resources are more consumed than the self-starting of the programs.
Disclosure of Invention
The invention aims to provide a method and a system for preventing an android program from being automatically started, which can solve the problem of high power consumption of a mobile phone in the process of automatically starting the android program.
In order to achieve the purpose, the invention provides the following technical scheme: a method of preventing an android program from booting up, the method comprising:
s1, downloading software, storing a software installation package in a path 1, and installing an agent program;
s2, when software is started, starting an agent program, and moving the installation package from the path 1 to the path 2 through the hard link 1;
s3, the agent program reads the class and the function in the corresponding software installation package from the path 2 and stores the class and the function in the corresponding software installation package in a memory, and the software is loaded and run in a reflection mode to start;
and S4, after the software exits, moving the installation package back to the path 1 through the hard link 2.
Further, the moving the installation package from the path 1 to the path 2 through the hard link 1 in the step S2 is further specifically: after receiving the instruction of starting the software, the agent program creates a hard link 1 of a path 2 for the path 1, and moves the software installation package from the path 1 to the path 2 through the hard link 1.
Further, the loading and running software in a reflection manner in step S3 is further specifically started as follows: loading and finding the started class and function in the installation package through a reflection mode, executing the starting function, and running software to start; the reflection mode is a reflection mechanism of Java and can dynamically read code classes or functions, and codes in the code classes or functions can be executed without running software.
Further, the moving the installation package back to the path 1 through the hard link 2 in the step S4 is further specifically: and after receiving the instruction of exiting the software, the agent program creates a hard link 2 of the path 1 for the path 2, and moves the software installation package back to the path 1 through the hard link 2.
A system for preventing self-starting of an android program comprises an installation module, a first mobile module, a starting module and a second mobile module;
installing a module: downloading software, storing a software installation package in a path 1, and installing an agent program;
a first movement module: when software is started, an agent program is started first, and an installation package is moved from a path 1 to a path 2 through a hard link 1;
a starting module: the agent program reads the class and the function in the corresponding software installation package from the path 2, stores the class and the function in the corresponding software installation package in a memory, and loads and runs software in a reflection mode to start;
a second moving module: after the software exits, the installation package is moved back to path 1 over hard link 2.
Further, the moving the installation package from the path 1 to the path 2 through the hard link 1 in the first moving module is further specifically: and after receiving the instruction of starting the software, the agent program creates a hard link 1 of a path 2 for the path 1, and moves the software installation package from the path 1 to the path 2 through the hard link 1.
Further, the starting of the software loaded and run in the starting module in a reflection mode is further specifically: loading and finding the started class and function in the installation package through a reflection mode, executing the starting function, and running software to start; the reflection mode is a reflection mechanism of Java and can dynamically read code classes or functions, and codes in the code classes or functions can be executed without running software.
Further, the moving the installation package back to the path 1 through the hard link 2 in the second moving module is further specifically: and after receiving the instruction of exiting the software, the agent program creates a hard link 2 of the path 1 for the path 2 and moves the software installation package back to the path 1 through the hard link 2.
The invention has the beneficial effects that: software which does not need to be started is moved to a special path through a hard link, so that the situation that the application is not installed is avoided, the software is moved to the path for starting in a hard link mode and is irrelevant to the size of the software, software installation can be rapidly achieved, and the automatic starting of the application can be prevented without obtaining root authority through reflection operation in an agent program.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention;
fig. 2 is a schematic block diagram of the system of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Referring to fig. 1, a method for preventing an android program from booting automatically according to the present invention includes the following steps:
s1, downloading software, storing a software installation package in a path 1, and installing an agent program;
s2, when software is started, starting an agent program, and moving the installation package from the path 1 to the path 2 through the hard link 1;
s3, the agent program reads the class and the function in the corresponding software installation package from the path 2 and stores the class and the function in the corresponding software installation package in a memory, and the software is loaded and run in a reflection mode to start;
and S4, after the software exits, moving the installation package back to the path 1 through the hard link 2.
The invention is further illustrated below with reference to a specific embodiment:
the invention discloses a method for preventing an android program from being automatically started, which comprises the following steps:
1. downloading software, storing a software installation package in a path 1, and installing an agent program to a desktop;
for example: 1. downloading the software app1, storing the software installation package/appdak/app1. Apk in the path 1, recording the software name, and installing the proxy. Apk into the system.
2. When software is started, an agent program is started first, and an installation package is moved from a path 1 to a path 2 through a hard link 1;
2.1 moving the installation package from path 1 to path 2 through the hard link 1 in the step S2 is further specifically: and after receiving the instruction of starting the software, the agent program creates a hard link 1 of a path 2 for the path 1, and moves the software installation package from the path 1 to the path 2 through the hard link 1.
For example: 2. opening a proxy program proxy through the desktop, and restarting app1 in the proxy program proxy;
when the proxy program proxy receives an instruction for starting the software app1, a hard link 1 of a path 2 is created for the path 1, a hard link 1/app 1.Apk from the path 1 to the path 2 is created for the/appdak/app1. Apk, and then the/appdak/app1. Apk of the path 1 is deleted, so that the software installation package is moved from the path 1 to the path 2 through the hard link 1.
3. The agent program reads the class and the function in the corresponding software installation package from the path 2, stores the class and the function in the corresponding software installation package in a memory, and loads and runs software in a reflection mode to start; the agent is software for preventing automatic starting, only the apk exists in a path 1, and is not actually installed, so the apk is started by the agent.
3.1 the step S3 of loading and running software in a reflection manner is further specifically: loading and finding the started class and function in the installation package through a reflection mode, executing the starting function, and running software to start; the reflective mode is a reflective mechanism of Java, and code classes or functions can be dynamically read, and codes in the reflective mode can be executed without running software.
For example: 3. reading the apk file on the disk into a memory, decompressing a code file, and loading/app/app1. Apk of the path 2 into the memory by the proxy program;
3.1 finding the apk started class and function through reflection, and executing the application starting function.
4. After the software exits, the installation package is moved back to path 1 over hard link 2.
4.1 moving the installation package back to the path 1 through the hard link 2 in the step S4 is further specifically: and after receiving the instruction of exiting the software, the agent program creates a hard link 2 of the path 1 for the path 2, and moves the software installation package back to the path 1 through the hard link 2.
For example: 4. after the program exits;
the 4.1 agent program creates a hard link 2 of the path 1 for the path 2 after receiving an instruction of exiting the software app1, and moves/app 1.Apk of the path 2 back to/apppak/app.apk of the path 1 through the hard link 2 to delete/apppak/app 1.Apk of the path 2, so that other programs cannot find files under the path even if the other programs need to run/app 1.Apk of the path 2.
Referring to fig. 2, the present invention further provides a system for preventing an android program from being automatically started, where the system includes an installation module, a first moving module, a starting module, and a second moving module;
installing a module: downloading software, storing a software installation package in a path 1, and installing an agent program;
for example: 1. downloading the software app1, storing the software installation package/appdak/app1. Apk in the path 1, and installing the proxy. Apk into the system.
A first moving module: when software is started, an agent program is started first, and an installation package is moved from a path 1 to a path 2 through a hard link 1;
the moving the installation package from the path 1 to the path 2 through the hard link 1 in the first moving module is further specifically: and after receiving the instruction of starting the software, the agent program creates a hard link 1 of a path 2 for the path 1, and moves the software installation package from the path 1 to the path 2 through the hard link 1.
For example: 2. opening a proxy program proxy through the desktop, and restarting app1 in the proxy program proxy;
when the proxy program proxy receives an instruction for starting the software app1, a hard link 1 of a path 2 is created for the path 1, a hard link 1/app 1.Apk from the path 1 to the path 2 is created for the/appdak/app1. Apk, and then the/appdak/app1. Apk of the path 1 is deleted, so that the software installation package is moved from the path 1 to the path 2 through the hard link 1.
A starting module: the agent program reads the class and the function in the corresponding software installation package from the path 2, stores the class and the function in the corresponding software installation package in a memory, and loads and runs software in a reflection mode to start; the agent is software for preventing automatic starting, only the apk exists in a path 1, and is not actually installed, so the apk is started by the agent.
The starting module further specifically comprises the following steps of loading and running software in a reflection mode for starting: loading and finding the started class and function in the installation package in a reflection mode, executing the starting function, and running software for starting; the reflection mode is a reflection mechanism of Java and can dynamically read code classes or functions, and codes in the code classes or functions can be executed without running software.
For example: 3. reading the apk file on the disk into an internal memory, decompressing a code file, and loading/app/app1. Apk of the path 2 into the internal memory by the proxy program proxy;
3.1 finding the apk started class and function through reflection, and executing the application starting function.
A second movement module: after the software exits, the installation package is moved back to path 1 over hard link 2.
The moving the installation package back to the path 1 through the hard link 2 in the second moving module is further specifically: and after receiving the instruction of exiting the software, the agent program creates a hard link 2 of the path 1 for the path 2 and moves the software installation package back to the path 1 through the hard link 2.
For example: 4. after the program exits;
and 4.1, after receiving an instruction of exiting the software app1, the agent program creates a hard link 2 of the path 1 for the path 2, and moves/app/app1. Apk of the path 2 back to/apppak/app1. Apk of the path 1 through the hard link 2, and deletes/apppak/app1. Apk of the path 2, so that files under the path cannot be found by other programs even if the path 2 is run by the/app/app1. Apk.
In a word, the software which does not need to be started is installed in a special path 1, when the software is started, the software is moved into a path 2 for starting in a hard link mode, the software is operated by reflection in an agent program, and after the software is quitted, the software is moved into the special path 1 in the hard link mode, so that the software installation is realized very quickly, and meanwhile, the situation of preventing the application from being automatically started and avoiding the self-starting of the application can be realized without the root authority of a system.
The above description is only a preferred embodiment of the present invention, and all equivalent changes and modifications made in accordance with the claims of the present invention should be covered by the present invention.
Claims (8)
1.A method for preventing android programs from being started automatically is characterized by comprising the following steps:
s1, downloading software, storing a software installation package in a path 1, and installing an agent program;
s2, when software is started, starting an agent program, and moving the installation package from the path 1 to the path 2 through the hard link 1;
s3, the agent program reads the class and the function in the corresponding software installation package from the path 2 and stores the class and the function in the corresponding software installation package in a memory, and the software is loaded and run in a reflection mode to start;
and S4, after the software exits, moving the installation package back to the path 1 through the hard link 2.
2. The method for preventing the android program from being automatically started according to claim 1, wherein: moving the installation package from the path 1 to the path 2 through the hard link 1 in the step S2 is further specifically: and after receiving the instruction of starting the software, the agent program creates a hard link 1 of a path 2 for the path 1, and moves the software installation package from the path 1 to the path 2 through the hard link 1.
3. The method for preventing the android program from being automatically started according to the claim 1, characterized in that: the step S3 of loading and running software in a reflective manner is further specifically: loading and finding the started class and function in the installation package in a reflection mode, executing the starting function, and running software for starting; the reflective mode is a reflective mechanism of Java, and code classes or functions can be dynamically read, and codes in the reflective mode can be executed without running software.
4. The method for preventing the android program from being automatically started according to the claim 1, characterized in that: the moving the installation package back to the path 1 through the hard link 2 in the step S4 is further specifically: and after receiving the instruction of exiting the software, the agent program creates a hard link 2 of the path 1 for the path 2, and moves the software installation package back to the path 1 through the hard link 2.
5. A system for preventing android programs from being started automatically is characterized in that: the system comprises an installation module, a first moving module, a starting module and a second moving module;
installing a module: downloading software, storing a software installation package in a path 1, and installing an agent program;
a first movement module: when software is started, an agent program is started first, and an installation package is moved from a path 1 to a path 2 through a hard link 1;
a starting module: the agent program reads the class and the function in the corresponding software installation package from the path 2, stores the class and the function in the corresponding software installation package to a memory, and loads and runs software in a reflection mode for starting;
a second movement module: after the software exits, the installation package is moved back to path 1 over hard link 2.
6. The system for preventing the android program from being automatically started according to the claim 5, characterized in that: the moving the installation package from the path 1 to the path 2 through the hard link 1 in the first moving module is further specifically: after receiving the instruction of starting the software, the agent program creates a hard link 1 of a path 2 for the path 1, and moves the software installation package from the path 1 to the path 2 through the hard link 1.
7. The system for preventing the android program from being automatically started according to claim 5, wherein: the starting module further specifically comprises the following steps of: loading and finding the started class and function in the installation package in a reflection mode, executing the starting function, and running software for starting; the reflection mode is a reflection mechanism of Java and can dynamically read code classes or functions, and codes in the code classes or functions can be executed without running software.
8. The system for preventing the android program from being automatically started according to the claim 5, characterized in that: the moving the installation package back to the path 1 through the hard link 2 in the second moving module is further specifically: and after receiving the instruction of exiting the software, the agent program creates a hard link 2 of the path 1 for the path 2, and moves the software installation package back to the path 1 through the hard link 2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211256730.9A CN115617416A (en) | 2022-10-13 | 2022-10-13 | Method and system for preventing android program from being automatically started |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211256730.9A CN115617416A (en) | 2022-10-13 | 2022-10-13 | Method and system for preventing android program from being automatically started |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115617416A true CN115617416A (en) | 2023-01-17 |
Family
ID=84863421
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211256730.9A Pending CN115617416A (en) | 2022-10-13 | 2022-10-13 | Method and system for preventing android program from being automatically started |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115617416A (en) |
-
2022
- 2022-10-13 CN CN202211256730.9A patent/CN115617416A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3955358B2 (en) | Method and computer system for executing architecture specific code with reduced run-time memory space requirements | |
US6745224B1 (en) | Object framework and services for periodically recurring operations | |
EP0811911B1 (en) | Computer system and method for executing network mobile code with reduced run-time memory space requirements | |
CN107291510B (en) | Rapid starting method for Linux vehicle-mounted information system | |
US11960869B2 (en) | Android penetration method and device for implementing silent installation based on accessibility services | |
US20030135781A1 (en) | Method and system for error detection in a managed application environment | |
US7003554B1 (en) | System and method for downloading portions of a remotely located network object to produce a completely downloaded local copy of the network object | |
WO2017219482A1 (en) | Starting method and device | |
CN118227424B (en) | Log record template access method and system applied to distributed component | |
CN106997313B (en) | Signal processing method and system of application program and terminal equipment | |
CN115617416A (en) | Method and system for preventing android program from being automatically started | |
US5996078A (en) | Method and apparatus for preventing inadvertent power management time-outs | |
CN111897543A (en) | Software management method, device, management equipment and storage medium | |
CN111367570A (en) | Application software self-starting method and device | |
CN113791824B (en) | Peripheral driver loading method, system and medium of terminal equipment | |
CN113342376B (en) | Method and device for upgrading operating system of Internet of things equipment | |
CN115981826A (en) | Task scheduling processing method and device, computer equipment and readable storage medium | |
CN110389791B (en) | Component scheduling method, device, equipment and storage medium | |
CN117667169A (en) | Application program updating method and device, electronic equipment and storage medium | |
JP2003330736A (en) | Unauthorized resource use preventing system, method and program therefor | |
CN112035131A (en) | Method for processing internet software installation application | |
CN116400945B (en) | Dynamic link library upgrading method, electronic equipment and storage medium | |
CN113568628B (en) | ISO automated production method based on debrian system | |
CN115269442B (en) | Debugging method and tool based on graphic interface architecture and management project | |
CN111708666B (en) | Method, system, equipment and medium for starting container log |
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 |