CN106709286A - Method for performing security reinforcement on apk resource package - Google Patents
Method for performing security reinforcement on apk resource package Download PDFInfo
- Publication number
- CN106709286A CN106709286A CN201611085517.0A CN201611085517A CN106709286A CN 106709286 A CN106709286 A CN 106709286A CN 201611085517 A CN201611085517 A CN 201611085517A CN 106709286 A CN106709286 A CN 106709286A
- Authority
- CN
- China
- Prior art keywords
- apk
- java code
- code file
- resources bag
- decompiling
- 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
- 238000000034 method Methods 0.000 title claims abstract description 33
- 230000002787 reinforcement Effects 0.000 title abstract 2
- 230000007547 defect Effects 0.000 claims description 9
- 230000005856 abnormality Effects 0.000 claims description 3
- 230000002159 abnormal effect Effects 0.000 abstract description 2
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 231100001261 hazardous Toxicity 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
- G06F21/12—Protecting executable software
- G06F21/121—Restricting unauthorised execution of programs
- G06F21/125—Restricting unauthorised execution of programs by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
- G06F21/12—Protecting executable software
- G06F21/14—Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/56—Computer malware detection or handling, e.g. anti-virus arrangements
- G06F21/562—Static detection
- G06F21/563—Static detection by source code analysis
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Technology Law (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Virology (AREA)
- Storage Device Security (AREA)
Abstract
The invention provides a method for performing security reinforcement on an apk resource package. The method comprises the steps that the apk resource package is subjected to security scanning, and whether the apk resource package is abnormal or not is judged; the apk resource package is subjected to decompilation through a decompilation tool to obtain a Java code file capable of being assembled; configuration items of the Java code file are modified, malicious configuration items of the Java code file are removed, and encryption setting items of the Java code file are added; and the apk resource package is packaged again, a signature of the apk resource package is updated, and therefore a new apk resource package applicable to different systems is generated. Through the method, the difficulty of maliciously tampering an apk after decompiling the apk can be effectively enhanced.
Description
Technical field
The invention belongs to mobile Internet field, it is related to a kind of security hardening used on the mobile device of Android platform
Method, and relate more specifically to a kind of method that security hardening is carried out to apk resources bag.
Background technology
Existing apk resources bag general security is not strong.Existing decompiling instrument is readily available and uses apk resources
Bag, if be not encrypted to apk resource bags, user will be easy to enter apk programs by the understanding to program circuit
Pirate version, maliciously distort, malicious code injection etc. hazardous act (such as being distorted to user's access right) so that causing secret to be believed
Breath leakage, thus, it is desirable to carry out security hardening to apk resources bag, the difficulty that further increase apk is maliciously distorted after decompiling
Degree.
In addition, can realize entering apk resource bags under different system environment by means of existing strapping tool (increasing income)
Row self-extracting and repack.
The content of the invention
For above-mentioned problems of the prior art, apk resources bag is carried out it is an object of the invention to provide a kind of
The method of security hardening, it can be Java code file to the apk resource bags decompiling for having obtained, then by Java generations
Code file is recompilated to realize some custom features, is finally packed new to generate to apk resource bags again
Apk resource bags.
To achieve these goals, the technical solution adopted by the present invention is as follows:
A kind of method for carrying out security hardening to apk resources bag, comprises the following steps:
Step 1:Security sweep is carried out to apk resources bag, and judges whether apk resources bag sends exception, if it is, method
Terminate, if not, advancing to step 2;
Step 2:Decompiling is carried out to apk resources bag by decompiling instrument, the Java code file that can be collected is obtained;
Step 3:The configuration item of Java code file is changed, the malice configuration item of Java code file is removed, and increased
The encryption settings of Java code file;
Step 4:Again apk resource bags are packed, updates the signature of apk resource bags so as to generate suitable for not homology
New apk resource bags under system.
According to one embodiment of present invention, method further includes to find lacking for decompiling instrument treatment apk resource bags
Fall into and defect is used into Java code file so that apk resource bags send abnormality warnings in Decompilation or compiling is lost
Lose.
According to one embodiment of present invention, method further includes to carry out Java code file secondary encryption to weaken
The compatibility of apk resource bags.
According to one embodiment of present invention, method further include to carry out Java code file source code obscure protection with
Reduce the readability of Java code file.
According to one embodiment of present invention, decompiling instrument is ant instruments or jdk instruments.
According to one embodiment of present invention, malice configuration item includes one or more in following:Third party's service, boundary
Face, broadcast.
According to one embodiment of present invention, system is Windows systems, linux system or Unix system.
According to one embodiment of present invention, the mode of defect is found to read decompiling instrument source code or pressure test.
By above technical scheme, what is be obtained in that has the technical effect that the present invention:Added by carrying out safety to apk resources bag
Admittedly being effective, the superencipherment for Android class libraries can effectively solve the safety problem of Android source codes.By seeking
Decompiling instrument is looked in the defect for the treatment of apk resource bags, and by the Application of defect to apk source codes, decompiling instrument can be allowed
Abnormality warnings or compiling failure are sent when apk resource bags are processed, so as to further improve the security of Android source codes.
As long as being effectively protected APK source codes not to be cracked, can just accomplish the threat that apk system files are not maliciously tampered.
Brief description of the drawings
Fig. 1 is the flow chart of the method that security hardening is carried out to apk resources bag of the invention.
Specific embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, below in conjunction with the accompanying drawings, the present invention is entered
Row is further described.It should be appreciated that specific embodiment described herein is only used to explain the present invention, it is not used to limit
The present invention.
As shown in figure 1, show a kind of flow chart of the method that security hardening is carried out to apk resources bag, method include with
Lower step:After the starting step, first, whether to apk resources bag carry out security sweep inspection judges apk resources bag
By security hardening, if apk resources bag is by security hardening, exception can be sent and terminate methods described;If do not sent
Abnormal alarm, then continue Decompilation.Then, apk resources bag is carried out by the ant instruments or jdk instruments of such as apche
Decompiling, to obtain the Java code file that can be collected.Then, security hardening operation is carried out to Java code file, is changed
The configuration item of Java code file, removes the malice configuration item in Java code file, and increase the encryption of Java code file
Setting option, specifically, the difficulty that Android source code is exposed after apk resources are coated with decompiling is increased by Dex cipher modes, by source
Code obscures statement of the protection to variable in source code carries out escape so that even if also greatly reducing the readable of source code after source code exposure
Property, some resource files after resource file is protected to decompiling under res catalogues carry out secondary encryption, thus cut
Subtract the compatibility of apk, in addition, if configuration file is protected, then will be implanted third party's service, boundary in apk resources bag
The malice configuration item such as face, broadcast, carries out restricted constraint, and remove apk by main protection with file to the configuration item in file
There is the configuration item of insecurity in resource bag.Finally, packaging operation is re-started to the apk resource bags by security hardening,
And the signature of apk resource bags is updated, so as to generate the new apk suitable for operating systems such as Windows, Linux, Unix
Resource bag.Finally, methods described terminates.
In one embodiment, decompiling instrument is found by way of reading decompiling instrument source code or pressure test
Defect during treatment apk resource bags, and during the defect is applied to apk resource bag security hardening, that is to say, that it is logical
Crossing carries out code compilation to Java code file and artificially manufactures exception so that apk resource bags send different in Decompilation
Often warning or compiling false alarm.
In another embodiment, exception is artificially manufactured to apk resources bag to prevent from carrying out decompiling again to apk, so
Afterwards apk resources bag repack and obtain new apk resource bags, new apk resource bags can entered by pressure test
Whether row decompiling judges it can again by decompiling.
Embodiment described above only expresses embodiments of the present invention, and its description is more specific and detailed, but can not
Therefore it is interpreted as the limitation to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art,
Without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to protection model of the invention
Enclose.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.
Claims (9)
1. a kind of method that security hardening is carried out to apk resources bag, it is characterised in that the described method comprises the following steps:
Step 1:Security sweep is carried out to the apk resources bag, and judges whether the apk resources bag sends exception, if it is,
Methods described terminates, if not, advancing to step 2;
Step 2:Decompiling is carried out to the apk resources bag by decompiling instrument, the Java code file that can be collected is obtained;
Step 3:The configuration item of the Java code file is changed, the malice configuration item in the Java code file is removed, and
Increase the encryption settings of the Java code file;
Step 4:Again the apk resources bag is packed, the signature of the apk resources bag is updated, so as to generate be applied to
The new apk resources bag under different system.
2. method according to claim 1, it is characterised in that methods described is further included:Find the decompiling work
The defect is simultaneously applied to the Java code file by the defect of the tool treatment apk resources bag so that the apk resources bag
Abnormality warnings or compiling failure are sent in Decompilation.
3. method according to claim 1, it is characterised in that methods described is further included:To Java code text
Part carries out secondary encryption to weaken the compatibility of the apk resources bag.
4. method according to claim 2, it is characterised in that methods described is further included:To Java code text
Part carries out secondary encryption to weaken the compatibility of the apk resources bag.
5. the method according to claim 3 or 4, it is characterised in that methods described is further included to the Java code
File carries out source code to be obscured protection to reduce the readability of the Java code file.
6. method according to claim 1, it is characterised in that the decompiling instrument is ant instruments or jdk instruments.
7. method according to claim 1, it is characterised in that the malice configuration item includes the one kind or many in following
Kind:Third party's service, interface, broadcast.
8. method according to claim 1, it is characterised in that the system be Windows systems, linux system or
Unix system.
9. method according to claim 2, it is characterised in that find the mode of the defect to read decompiling instrument source
Code or pressure test.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611085517.0A CN106709286A (en) | 2016-11-30 | 2016-11-30 | Method for performing security reinforcement on apk resource package |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611085517.0A CN106709286A (en) | 2016-11-30 | 2016-11-30 | Method for performing security reinforcement on apk resource package |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106709286A true CN106709286A (en) | 2017-05-24 |
Family
ID=58935271
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611085517.0A Pending CN106709286A (en) | 2016-11-30 | 2016-11-30 | Method for performing security reinforcement on apk resource package |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106709286A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107479939A (en) * | 2017-09-29 | 2017-12-15 | 厦门天锐科技股份有限公司 | A kind of APK installation kits repeat the implementation method of packing |
CN108399319A (en) * | 2017-09-30 | 2018-08-14 | 平安科技(深圳)有限公司 | Source code guard method, application server and computer readable storage medium |
CN109117175A (en) * | 2018-07-31 | 2019-01-01 | 成都华栖云科技有限公司 | One kind being based on the quick package desktop end packaging method of APK decompiling and strapping tool |
CN109858203A (en) * | 2018-12-21 | 2019-06-07 | 厦门市美亚柏科信息股份有限公司 | A kind of safety protecting method, device and the storage medium of Android platform application |
CN110765424A (en) * | 2019-10-22 | 2020-02-07 | 福州汇思博信息技术有限公司 | Android application reinforcement method and computer equipment |
CN111198690A (en) * | 2018-11-16 | 2020-05-26 | 北京奇虎科技有限公司 | Modification method and device for installation package |
CN111752600A (en) * | 2020-06-30 | 2020-10-09 | 深圳壹账通智能科技有限公司 | Code anomaly detection method and device, computer equipment and storage medium |
CN111914225A (en) * | 2020-07-15 | 2020-11-10 | 广东电网有限责任公司 | Source code protection system and source code encryption method |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103902858A (en) * | 2013-12-25 | 2014-07-02 | 武汉安天信息技术有限责任公司 | APK application reinforcing method and system |
CN104063660A (en) * | 2013-03-20 | 2014-09-24 | 腾讯科技(深圳)有限公司 | Virus scanning method and device as well as terminal |
CN104462959A (en) * | 2014-12-04 | 2015-03-25 | 北京奇虎科技有限公司 | Reinforcement protection method, sever and system for android app |
CN105046113A (en) * | 2015-06-10 | 2015-11-11 | 国家计算机网络与信息安全管理中心 | Randomness test-based Android software reinforcement detection method |
CN105335151A (en) * | 2014-08-14 | 2016-02-17 | 优视科技有限公司 | Installation file protection method and apparatus |
CN105426708A (en) * | 2016-01-19 | 2016-03-23 | 北京鼎源科技有限公司 | Reinforcing method of application program of Android system |
CN105608393A (en) * | 2016-01-19 | 2016-05-25 | 北京鼎源科技有限公司 | Reinforcement method of executable file reorganization on basis of Android |
-
2016
- 2016-11-30 CN CN201611085517.0A patent/CN106709286A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104063660A (en) * | 2013-03-20 | 2014-09-24 | 腾讯科技(深圳)有限公司 | Virus scanning method and device as well as terminal |
CN103902858A (en) * | 2013-12-25 | 2014-07-02 | 武汉安天信息技术有限责任公司 | APK application reinforcing method and system |
CN105335151A (en) * | 2014-08-14 | 2016-02-17 | 优视科技有限公司 | Installation file protection method and apparatus |
CN104462959A (en) * | 2014-12-04 | 2015-03-25 | 北京奇虎科技有限公司 | Reinforcement protection method, sever and system for android app |
CN105046113A (en) * | 2015-06-10 | 2015-11-11 | 国家计算机网络与信息安全管理中心 | Randomness test-based Android software reinforcement detection method |
CN105426708A (en) * | 2016-01-19 | 2016-03-23 | 北京鼎源科技有限公司 | Reinforcing method of application program of Android system |
CN105608393A (en) * | 2016-01-19 | 2016-05-25 | 北京鼎源科技有限公司 | Reinforcement method of executable file reorganization on basis of Android |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107479939A (en) * | 2017-09-29 | 2017-12-15 | 厦门天锐科技股份有限公司 | A kind of APK installation kits repeat the implementation method of packing |
CN108399319A (en) * | 2017-09-30 | 2018-08-14 | 平安科技(深圳)有限公司 | Source code guard method, application server and computer readable storage medium |
CN108399319B (en) * | 2017-09-30 | 2021-07-16 | 平安科技(深圳)有限公司 | Source code protection method, application server and computer readable storage medium |
CN109117175A (en) * | 2018-07-31 | 2019-01-01 | 成都华栖云科技有限公司 | One kind being based on the quick package desktop end packaging method of APK decompiling and strapping tool |
CN109117175B (en) * | 2018-07-31 | 2022-01-28 | 成都华栖云科技有限公司 | APK decompilation-based desktop end packaging method and packaging tool for fast packaging |
CN111198690A (en) * | 2018-11-16 | 2020-05-26 | 北京奇虎科技有限公司 | Modification method and device for installation package |
CN109858203A (en) * | 2018-12-21 | 2019-06-07 | 厦门市美亚柏科信息股份有限公司 | A kind of safety protecting method, device and the storage medium of Android platform application |
CN110765424A (en) * | 2019-10-22 | 2020-02-07 | 福州汇思博信息技术有限公司 | Android application reinforcement method and computer equipment |
CN111752600A (en) * | 2020-06-30 | 2020-10-09 | 深圳壹账通智能科技有限公司 | Code anomaly detection method and device, computer equipment and storage medium |
CN111914225A (en) * | 2020-07-15 | 2020-11-10 | 广东电网有限责任公司 | Source code protection system and source code encryption method |
CN111914225B (en) * | 2020-07-15 | 2024-03-19 | 广东电网有限责任公司 | Source code protection system and source code encryption method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106709286A (en) | Method for performing security reinforcement on apk resource package | |
Ma et al. | Cdrep: Automatic repair of cryptographic misuses in android applications | |
CN102576391B (en) | Software license embedded in shell code | |
KR101350390B1 (en) | A apparatus for code obfuscation and method thereof | |
CN102087605B (en) | Android-based platform application installation control method and system | |
CN104239757B (en) | Application program reversing-preventing method and device and operation method and terminal | |
CN105205358B (en) | The method and detection method that a kind of identification Android APP are reinforced | |
Younan et al. | Runtime countermeasures for code injection attacks against C and C++ programs | |
CN104318135B (en) | A kind of Java code Safety actuality loading method based on credible performing environment | |
US20160197950A1 (en) | Detection system and method for statically detecting applications | |
TW201721497A (en) | Systems and methods for detection of malicious code in runtime generated code | |
CN106778100B (en) | Obfuscation compiling method and obfuscation compiler based on android platform and IOS platform | |
CN104680061A (en) | Method and system for verifying code signing during startup of application in Android environment | |
Jain et al. | Enriching reverse engineering through visual exploration of Android binaries | |
CN107609394A (en) | Tamper resistant method, storage device and the device of Android installation kits | |
Rawat et al. | Safe guard anomalies against SQL injection attacks | |
CN111191195A (en) | Method and device for protecting APK | |
CN109858203A (en) | A kind of safety protecting method, device and the storage medium of Android platform application | |
CN106656513A (en) | Secondary packaging signature verification method for APK files on Android platform | |
CN102609284A (en) | Method for safely loading executable file | |
Lim et al. | Structural analysis of packing schemes for extracting hidden codes in mobile malware | |
CN107220529A (en) | A kind of reinforcement means for Android platform SDK bags | |
Suk et al. | UnThemida: Commercial obfuscation technique analysis with a fully obfuscated program | |
Bernardinetti et al. | Pezong: Advanced packer for automated evasion on windows | |
CN107766061A (en) | The installation method and installation system of a kind of Android application program |
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: 20170524 |
|
RJ01 | Rejection of invention patent application after publication |