WO2016188134A1 - 一种实现应用加固的方法及装置 - Google Patents

一种实现应用加固的方法及装置 Download PDF

Info

Publication number
WO2016188134A1
WO2016188134A1 PCT/CN2016/071604 CN2016071604W WO2016188134A1 WO 2016188134 A1 WO2016188134 A1 WO 2016188134A1 CN 2016071604 W CN2016071604 W CN 2016071604W WO 2016188134 A1 WO2016188134 A1 WO 2016188134A1
Authority
WO
WIPO (PCT)
Prior art keywords
installation package
package file
partial data
file
server
Prior art date
Application number
PCT/CN2016/071604
Other languages
English (en)
French (fr)
Inventor
陈华
卫伟
张家明
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016188134A1 publication Critical patent/WO2016188134A1/zh

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/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption

Definitions

  • This document relates to, but is not limited to, the field of application security, and in particular to a method and apparatus for implementing application reinforcement.
  • the number of terminal applications is rapidly expanding, and users are conducting more and more daily transactions through terminal applications.
  • the security of terminal applications has become a technical issue that both developers and users pay attention to.
  • the technician processes the terminal application, which includes reinforcement of the installation package.
  • the Android platform is one of the most popular operating systems for mobile terminals.
  • the Android platform attracts many developers with openness and wins a large number of users with freeness.
  • More and more Android applications are being used to handle daily tasks such as sending and receiving mail, electronic payments, and social communications. Android applications inevitably need to access and store the user's account, password and other data in the process of use, and thus become the target of malware attacks.
  • the developer has reinforced the Android installation package (APK), and the security of the Android application can be improved through the reinforcement process.
  • the commonly used reinforcement methods are: pseudo encryption, compression package destruction, code obfuscation, signature Verification, etc.
  • Pseudo-encryption is the pseudo-encryption of APK compressed files by java code. Compressed package destruction by adding other data at the end of the APK flag, because the Android system recognizes the APK as a compressed file, from the logo of the APK to the end of the logo, if you add at the end of the APK For other data, the APK will be judged as corrupted. When the APK destroyed by the compressed package is decompressed, viewed, or decompiled, the file will be damaged. The compressed package is similar to the pseudo encryption, but the tail is marked. Adding an APK with other data will not affect its normal operation and installation on the Android system.
  • Code confusion is mainly to interfere with the analysis of the reverse staff, to increase the difficulty of the cracker's analysis of the software, to achieve the effect of confusing audiovisual.
  • the confusing code is disassembled or decompiled, the cross-reference between programs will be extremely complicated.
  • Signature verification is achieved by binding to the APK to achieve APK hardening.
  • the signature verification is modified due to the system introduced after Android 4.2.
  • the confusing code is disassembled or decompiled, it may conflict with reflection, and the code obfuscation method only increases the difficulty of cracking, and can not really prevent reverse engineering, and can not achieve real protection purposes.
  • Signature verification exists. After the APK is decompiled, the signature will disappear automatically, and the APK protection will also fail.
  • the existing application reinforcement methods still have security problems, which affect the security and development of applications of mobile terminals.
  • the embodiment of the invention provides a method and a device for implementing application reinforcement, which can strengthen an application and improve application security.
  • An embodiment of the present invention provides a method for implementing application reinforcement, including:
  • the server performs a compression package destruction process on the first installation package file of the application to obtain a second installation package file.
  • the server packs the second installation package file to obtain a third installation package file to reinforce the application.
  • the method further includes:
  • the server extracts part of the data from the third installation package file to obtain a fourth installation package file, and encrypts the extracted partial data;
  • the server adds the encrypted partial data to the end of the fourth installation package file to obtain a fifth installation package file.
  • the partial data includes: any executable instructions and/or dynamic link tables and/or segment information and/or section information in the third installation package file.
  • the method further includes:
  • the server records the first location of the portion of data in the third installation package file.
  • the method further includes:
  • the server adds the first location to the preset location in the extracted partial data.
  • the server encrypts the extracted partial data, including: encrypting part of the data after adding the first location.
  • the method further includes:
  • the server records the second location of the encrypted partial data in the fifth installation package file.
  • the server encrypts the extracted partial data, specifically:
  • the server encrypts the extracted partial data by the message digest algorithm fifth version MD5.
  • the first installation package file is an Android installation package APK file.
  • the method further includes:
  • the terminal restores the fifth installation package file to the third installation package file according to the encrypted partial data in the fifth installation package file.
  • the terminal performs a shelling process on the third installation package file to obtain a second installation package file, and performs the APK installation on the second installation package file.
  • the recovering, by the terminal, the fifth installation package file to the third installation package file according to the encrypted partial data in the fifth installation package file includes:
  • the terminal extracts the encrypted partial data from the fifth installation package file according to the second position of the record to obtain a fourth installation package file; decrypts the extracted encrypted partial data to obtain partial data and the first location, and decrypts the obtained portion.
  • the data is restored to the first location of the fourth installation package file to obtain the third installation package file.
  • Embodiments of the present invention also provide a computer readable storage medium storing computer executable instructions for performing any of the methods described above.
  • an embodiment of the present invention further provides an apparatus for implementing application reinforcement, including a preprocessing unit and a reinforcement unit, where
  • the pre-processing unit is configured to perform compression packet destruction processing on the first installation package file of the application. Second installation package file;
  • the reinforcement unit is configured to pack the second installation package file to obtain a third installation package file to reinforce the application.
  • the device further includes: an extraction processing unit, configured to extract part of the data from the third installation package file to obtain a fourth installation package file, and encrypt the extracted partial data;
  • the apparatus further comprises: a recording unit configured to record the first location of the partial data in the second installation package file.
  • the apparatus further comprises: an adding processing unit configured to add the first location to the preset location in the extracted partial data.
  • the recording unit is further configured to record the second location of the encrypted partial data in the fourth installation package file.
  • the technical solution of the present application includes: performing a compression package destruction process on the first installation package file to obtain a second installation package file, and performing a third installation package file on the second installation package file to obtain an application.
  • Reinforce The method of the embodiment of the present invention adds a shell to the second installation package file, thereby avoiding the problem that the second installation package file is repaired by the compressed file repair tool and the reinforcement protection disappears; by packing the second installation package file, After the shell code in the third installation package file is jumped to the original entry of the installation package, the data of the protected installation package is exposed in the memory, which implements application hardening and improves the security of the installation package file. Sex.
  • FIG. 1 is a flowchart of a method for implementing application reinforcement according to an embodiment of the present invention
  • FIG. 2 is a structural block diagram of an apparatus for implementing application reinforcement according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for implementing application reinforcement according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
  • Step 100 The server performs a compression package destruction process on the first installation package file of the application to obtain a second installation package file, and adds a second installation package file to the second installation package file to reinforce the application.
  • the first installation package file may be an APK file.
  • how to perform the compression packet destruction process on the first installation package file to obtain the second installation package file may be implemented by using a well-known technology of the present invention, and is not intended to limit the scope of protection of the present invention, and details are not described herein again.
  • the second installation package file is packed including:
  • the entry point of the installation file that is, the first instruction executed by the installation package points to the shell code, and the software that has been processed by the shelling first enters the shell code at runtime, and the third installation package file is in the shell code. Restore and then execute the shell code in the third installation package file to jump to the original entry of the second installation package file.
  • the volume of the second installation package file can be reduced, which is convenient for transmission and improves the execution efficiency.
  • the method further includes:
  • Step 101 The server extracts part of the data from the third installation package file to obtain a fourth installation package file, and encrypts the extracted partial data.
  • part of the data includes: any executable instructions and/or dynamic link tables and/or segment information and/or section information in the third installation package file.
  • encrypting the extracted partial data includes:
  • the method when extracting part of the data, the method further includes:
  • the first position of the partial data in the third installation package file is recorded to obtain the extracted location information.
  • the method before encrypting the extracted partial data, the method further includes:
  • the first location of the partial data in the third installation package file is added to the preset location in the extracted partial data.
  • the preset position may be the head or the tail of the partial data, and may of course be other positions of the partial data.
  • Step 102 The server adds the encrypted partial data to the end of the fourth installation package file to obtain a fifth installation package file.
  • the method further includes:
  • the server records the encrypted partial data in the second position of the fifth installation package file.
  • the method further includes:
  • the terminal restores the fifth installation package file to the third installation package file according to the encrypted partial data in the fifth installation package file;
  • the terminal performs shelling on the third installation package file to obtain a second installation package file, and installs the second installation package file into the APK.
  • the terminal restores the fifth installation package file to the third installation package file according to the encrypted partial data in the fifth installation package file, including:
  • the terminal extracts the encrypted partial data from the fifth installation package file according to the second position of the record to obtain a fourth installation package file; decrypts the extracted encrypted partial data to obtain partial data and the first location, and decrypts the obtained portion.
  • the data is restored to the first location of the fourth installation package file to obtain the third installation package file.
  • the terminal performs shelling on the third installation package file to obtain a second installation package file, including:
  • the terminal executes the shell code in the third installation package file to jump to the original entry of the second installation package file.
  • the embodiment of the present invention adds a shell to the second installation package file, thereby avoiding the disappearance of the reinforcement protection caused by the second installation package file being repaired by the compressed file repair tool; by performing the shelling on the second installation package file, the execution is avoided.
  • the shell code in the third installation package file jumps to the original entry of the installation package, the data of the protected installation package is exposed in the memory, which implements application hardening and improves the security of the installation package file.
  • Embodiments of the present invention also provide a computer readable storage medium storing computer executable instructions for performing any of the methods described above.
  • FIG. 2 is a structural block diagram of an apparatus for implementing application reinforcement according to an embodiment of the present invention. As shown in FIG. 2, the method includes a pre-processing unit and a reinforcement unit, where
  • a pre-processing unit configured to perform a compression package destruction process on the first installation package file of the application to obtain a second installation package file
  • the reinforcement unit is configured to pack the second installation package file to obtain a third installation package file to reinforce the application.
  • the apparatus of the embodiment of the present invention further includes an extraction processing unit configured to extract part of the data from the third installation package file to obtain a fourth installation package file, and encrypt the extracted partial data;
  • the apparatus of the embodiment of the present invention further includes a recording unit configured to record the first location of the partial data in the second installation package file.
  • the recording unit is further configured to record the second location of the encrypted partial data in the fourth installation package file.
  • the apparatus of the embodiment of the present invention further includes an adding processing unit configured to add the first location to the preset location in the extracted partial data.
  • each module/unit in the above embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program stored in the memory by a processor. / instruction to achieve its corresponding function.
  • the invention is not limited to any specific form of combination of hardware and software.
  • the method of the embodiment of the present invention avoids the problem that the reinforcement protection of the second installation package file is repaired by the compressed file repair tool, and avoids the problem that the shell code in the third installation package file jumps to the original installation package. After the entry, the data of the protected installation package is exposed in the memory, which implements the reinforcement of the application and improves the security of the installation package file.
  • the protection of the installation package file is increased, and the security of the installation package file is further improved.

Abstract

本文公布了一种实现应用加固的方法及装置,包括:对经压缩包破坏处理的第一安装包文件进行加壳,生成第二安装包文件,以对应用进行加固。

Description

一种实现应用加固的方法及装置 技术领域
本文涉及但不限于应用安全领域,尤指一种实现应用加固的方法及装置。
背景技术
随着智能终端的发展,终端应用的数量得到快速的膨胀,用户通过终端应用进行越来越多的日常事务处理,终端应用的安全成为开发者和用户都关注的技术问题。为了提高终端应用的安全,技术人员对终端应用进行处理,其中,包含对安装包的加固。以安卓(Android)平台为例,安卓系统是移动终端普及最广的操作系统之一,Android平台以开放性吸引众多开发者、以免费性赢得大量的用户。越来越多的Android应用被人们用来处理如收发邮件、电子支付、社交通信等日常事务。Android应用在使用过程中不可避免的需要访问和存储用户的账号、密码等数据,因而成为恶意软件的攻击对象。随着Android应用范围的增大,威胁范围越来越广,威胁程度也在加深。为了提高Android应用的安全性,开发人员对Android安装包(APK)进行了加固处理,通过加固处理,可以提高Android应用的安全,常用的加固方法有:伪加密、压缩包破坏、代码混淆、签名验证等。
伪加密是通过java代码对APK压缩文件进行伪加密。压缩包破坏则通过在APK的标志尾添加其他数据,由于Android系统对APK的识别是将APK当作压缩文件,从APK的标志头到标志尾的逻辑进行识别的,如果在APK的标志尾添加其他数据,则APK会被判断为已被破坏,在对经过压缩包破坏的APK进行解压、查看或用反编译处理时,均会提示文件已损坏,压缩包破坏与伪加密类似,但标志尾添加其他数据的APK不会影响其在Android系统的正常运行和安装。代码混淆主要是干扰逆向工作人员的分析,加大破解者对软件的分析难度,达到混淆视听的效果,经过混淆后的代码在反汇编或者反编译后,会出现程序间交叉引用异常复杂,从而达到加固APK的目的。签名验证通过与APK绑定,实现APK的加固。
上述加固方法中,由于在Android4.2之后推出的系统,修改了签名验证 的方式导致无法安装伪加密的APK;通过采用压缩文件修复工具,会将APK中采用压缩包破坏方法添加到标志尾的其他数据进行修复,使APK加固保护消失。经过混淆后的代码在反汇编或者反编译后,有可能与反射发生冲突,且代码混淆方法只是增大破解难度,并不能真正阻止反向工程,无法达到真正的保护目的。签名验证存在APK被反编译后签名会自动消失,APK保护也会同时失效。综上,现有的应用加固方法,仍存在安全问题,影响移动终端的应用的安全和发展。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本发明实施例提供一种实现应用加固的方法及装置,能够加固应用,提高应用安全。
本发明实施例提供了一种实现应用加固的方法,包括:
服务器对应用的第一安装包文件进行压缩包破坏处理得到第二安装包文件;
服务器对第二安装包文件进行加壳得到第三安装包文件,以对应用进行加固。
可选地,服务器对第二安装包文件进行加壳得到第三安装包文件之后,该方法还包括:
服务器从所述第三安装包文件中提取出部分数据得到第四安装包文件并对提取出的部分数据进行加密;
服务器将加密后的部分数据添加到所述第四安装包文件的尾部得到第五安装包文件。
可选地,部分数据包括:所述第三安装包文件中任意的可执行指令和/或动态链接表和/或段信息和/或节信息。
可选地,服务器提取出部分数据时,该方法还包括:
服务器记录所述部分数据在所述第三安装包文件中的第一位置。
可选地,服务器对提取出的部分数据进行加密之前,该方法还包括:
服务器将第一位置添加到所述提取出的部分数据中的预设位置。
服务器对提取出的部分数据进行加密包括:对添加第一位置后的部分数据进行加密。
可选地,服务器将加密后的部分数据添加到所述第四安装包文件的尾部时,该方法还包括:
服务器记录所述加密后的部分数据在第五安装包文件中的第二位置。
可选地,服务器对提取出的部分数据进行加密具体包括:
服务器对所述提取出的部分数据通过消息摘要算法第五版MD5进行加密。
可选地,第一安装包文件为安卓安装包APK文件。
可选地,终端在对第五安装包文件进行安装时,该方法还包括:
终端根据第五安装包文件中的所述加密后的部分数据将第五安装包文件还原为所述第三安装包文件;
终端对第三安装包文件进行去壳处理得到第二安装包文件,将所述第二安装包文件进行APK安装。
可选地,终端根据第五安装包文件中的加密后的部分数据将第五安装包文件还原为第三安装包文件具体包括:
终端根据记录的第二位置从第五安装包文件中提取加密后的部分数据得到第四安装包文件;对提取的加密后的部分数据进行解密得到部分数据和第一位置,将解密得到的部分数据还原到第四安装包文件的第一位置得到第三安装包文件。
本发明实施例还提出了一种计算机可读存储介质,存储有计算机可执行指令,计算机可执行指令用于执行上述描述的任意一个方法。
另一方面,本发明实施例还提供一种实现应用加固的装置,包括预处理单元和加固单元,其中,
预处理单元,设置为对应用的第一安装包文件进行压缩包破坏处理得到 第二安装包文件;
加固单元,设置为对第二安装包文件进行加壳得到第三安装包文件,以对应用进行加固。
可选地,该装置还包括:提取处理单元,设置为从所述第三安装包文件中提取出部分数据得到第四安装包文件并对提取出的部分数据进行加密;
将加密后的部分数据添加到所述第四安装包文件的尾部得到第五安装包文件。
可选地,该装置还包括:记录单元,设置为记录部分数据在所述第二安装包文件中的第一位置。
可选地,该装置还包括:添加处理单元,设置为将第一位置添加到所述提取出的部分数据中的预设位置。
可选地,所述记录单元还设置为,记录所述加密后的部分数据在第四安装包文件中的第二位置。
与现有技术相比,本申请技术方案包括:对第一安装包文件进行压缩包破坏处理得到第二安装包文件,对第二安装包文件进行加壳得到第三安装包文件,以对应用进行加固。本发明实施例的方法对第二安装包文件进行加壳,避免了第二安装包文件被压缩文件修复工具修复而的导致的加固保护消失的问题;通过对第二安装包文件进行加壳,避免了在执行完第三安装包文件中的壳代码跳转到安装包的原始入口后,被保护的安装包的数据都暴露在内存中,实现了应用的加固,提高了安装包文件的安全性。
可选地,通过从第三安装包文件中提取出部分数据并对提取出的部分数据进行加密,放置于第三安装包文件的尾部的处理,加大了安装包文件的保护力度,进一步提高了安装包文件的安全性。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1为本发明实施例实现应用加固的方法的流程图;
图2为本发明实施例实现应用加固的装置的结构框图。
本发明的实施方式
下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
图1为本发明实施例实现应用加固的方法的流程图,如图1所示,包括:
步骤100、服务器对应用的第一安装包文件进行压缩包破坏处理得到第二安装包文件,对第二安装包文件进行加壳得到第三安装包文件,以对应用进行加固。
本步骤中,第一安装包文件可以是APK文件。
本步骤中,具体如何对第一安装包文件进行压缩包破坏处理得到第二安装包文件可以采用本领域技术人员的公知技术实现,并不用于限定本发明的保护范围,在此不再赘述。
本步骤中,对第二安装包文件进行加壳包括:
在第二安装包文件中插入一段代码(即壳代码)。
在安装过程中,安装文件的入口点即安装包执行的第一条指令指向壳代码,经过加壳处理的软件在运行时会首先进入到壳代码中,在壳代码中把第三安装包文件还原,然后再执行第三安装包文件中的壳代码跳转到第二安装包文件的原始入口。
通过加壳可以减小第二安装包文件体积,便于传输,提高执行效率。
可选地,服务器对第二安装包文件进行加壳得到第三安装包文件之后,该方法还包括:
步骤101、服务器从第三安装包文件中提取出部分数据得到第四安装包文件并对提取出的部分数据进行加密。
本步骤中,部分数据包括:第三安装包文件中任意的可执行指令和/或动态链接表和/或段信息和/或节信息。
本步骤中,对提取出的部分数据进行加密包括:
对提取出的部分数据通过消息摘要算法第五版(MD5,Message Digest  Algorithm 5)进行加密。
可选地,提取出部分数据时,该方法还包括:
记录部分数据在第三安装包文件中的第一位置,以获得提取位置信息。
可选地,对提取出的部分数据进行加密之前,该方法还包括:
将部分数据在第三安装包文件中的第一位置添加到提取出的部分数据中的预设位置。
其中,预设位置可以是部分数据的头部或尾部,当然,也可以是部分数据的其他位置。
步骤102、服务器将加密后的部分数据添加到第四安装包文件的尾部得到第五安装包文件。
可选地,服务器将加密后的部分数据添加到第四安装包文件的尾部得到第五安装包文件时,该方法还包括:
服务器记录加密后的部分数据在第五安装包文件的第二位置。
可选地,终端在对第五安装包文件进行安装时,该方法还包括:
终端根据第五安装包文件中的加密后的部分数据将第五安装包文件还原为第三安装包文件;
终端对第三安装包文件进行去壳处理得到第二安装包文件,将第二安装包文件进行APK安装。
其中,终端根据第五安装包文件中的加密后的部分数据将第五安装包文件还原为第三安装包文件包括:
终端根据记录的第二位置从第五安装包文件中提取加密后的部分数据得到第四安装包文件;对提取的加密后的部分数据进行解密得到部分数据和第一位置,将解密得到的部分数据还原到第四安装包文件的第一位置得到第三安装包文件。
其中,终端对第三安装包文件进行去壳处理得到第二安装包文件包括:
终端执行第三安装包文件中的壳代码跳转到第二安装包文件的原始入口。
本发明实施例对第二安装包文件进行加壳,避免了第二安装包文件被压缩文件修复工具修复而导致的加固保护的消失;通过对第二安装包文件进行加壳,避免了在执行完第三安装包文件中的壳代码跳转到安装包的原始入口后,被保护安装包的数据都暴露在内存中,实现了应用的加固,提高了安装包文件的安全性。
可选地,通过从第三安装包文件中提取出部分数据并对提取出的部分数据进行加密,放置于第三安装包文件的尾部的处理,加大了安装包文件的保护力度,进一步提高了安装包文件的安全性。
本发明实施例还提出了一种计算机可读存储介质,存储有计算机可执行指令,计算机可执行指令用于执行上述描述的任意一个方法。
图2为本发明实施例实现应用加固的装置的结构框图,如图2所示,包括预处理单元和加固单元,其中,
预处理单元,设置为对应用的第一安装包文件进行压缩包破坏处理得到第二安装包文件;
加固单元,设置为对第二安装包文件进行加壳得到第三安装包文件,以对应用进行加固。
本发明实施例的装置还包括提取处理单元,设置为从第三安装包文件中提取出部分数据得到第四安装包文件并对提取出的部分数据进行加密;
将加密后的部分数据添加到第四安装包文件的尾部得到第五安装包文件。
本发明实施例的装置还包括记录单元,设置为记录部分数据在第二安装包文件中的第一位置。
记录单元还设置为,记录所述加密后的部分数据在第四安装包文件中的第二位置。
本发明实施例的装置还包括添加处理单元,设置为将第一位置添加到提取出的部分数据中的预设位置。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本发明不限于任何特定形式的硬件和软件的结合。
虽然本发明所揭露的实施方式如上,但所述的内容仅为便于理解本发明而采用的实施方式,并非用以限定本发明。任何本发明所属领域内的技术人员,在不脱离本发明所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明的专利保护范围,仍须以所附的权利要求书所界定的范围为准。
工业实用性
本发明实施例的方法避免了第二安装包文件被压缩文件修复工具修复而的导致的加固保护消失的问题;避免了在执行完第三安装包文件中的壳代码跳转到安装包的原始入口后,被保护的安装包的数据都暴露在内存中,实现了应用的加固,提高了安装包文件的安全性。
可选地,加大了安装包文件的保护力度,进一步提高了安装包文件的安全性。

Claims (16)

  1. 一种实现应用加固的方法,包括:
    服务器对应用的第一安装包文件进行压缩包破坏处理得到第二安装包文件,对第二安装包文件进行加壳得到第三安装包文件,以对应用进行加固。
  2. 根据权利要求1所述的方法,该方法还包括:所述服务器对第二安装包文件进行加壳得到第三安装包文件之后,
    服务器从所述第三安装包文件中提取出部分数据得到第四安装包文件并对提取出的部分数据进行加密;
    服务器将加密后的部分数据添加到所述第四安装包文件的尾部得到第五安装包文件。
  3. 根据权利要求2所述的方法,其中,所述部分数据包括:所述第三安装包文件中任意的可执行指令和/或动态链接表和/或段信息和/或节信息。
  4. 根据权利要求2所述的方法,该方法还包括:所述服务器提取出部分数据时,记录所述部分数据在所述第三安装包文件中的第一位置。
  5. 根据权利要求4所述的方法,该方法还包括:所述服务器对提取出的部分数据进行加密之前,将所述第一位置添加到所述提取出的部分数据中的预设位置;
    所述服务器对提取出的部分数据进行加密包括:
    所述服务器对添加所述第一位置后的部分数据进行加密。
  6. 根据权利要求5所述的方法,该方法还包括:所述服务器将加密后的部分数据添加到所述第四安装包文件的尾部时,记录所述加密后的部分数据在所述第五安装包文件中的第二位置。
  7. 根据权利要求2~6任一项所述的方法,其中,所述服务器对提取出的部分数据进行加密包括:
    所述服务器对所述提取出的部分数据通过消息摘要算法第五版MD5进行加密。
  8. 根据权利要求1~6任意一项所述的方法,其中,所述第一安装包文 件包括安卓安装包APK文件。
  9. 根据权利要求2~6任意一项所述的方法,该方法还包括:终端在对所述第五安装包文件进行安装时,根据所述第五安装包文件中的所述加密后的部分数据将所述第五安装包文件还原为所述第三安装包文件;
    终端对第三安装包文件进行去壳处理得到所述第二安装包文件,将所述第二安装包文件进行APK安装。
  10. 根据权利要求9所述的方法,其中,所述终端根据第五安装包文件中的加密后的部分数据将第五安装包文件还原为第三安装包文件包括:
    所述终端根据记录的第二位置从所述第五安装包文件中提取加密后的部分数据得到所述第四安装包文件;
    所述终端对提取的加密后的部分数据进行解密得到所述部分数据和所述第一位置;
    所述终端将解密得到的部分数据还原到第四安装包文件的第一位置得到第三安装包文件。
  11. 一种实现应用加固的装置,包括预处理单元和加固单元,其中,
    预处理单元,设置为对应用的第一安装包文件进行压缩包破坏处理得到第二安装包文件;
    加固单元,设置为对第二安装包文件进行加壳得到第三安装包文件,以对应用进行加固。
  12. 根据权利要求11所述的装置,该装置还包括提取处理单元,设置为从所述第三安装包文件中提取出部分数据得到第四安装包文件并对提取出的部分数据进行加密;
    将加密后的部分数据添加到所述第四安装包文件的尾部得到第五安装包文件。
  13. 根据权利要求12所述的装置,该装置还包括记录单元,设置为记录所述部分数据在所述第二安装包文件中的第一位置。
  14. 根据权利要求13所述的装置,还包括添加处理单元,设置为将所 述第一位置添加到所述提取出的部分数据中的预设位置。
  15. 根据权利要求12所述的装置,所述记录单元还设置为,记录所述加密后的部分数据在所述第四安装包文件中的第二位置。
  16. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1~10任意一项所述的方法。
PCT/CN2016/071604 2015-05-22 2016-01-21 一种实现应用加固的方法及装置 WO2016188134A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510268570.3A CN106295263A (zh) 2015-05-22 2015-05-22 一种实现应用加固的方法及装置
CN201510268570.3 2015-05-22

Publications (1)

Publication Number Publication Date
WO2016188134A1 true WO2016188134A1 (zh) 2016-12-01

Family

ID=57393777

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/071604 WO2016188134A1 (zh) 2015-05-22 2016-01-21 一种实现应用加固的方法及装置

Country Status (2)

Country Link
CN (1) CN106295263A (zh)
WO (1) WO2016188134A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948819A (zh) * 2019-12-10 2021-06-11 中国电信股份有限公司 应用文件脱壳方法和装置、计算机可读存储介质
WO2023045744A1 (zh) * 2021-09-23 2023-03-30 中兴通讯股份有限公司 加固方法、注册方法、运行方法、电子设备和存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016265A (zh) * 2017-04-12 2017-08-04 金陵科技学院 一种基于加密与控制流混淆的代码安全防护能力测评方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902908A (zh) * 2013-12-25 2014-07-02 武汉安天信息技术有限责任公司 一种对Android加固应用的恶意代码检测方法及系统
CN104217140A (zh) * 2014-08-29 2014-12-17 北京奇虎科技有限公司 一种应用程序的加固方法和装置
CN104462959A (zh) * 2014-12-04 2015-03-25 北京奇虎科技有限公司 一种安卓应用的加固保护方法、服务器和系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102087605B (zh) * 2011-01-28 2014-05-07 宇龙计算机通信科技(深圳)有限公司 一种基于android平台应用安装控制方法及系统
CN103886230A (zh) * 2014-02-24 2014-06-25 四川长虹电器股份有限公司 android系统的软件版权保护方法及其系统
CN104484585A (zh) * 2014-11-26 2015-04-01 北京奇虎科技有限公司 一种应用程序安装包的处理方法、装置及移动设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902908A (zh) * 2013-12-25 2014-07-02 武汉安天信息技术有限责任公司 一种对Android加固应用的恶意代码检测方法及系统
CN104217140A (zh) * 2014-08-29 2014-12-17 北京奇虎科技有限公司 一种应用程序的加固方法和装置
CN104462959A (zh) * 2014-12-04 2015-03-25 北京奇虎科技有限公司 一种安卓应用的加固保护方法、服务器和系统

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948819A (zh) * 2019-12-10 2021-06-11 中国电信股份有限公司 应用文件脱壳方法和装置、计算机可读存储介质
CN112948819B (zh) * 2019-12-10 2024-01-26 中国电信股份有限公司 应用文件脱壳方法和装置、计算机可读存储介质
WO2023045744A1 (zh) * 2021-09-23 2023-03-30 中兴通讯股份有限公司 加固方法、注册方法、运行方法、电子设备和存储介质

Also Published As

Publication number Publication date
CN106295263A (zh) 2017-01-04

Similar Documents

Publication Publication Date Title
CN105426708B (zh) 一种Android系统的应用程序的加固方法
US20160203087A1 (en) Method for providing security for common intermediate language-based program
KR101054318B1 (ko) 정보 처리 시스템 및 프로그램을 기록한 컴퓨터로 읽을 수 있는 매체
JPWO2006009081A1 (ja) アプリケーション実行装置及びアプリケーション実行装置のアプリケーション実行方法
JP6227772B2 (ja) 動的ライブラリを保護する方法及び装置
CN103530535A (zh) 一种Android平台应用程序保护的加脱壳方法
JP6073320B2 (ja) デジタル署名するオーソリティ依存のプラットフォームシークレット
JP2008537224A (ja) 安全な起動方法およびシステム
US20150095653A1 (en) Method and apparatus of creating application package, method and apparatus of executing application package, and recording medium storing application package
CN109992987B (zh) 基于Nginx的脚本文件保护方法、装置及终端设备
CN106650327A (zh) 基于动态恢复so文件的Android应用加固方法
CN107273723B (zh) 一种基于so文件加壳的Android平台应用软件保护方法
US10296728B2 (en) Method and system for providing cloud-based application security service
US20160162686A1 (en) Method for verifying integrity of dynamic code using hash background of the invention
US9256756B2 (en) Method of encryption and decryption for shared library in open operating system
WO2011134207A1 (zh) 软件保护方法
JP2007233426A (ja) アプリケーション実行装置
WO2016188134A1 (zh) 一种实现应用加固的方法及装置
CN108133147B (zh) 可执行代码的保护方法、设备及可读存储介质
US10120987B2 (en) Device and method for executing protected iOS software modules
CN112035803B (zh) 一种基于Windows平台软件的保护方法及装置
KR101749209B1 (ko) 애플리케이션의 정보 은닉 방법 및 장치, 및 애플리케이션 실행 방법 및 장치
CN112115430A (zh) 一种apk的加固方法、电子设备及存储介质
KR101667774B1 (ko) 스크립트 프로그램을 위한 보안 제공 장치 및 방법
CN102855439A (zh) 一种执行文件自校验方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16799023

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16799023

Country of ref document: EP

Kind code of ref document: A1