CN111597515A - Application signature acquisition method and electronic equipment - Google Patents

Application signature acquisition method and electronic equipment Download PDF

Info

Publication number
CN111597515A
CN111597515A CN202010332412.0A CN202010332412A CN111597515A CN 111597515 A CN111597515 A CN 111597515A CN 202010332412 A CN202010332412 A CN 202010332412A CN 111597515 A CN111597515 A CN 111597515A
Authority
CN
China
Prior art keywords
application program
file
target application
installation file
class
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
Application number
CN202010332412.0A
Other languages
Chinese (zh)
Inventor
吴剑华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202010332412.0A priority Critical patent/CN111597515A/en
Publication of CN111597515A publication Critical patent/CN111597515A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an application signature acquisition method and electronic equipment. The method is applied to the electronic equipment and comprises the following steps: acquiring an installation file path of a target application program; reading an installation file of the target application program based on the installation file path; and analyzing the installation file of the target application program to obtain signature information of the installation file of the target application program. According to the embodiment of the invention, the accuracy of acquiring the signature information of the installation file of the application program can be improved, and the safety of the application program is further improved.

Description

Application signature acquisition method and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to an application signature acquisition method and electronic equipment.
Background
The Application (APP) repacking mainly refers to a technology of implanting malicious codes, advertisement information, malicious links and other operations into an APP and re-signing and releasing a new program to illegally obtain benefits. The repacking technology is widely used at present, and particularly, the repacking technology is developed more rapidly along with popularization of mobile application. The APP software is repackaged after being decompiled, so that the rights of an original edition author are damaged, and a huge threat is brought to the information and the privacy of a user.
The method for detecting repackaging is realized by signature verification. At present, the APP signature verification method obtains package information through a package manager, and then obtains a signature of the package information to perform signature verification. However, this method involves a risk of being bypassed by a dynamic proxy Package Management Service (PMS).
Therefore, a method for accurately acquiring the signature of the application program is urgently needed to improve the security of the application program and maintain the rights and interests of software developers and users.
Disclosure of Invention
The embodiment of the invention provides an acquisition method of an application signature, electronic equipment and a medium, which can solve the problem of low safety of an application.
In order to solve the above technical problem, the embodiment of the present invention is implemented as follows:
in a first aspect, an embodiment of the present invention provides an application signature obtaining method, which is applied to an electronic device, and the method includes:
acquiring an installation file path of a target application program;
reading an installation file of the target application program based on the installation file path;
and analyzing the installation file of the target application program to obtain signature information of the installation file of the target application program.
In a second aspect, an embodiment of the present invention provides an electronic device, including:
the installation file path acquisition module is used for acquiring an installation file path of the target application program;
the installation file reading module is used for reading the installation file of the target application program based on the installation file path;
and the processing module is used for analyzing the installation file of the target application program to obtain the signature information of the installation file of the target application program.
In a third aspect, an embodiment of the present invention provides an electronic device, where the device includes: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the method of obtaining an application signature as provided in the first aspect above.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium, on which computer program instructions are stored, and when executed by a processor, the computer program instructions implement the method for acquiring an application signature as provided in the first aspect.
In the embodiment of the invention, the installation file of the target application program is read based on the installation file path of the target application program, and the installation file of the target application program is analyzed, so that the signature information of the installation file of the target application program can be accurately obtained, and the accuracy of signature information verification is improved. The problem of signature tampering caused by intercepting PMS service interfaces through a dynamic proxy can be solved, so that the application is prevented from being tampered and repackaged for the second time, the safety of the application program is improved, and the rights and interests of a software developer and a user are maintained.
Drawings
The present invention will be better understood from the following description of specific embodiments thereof taken in conjunction with the accompanying drawings, in which like or similar reference characters designate like or similar features.
Fig. 1 is a flowchart illustrating an acquisition method of an application signature according to an embodiment of the present invention;
fig. 2 is a second flowchart illustrating a method for acquiring an application signature according to an embodiment of the present invention;
fig. 3 is a third schematic flowchart of a method for acquiring an application signature according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 5 is a second schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
At present, a PackageManager class getPackageInfo () function is used to obtain PackageInfo, and then a signature object is extracted from the PackageInfo, that is, package information is obtained through a package manager, and then a signature of the package information is obtained. Signature information is also obtained using the Java-level getPackageInfo method. However, all current methods for obtaining signatures by calling getParageInfo cannot resist the dynamic proxy PMS from signing attacks, and the method for verifying signatures cannot resist the attacks by intercepting a packet manager by the dynamic proxy PMS.
There are many tools that bypass APP signature verification with one-key, such as apkssigneturekiller, SigKill, and kstols. The principle of these types of tools is to intercept the method of obtaining the signature by the PMS service of the mobile proxy hook application, and then replace the signature with the correct signature information, i.e. the signature information is tampered. The signature verification module always acquires the tampered original correct signature, so that the signature verification module of the APP is bypassed, and automatic signature blasting of the APP is realized.
The harm of secondary repackaging is huge, and malicious user can insert own Java code and load own dynamic storehouse, calls original APP's method to all data in acquireing and printing APP process, including various privacy data such as account number, password, agreement, have reduced APP's security.
Based on this, the embodiment of the invention provides an acquisition method of an application signature, an electronic device and a medium, which improve the security of an application. The following detailed description is to be read with reference to the specific drawings and examples.
Fig. 1 is a flowchart illustrating an acquisition method of an application signature applied to an electronic device according to an embodiment of the present invention. As shown in fig. 1, the method for acquiring an application signature according to an embodiment of the present invention includes steps 110 to 130.
Step 110, obtaining an installation file path of the target application program.
And step 120, reading the installation file of the target application program based on the installation file path.
And step 130, analyzing the installation file of the target application program to obtain signature information of the installation file of the target application program.
In the embodiment of the invention, the installation file of the target application program is read based on the installation file path of the target application program, and the installation file of the target application program is analyzed, so that the signature information of the installation file of the target application program can be accurately obtained, and the accuracy of signature information verification is improved. The problem of signature tampering caused by intercepting PMS service interfaces through a dynamic proxy can be solved, so that the application is prevented from being tampered and repackaged for the second time, the safety of the application program is improved, and the rights and interests of a software developer and a user are maintained.
The specific implementation of each of steps 110 to 130 is described below.
First, a specific implementation of step 110 is described. In some embodiments, after the user downloads the installation file of the target application, the installation of the target application is implemented by using the file. Therefore, the file path of the installation file of the target application program, namely the installation file path of the target application program, can be queried by the user. Therefore, the installation file path of the target application program can be input by the user to meet the personalized requirements of the user.
In other embodiments, to improve the efficiency of signature information acquisition, step 110 includes: acquiring a starting request of a target application program; and acquiring an installation file path of the target application program based on the starting request.
As an example, when the electronic device receives a user click input on an icon of a target application, it may be considered that a user start request for the target application is received. The electronic equipment responds to the starting request, and automatically acquires the installation file path of the target application program, so that the operation time of a user is reduced, and the efficiency of acquiring the signature information of the installation file of the target application program is improved.
That is, before the target application is started, the step of verifying the signature information of the installation file of the target application needs to be performed.
As one example, a full path of an installation file of a target application is acquired by calling a method of getApplicationContext ().
In step 120, after the path of the installation file of the target application program is obtained, the installation file of the target application program may be read based on the path.
Next, a specific implementation of step 130 is introduced.
In some embodiments, step 130 comprises step 1301.
Step 1301, calling a file analysis class, and analyzing the installation file of the target application program to obtain signature information of the installation file of the target application program.
Alternatively, the file parsing class may be a package parsing class, such as a PackageParser, which is a hidden class provided inside the Android system and dedicated to parsing and reading Android Application Package (APK) data and signatures. In addition, since the APK file itself is a JAR type compressed package file, the file analysis class may also be a JAR file analysis class.
In some embodiments of the invention, the signature information of the application program file is acquired by analyzing the application program file by calling the file analysis class, which is convenient and quick, and can improve the efficiency of acquiring the signature information.
Specifically, in some embodiments, if the file parsing class is the package parsing class, step 130 includes: and instantiating the package analysis class by adopting a reflection mechanism to obtain the instantiated package analysis class. And calling a pre-analysis function of the instantiated package analysis class, and pre-analyzing the installation file of the target application program to obtain a package object. And calling a certificate collection function of the instantiated package analysis class, and analyzing the package object to obtain signature information.
As an example, referring to fig. 2, if the target application is an Android application, before the target APP is started, signature verification is performed on the target APP. After reading the APK file based on the obtained file path (namely the installation file path of the target application program) where the APK of the target APP is located, firstly, a new android.
Among them, the reflection mechanism is the fundamental capability provided by the Java language. And calling the hidden Android system class through a Java reflection interface. The PackageParser class is a specific hidden class of Android, is a class responsible for analyzing and acquiring APK data and signatures in an Android system, and is a packet analysis class. And after instantiating the packageParser class, obtaining the instantiated packageParser class.
And calling a parseMonolithicPackage method of the instantiated PackageParser class to perform pre-analysis processing on the APK file, so as to obtain a PackageParser. In addition, other data of the APK, such as a dynamic library (so), a resource file and the like, can be pre-solved.
And then, calling a PackageParser. collectCertificates method to process the pre-solved PackageParser. Package object to obtain the signature information mSeigning details of the APK. A complete Signature [ ] Signature array inside the mSigginingDetails field is obtained. And then, calling a signature. That is, the signature information of the installation file of the target application program can be obtained by performing parsing processing on the package object by using the certificate collection function calling the instantiated package parsing class.
The hidden collectcertifies method is called through a Java reflection interface, so that secondary repacking of the application can be prevented, signature attack of a PMS service intercepted by a dynamic agent can be effectively resisted, a mainstream one-key explosion signature automation tool in the market can be prevented, and the software legality can be effectively protected.
Then, hash values are taken of the signed byte data of the installation file of the target application program. Then, the hash value of the signed byte data is compared with the built-in developer-signed hash value (i.e., the correctly signed hash value of the application), and whether the hash values are consistent or not is determined. And if the two hash values are consistent, the verification is passed, and the target application program operates normally. And if the two hash values are inconsistent, the verification fails, and the application program is forcibly quitted.
Specifically, in other embodiments, the file parsing class is a JAR file parsing class, and step 130 includes invoking the file parsing class, and performing parsing processing on the installation file of the target application program to obtain signature information of the installation file of the target application program, where the method includes: instantiating the JAR file analysis class to obtain an instantiated JAR file analysis class; calling an input stream reading function of the instantiated JAR file parsing class, and reading an installation file of a target application program into an input stream; calling a manifest file reading function of an instantiated JAR file analysis class, and reading a manifest file from an input stream; and acquiring signature information from the manifest file.
As an example, referring to fig. 3, if the target application is an Android application, after reading an APK file based on a file path where an APK of the obtained target APP is located, a new JarFile is called, that is, a JarFile class is instantiated, so that the instantiated JarFile class is obtained.
Then, call JAR file, getinputstream (), i.e. the input stream reading function of the JAR class, and read the JAR type compressed file of APK as the input stream.
Next, call jar file getjarentry () method to read the android manifest file (manifest file) from the input stream. And calling a manifest file reading function of the instantiated JAR file parsing class, and reading the manifest file from the input stream.
And then, signature information msigning details of the manifest file is read through jarentry. A complete Signature [ ] Signature array inside the mSigginingDetails field is obtained. And then, calling a signature.
Then, hash values are taken of the signed byte data of the installation file of the target application program. Then, the hash value of the signed byte data is compared with the built-in developer-signed hash value (i.e., the correctly signed hash value of the application), and whether the hash values are consistent or not is determined. And if the two hash values are consistent, the verification is passed, and the target application program operates normally. And if the two hash values are inconsistent, the verification fails, and the application program is forcibly quitted.
In the embodiment of the invention, the signature of the APK is analyzed by the file stream, so that the method can prevent secondary repackaging of the application, has strong compatibility with the system, and can effectively resist signature attack performed by intercepting the PMS by the dynamic proxy Hook. In addition, the basic Java JarFile interface has stronger system compatibility, and can be unrelated to the Android system or decoupled from the Android system.
Further, in some embodiments, in order to improve the security of the application, the method for acquiring the signature of the application provided by the present invention further includes: encrypting the signature information to obtain target encryption information; under the condition that the target encryption information is inconsistent with the first encryption information, quitting the target application program; and running the target application program under the condition that the target encryption information is consistent with the first encryption information. The first encryption information is the encryption information corresponding to the correct signature information of the installation file of the target application program.
In some embodiments, the signature information may be hashed using a hashing algorithm to encrypt the signature information. And the target encryption information is a target hash value corresponding to the signature information. The first encryption information is a first hash value corresponding to correct signature information of the target application program.
And under the condition that the target hash value is the same as the first hash value, the target application program is considered not to be repackaged for the second time, namely, not to be tampered, namely, the verification is successful, and the target application program can be operated.
And under the condition that the target hash value is the same as the first hash value, the target application program is considered to be repackaged, namely, the verification fails, and the target application program is forcibly quitted.
As an example, the hash algorithm may be a message digest algorithm, a secure hash algorithm, or an SM3 cryptographic hash algorithm, among others.
In the embodiment of the present invention, the method for acquiring signature information provided in the embodiment of the present invention may be implemented in a Java layer, and may also be implemented in a dynamic library of a native layer by a JNI method. The implementation in the dynamic library is beneficial to hiding the signature hash value of a built-in developer, and prevents direct modification of decompilation.
In the embodiment of the invention, the installation file of the target application program is read based on the installation file path of the target application program, and the installation file of the target application program is analyzed, so that the signature information of the installation file of the target application program can be accurately obtained, and the accuracy of signature information verification is improved. The problem of signature tampering caused by intercepting PMS service interfaces through a dynamic proxy can be solved, so that the application is prevented from being tampered and repackaged for the second time, the safety of the application program is improved, and the rights and interests of a software developer and a user are maintained.
Fig. 4 shows a schematic structural diagram of an electronic device 400 according to an embodiment of the present invention. As shown in fig. 4, an electronic device 400 provided in an embodiment of the present invention includes:
an installation file path obtaining module 410, configured to obtain an installation file path of the target application.
And the installation file reading module 420 is configured to read an installation file of the target application program based on the installation file path.
The processing module 430 is configured to analyze the installation file of the target application program to obtain signature information of the installation file of the target application program.
In the embodiment of the invention, the installation file of the target application program is read based on the installation file path of the target application program, and the installation file of the target application program is analyzed, so that the signature information of the installation file of the target application program can be accurately obtained, and the accuracy of signature information verification is improved. The problem of signature tampering caused by intercepting PMS service interfaces through a dynamic proxy can be solved, so that the application is prevented from being tampered and repackaged for the second time, the safety of the application program is improved, and the rights and interests of a software developer and a user are maintained.
In some embodiments, the processing module 430 includes:
and the processing unit is used for calling the file analysis class and analyzing the installation file of the target application program to obtain the signature information of the installation file of the target application program.
In some embodiments, the file parsing class is a package parsing class, and the processing unit includes:
and the first instantiation subunit is used for instantiating the package analysis class by adopting a reflection mechanism to obtain the instantiated package analysis class.
And the pre-analysis subunit is used for calling a pre-analysis function of the instantiated package analysis class, and pre-analyzing the installation file of the target application program to obtain a package object.
And the first signature information determining subunit is used for calling a certificate collecting function of the instantiated package analysis class, and analyzing the package object to obtain the signature information.
In some embodiments, the file parsing class is a package parsing class, and the processing unit includes:
and the second instantiation subunit is used for instantiating the JAR file analysis class to obtain the instantiated JAR file analysis class.
And the input stream reading subunit is used for calling an input stream reading function of the instantiated JAR file parsing class and reading the installation file of the target application program as the input stream.
And the manifest file reading subunit is used for calling a manifest file reading function of the instantiated JAR file analysis class and reading the manifest file from the input stream.
And the second signature information determining subunit is used for acquiring the signature information from the manifest file.
In some embodiments, electronic device 400 further comprises:
and the encryption module is used for encrypting the signature information to obtain target encryption information.
And the quitting module is used for quitting the target application program under the condition that the target encryption information is inconsistent with the first encryption information.
And the running module is used for running the target application program under the condition that the target encryption information is consistent with the first encryption information.
The first encryption information is the encryption information corresponding to the correct signature information of the installation file of the target application program.
The electronic device 600 provided in the embodiment of the present invention can implement each process of the method for acquiring the application signature applied in the embodiment of the present invention, and is not described herein again to avoid repetition.
Fig. 5 is a schematic diagram of a hardware structure of an electronic device 500 for implementing various embodiments of the present invention, where the electronic device 500 includes, but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 5 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The processor 510 is configured to obtain an installation file path of a target application program; reading an installation file of the target application program based on the installation file path; and analyzing the installation file of the target application program to obtain signature information of the installation file of the target application program.
In the embodiment of the invention, the installation file of the target application program is read based on the installation file path of the target application program, and the installation file of the target application program is analyzed, so that the signature information of the installation file of the target application program can be accurately obtained, and the accuracy of signature information verification is improved. The problem of signature tampering caused by intercepting PMS service interfaces through a dynamic proxy can be solved, so that the application is prevented from being tampered and repackaged for the second time, the safety of the application program is improved, and the rights and interests of a software developer and a user are maintained.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 501 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 510; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 501 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 502, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 503 may convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output as sound. Also, the audio output unit 503 may also provide audio output related to a specific function performed by the electronic apparatus 500 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, and the like.
The input unit 504 is used to receive an audio or video signal. The input Unit 504 may include a Graphics Processing Unit (GPU) 5041 and a microphone 5042, and the Graphics processor 5041 processes image data of a still picture or video obtained by an image capturing device (such as a camera component) in a video capture mode or an image capture mode. The processed image frames may be displayed on the display unit 506. The image frames processed by the graphic processor 5041 may be stored in the memory 509 (or other storage medium) or transmitted via the radio frequency unit 501 or the network module 502. The microphone 5042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 501 in case of the phone call mode.
The electronic device 500 also includes at least one sensor 505, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 5061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 5061 and/or a backlight when the electronic device 500 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 505 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 507 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. Touch panel 5071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 5071 using a finger, stylus, or any suitable object or attachment). The touch panel 5071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 510, and receives and executes commands sent by the processor 510. In addition, the touch panel 5071 may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 5071, the user input unit 507 may include other input devices 5072. In particular, other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 5071 may be overlaid on the display panel 5061, and when the touch panel 5071 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 510 to determine the type of the touch event, and then the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of the touch event. Although in fig. 5, the touch panel 5071 and the display panel 5061 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 5071 and the display panel 5061 may be integrated to implement the input and output functions of the electronic device, and is not limited herein.
The interface unit 508 is an interface for connecting an external device to the electronic apparatus 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 508 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic apparatus 500 or may be used to transmit data between the electronic apparatus 500 and external devices.
The memory 509 may be used to store software programs as well as various data. The memory 509 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 510 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 509 and calling data stored in the memory 509, thereby performing overall monitoring of the electronic device. Processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 510.
The electronic device 500 may further include a power supply 511 (e.g., a battery) for supplying power to various components, and preferably, the power supply 511 may be logically connected to the processor 510 via a power management system, so as to implement functions of managing charging, discharging, and power consumption via the power management system.
In addition, the electronic device 500 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides an electronic device, further including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the above-mentioned method for acquiring an application signature, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the method for acquiring an application signature, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. An application signature acquisition method applied to an electronic device, the method comprising:
acquiring an installation file path of a target application program;
reading an installation file of the target application program based on the installation file path;
and analyzing the installation file of the target application program to obtain signature information of the installation file of the target application program.
2. The method according to claim 1, wherein the parsing the installation file of the target application to obtain signature information of the installation file of the target application comprises:
and calling a file analysis class, and analyzing the installation file of the target application program to obtain signature information of the installation file of the target application program.
3. The method of claim 2, wherein the file parsing class is a package parsing class;
the calling file analysis class is used for analyzing the installation file of the target application program to obtain the signature information of the installation file of the target application program, and the method comprises the following steps:
instantiating the package analysis class by adopting a reflection mechanism to obtain an instantiated package analysis class;
calling a pre-analysis function of the instantiated package analysis class, and pre-analyzing the installation file of the target application program to obtain a package object;
and calling a certificate collection function of the instantiated package analysis class, and analyzing the package object to obtain the signature information.
4. The method of claim 2, wherein the file parsing class is a JAR file parsing class;
the calling file analysis class is used for analyzing the installation file of the target application program to obtain the signature information of the installation file of the target application program, and the method comprises the following steps:
instantiating the JAR file analysis class to obtain an instantiated JAR file analysis class;
calling an input stream reading function of the instantiated JAR file parsing class, and reading an installation file of the target application program as an input stream;
calling a manifest file reading function of the instantiated JAR file analysis class, and reading a manifest file from the input stream;
and acquiring signature information from the manifest file.
5. The method according to claim 1, wherein after parsing the installation file of the application program to obtain signature information of the installation file of the target application program, the method further comprises:
encrypting the signature information to obtain target encryption information;
under the condition that the target encryption information is inconsistent with the first encryption information, exiting the target application program;
running the target application program under the condition that the target encryption information is consistent with the first encryption information;
the first encryption information is encryption information corresponding to correct signature information of the installation file of the target application program.
6. An electronic device, characterized in that the device comprises:
the installation file path acquisition module is used for acquiring an installation file path of the target application program;
the installation file reading module is used for reading the installation file of the target application program based on the installation file path;
and the processing module is used for analyzing the installation file of the target application program to obtain the signature information of the installation file of the target application program.
7. The apparatus of claim 6, wherein the processing module comprises:
and the processing unit is used for calling a file analysis class and analyzing the installation file of the target application program to obtain the signature information of the installation file of the target application program.
8. The apparatus of claim 7, wherein the file parsing class is a package parsing class;
the processing unit includes:
the first instantiation subunit is used for instantiating the package analysis class by adopting a reflection mechanism to obtain an instantiated package analysis class;
the pre-analysis subunit is used for calling a pre-analysis function of the instantiated package analysis class, and pre-analyzing the installation file of the target application program to obtain a package object;
and the first signature information determining subunit is used for calling a certificate collecting function of the instantiated package analysis class, and analyzing the package object to obtain the signature information.
9. The apparatus of claim 7, wherein the file parsing class is a JAR file parsing class;
the processing unit includes:
the second instantiation subunit is used for instantiating the JAR file analysis class to obtain an instantiated JAR file analysis class;
an input stream reading subunit, configured to call an input stream reading function of the instantiated JAR file parsing class, and read the installation file of the target application program as an input stream;
a manifest file reading subunit, configured to call a manifest file reading function of the instantiated JAR file parsing class, and read a manifest file from the input stream;
and the second signature information determining subunit is used for acquiring the signature information from the manifest file.
10. The apparatus of claim 6, further comprising:
the encryption module is used for encrypting the signature information to obtain target encryption information;
the quitting module is used for quitting the target application program under the condition that the target encryption information is inconsistent with the first encryption information;
the running module is used for running the target application program under the condition that the target encryption information is consistent with the first encryption information;
the first encryption information is encryption information corresponding to correct signature information of the installation file of the target application program.
CN202010332412.0A 2020-04-24 2020-04-24 Application signature acquisition method and electronic equipment Pending CN111597515A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010332412.0A CN111597515A (en) 2020-04-24 2020-04-24 Application signature acquisition method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010332412.0A CN111597515A (en) 2020-04-24 2020-04-24 Application signature acquisition method and electronic equipment

Publications (1)

Publication Number Publication Date
CN111597515A true CN111597515A (en) 2020-08-28

Family

ID=72191949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010332412.0A Pending CN111597515A (en) 2020-04-24 2020-04-24 Application signature acquisition method and electronic equipment

Country Status (1)

Country Link
CN (1) CN111597515A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104598824A (en) * 2015-01-28 2015-05-06 国家计算机网络与信息安全管理中心 Method and device for detecting malicious programs
CN107403089A (en) * 2017-07-10 2017-11-28 东软集团股份有限公司 Resource tamper Detection method and apparatus based on application program
CN108197469A (en) * 2017-11-28 2018-06-22 东软集团股份有限公司 The method, apparatus and storage medium and electronic equipment of verification Application program
CN108683502A (en) * 2018-03-30 2018-10-19 上海连尚网络科技有限公司 A kind of digital signature authentication method, medium and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104598824A (en) * 2015-01-28 2015-05-06 国家计算机网络与信息安全管理中心 Method and device for detecting malicious programs
CN107403089A (en) * 2017-07-10 2017-11-28 东软集团股份有限公司 Resource tamper Detection method and apparatus based on application program
CN108197469A (en) * 2017-11-28 2018-06-22 东软集团股份有限公司 The method, apparatus and storage medium and electronic equipment of verification Application program
CN108683502A (en) * 2018-03-30 2018-10-19 上海连尚网络科技有限公司 A kind of digital signature authentication method, medium and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
楼赟程: "Android ***的代码保护技术研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Similar Documents

Publication Publication Date Title
CN109558734B (en) Stack security detection method and device and mobile device
CN106598584B (en) Method, device and system for processing resource file
CN111598573B (en) Equipment fingerprint verification method and device
CN107766747B (en) Method for verifying integrity of application program installation package, mobile terminal and server
CN107506646B (en) Malicious application detection method and device and computer readable storage medium
JP2018537027A (en) Service processing method, device and system
CN109145552B (en) Information encryption method and terminal equipment
CN110457888B (en) Verification code input method and device, electronic equipment and storage medium
CN110224920B (en) Sharing method and terminal equipment
CN109687974B (en) APK verification method and device, mobile terminal and readable storage medium
CN106709282B (en) resource file decryption method and device
WO2014000652A1 (en) Browser plug-in installation method, device and terminal
CN110457935B (en) Permission configuration method and terminal equipment
CN112100655A (en) Data detection method and device, electronic equipment and readable storage medium
WO2018024138A1 (en) Method, device, terminal and computer storage medium for detecting malicious website
CN111597540B (en) Login method of application program, electronic device and readable storage medium
CN110990849A (en) Encryption and decryption method for private data and terminal
CN107302526B (en) System interface calling method, device and computer readable storage medium
CN113238868A (en) Task processing method, device, server, equipment, system and storage medium
CN109639706B (en) Request processing method, server, client, system, electronic device and computer readable storage medium
CN107844318B (en) Upgrading method of operating system, mobile terminal and server
CN116679967B (en) Firmware upgrading method and device for basic input/output system
CN111209031B (en) Data acquisition method, device, terminal equipment and storage medium
CN109558707B (en) Method and device for detecting security level of encryption function and mobile device
CN111159738A (en) Permission configuration method, application login method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200828

RJ01 Rejection of invention patent application after publication