CN112784222A - 一种安卓apk安装包防篡改校验方法 - Google Patents

一种安卓apk安装包防篡改校验方法 Download PDF

Info

Publication number
CN112784222A
CN112784222A CN202011592557.0A CN202011592557A CN112784222A CN 112784222 A CN112784222 A CN 112784222A CN 202011592557 A CN202011592557 A CN 202011592557A CN 112784222 A CN112784222 A CN 112784222A
Authority
CN
China
Prior art keywords
installation package
verification
code
tamper
target file
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.)
Withdrawn
Application number
CN202011592557.0A
Other languages
English (en)
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.)
Suning Consumer Finance Co ltd
Original Assignee
Suning Consumer Finance 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 Suning Consumer Finance Co ltd filed Critical Suning Consumer Finance Co ltd
Priority to CN202011592557.0A priority Critical patent/CN112784222A/zh
Publication of CN112784222A publication Critical patent/CN112784222A/zh
Withdrawn 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
    • 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

Landscapes

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

Abstract

本发明公开了一种安卓apk安装包防篡改校验方法,包括如下步骤:服务器端运行安装包中的目标文件并加载所述安装包中的安全动态库;根据目标文件中的混淆代码执行下述步骤:反向解密重组混淆代码,获得验证代码;获取所述安全动态库中存储的验证信息;根据所述验证代码和验证信息,验证所述安装包是否是重打包的安装包。

Description

一种安卓apk安装包防篡改校验方法
技术领域
本发明属于计算机技术领域,具体涉及一种安卓apk安装包防篡改校验方法。
背景技术
目前,许多恶意应用软件通过重打包的方式修改原始的安装包,在原始的安装包中嵌入广告、自动下载恶意软件以及实现root等程序。
发明内容
本发明所要解决的技术问题是针对上述现有技术的不足,提供一种安卓apk安装包防篡改校验方法。
为实现上述技术目的,本发明采取的技术方案为:
一种安卓apk安装包防篡改校验方法,包括如下步骤:
服务器端运行安装包中的目标文件并加载所述安装包中的安全动态库;
根据目标文件中的混淆代码执行下述步骤:
反向解密重组混淆代码,获得验证代码;
获取所述安全动态库中存储的验证信息;
根据所述验证代码和验证信息,验证所述安装包是否是重打包的安装包。
为优化上述技术方案,采取的具体措施还包括:
进一步地,目标文件是将预设的代码进行编译后得到的目标文件。
进一步地,目标文件的编译方法具体为:
对目标文件进行检测并移除代码中无用的类、字段、方法和特性;
对字节码进行优化,移除无用的指令,删除冗余的参数;
使用简单有联系的字符对类、字段和方法进行重命名。
进一步地,验证代码包括安装包的签名和哈希值。
进一步地,验证信息为对应安装包的签名和哈希值的校验信息。
进一步地,所述验证代码和验证信息,验证所述安装包是否是重打包的安装包,具体包括:
验证验证代码中的签名和哈希值与验证信息是否一致;
若一致,则确定所述安装包是原始安装包;
若不一致,则确定所述安装包是重打包的安装包。
进一步地,目标文件为dex文件,所述安全动态库为so库。
本发明的有益效果:
本发明一种安卓apk安装包防篡改校验方法,通过对dex文件进行加密,可以有效防止二次打包,通过与so库的验证信息进行对比,提高验证准确性。
附图说明
图1是本发明的流程示意图。
具体实施方式
以下结合附图对本发明的实施例作进一步详细描述。
如图1所示,本发明为一种安卓apk安装包防篡改校验方法,包括如下步骤:
服务器端运行安装包中的目标文件并加载所述安装包中的安全动态库,目标文件为dex文件,所述安全动态库为so库;
其中,目标文件是将预设的代码进行编译后得到的目标文件;
目标文件的编译方法具体为:
对目标文件进行检测并移除代码中无用的类、字段、方法和特性;
对字节码进行优化,移除无用的指令,删除冗余的参数;
使用简单有联系的字符对类、字段和方法进行重命名。
根据目标文件中的混淆代码执行下述步骤:
反向解密重组混淆代码,获得验证代码,验证代码包括安装包的签名和哈希值;
获取所述安全动态库中存储的验证信息,验证信息为对应安装包的签名和哈希值的校验信息;
根据所述验证代码和验证信息,验证所述安装包是否是重打包的安装包。
具体为:验证验证代码中的签名和哈希值与验证信息是否一致;
若一致,则确定所述安装包是原始安装包;
若不一致,则确定所述安装包是重打包的安装包。
以上仅是本发明的优选实施方式,本发明的保护范围并不仅局限于上述实施例,凡属于本发明思路下的技术方案均属于本发明的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理前提下的若干改进和润饰,应视为本发明的保护范围。

Claims (7)

1.一种安卓apk安装包防篡改校验方法,其特征在于,包括如下步骤:
服务器端运行安装包中的目标文件并加载所述安装包中的安全动态库;
根据目标文件中的混淆代码执行下述步骤:
反向解密重组混淆代码,获得验证代码;
获取所述安全动态库中存储的验证信息;
根据所述验证代码和验证信息,验证所述安装包是否是重打包的安装包。
2.根据权利要求1所述的一种安卓apk安装包防篡改校验方法,其特征在于,所述目标文件是将预设的代码进行编译后得到的目标文件。
3.根据权利要求2所述的一种安卓apk安装包防篡改校验方法,其特征在于:所述目标文件的编译方法具体为:
对目标文件进行检测并移除代码中无用的类、字段、方法和特性;
对字节码进行优化,移除无用的指令,删除冗余的参数;
使用简单有联系的字符对类、字段和方法进行重命名。
4.根据权利要求1所述的一种安卓apk安装包防篡改校验方法,其特征在于:所述验证代码包括安装包的签名和哈希值。
5.根据权利要求1所述的一种安卓apk安装包防篡改校验方法,其特征在于:所述验证信息为对应安装包的签名和哈希值的校验信息。
6.根据权利要求1所述的一种安卓apk安装包防篡改校验方法,其特征在于,根据所述验证代码和验证信息,验证所述安装包是否是重打包的安装包,具体包括:
验证验证代码中的签名和哈希值与验证信息是否一致;
若一致,则确定所述安装包是原始安装包;
若不一致,则确定所述安装包是重打包的安装包。
7.根据权利要求1-6任一所述的一种安卓apk安装包防篡改校验方法,其特征在于:所述目标文件为dex文件,所述安全动态库为so库。
CN202011592557.0A 2020-12-29 2020-12-29 一种安卓apk安装包防篡改校验方法 Withdrawn CN112784222A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011592557.0A CN112784222A (zh) 2020-12-29 2020-12-29 一种安卓apk安装包防篡改校验方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011592557.0A CN112784222A (zh) 2020-12-29 2020-12-29 一种安卓apk安装包防篡改校验方法

Publications (1)

Publication Number Publication Date
CN112784222A true CN112784222A (zh) 2021-05-11

Family

ID=75753234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011592557.0A Withdrawn CN112784222A (zh) 2020-12-29 2020-12-29 一种安卓apk安装包防篡改校验方法

Country Status (1)

Country Link
CN (1) CN112784222A (zh)

Similar Documents

Publication Publication Date Title
EP3528149B1 (en) Software repackaging prevention method and device
KR101471589B1 (ko) 공통중간언어 기반 프로그램을 위한 보안 제공 방법
CN101908119B (zh) 一种动态链接库dll文件的处理方法和装置
US20140150096A1 (en) Method for assuring integrity of mobile applications and apparatus using the method
US20170262656A1 (en) Method and device for providing verifying application integrity
CN104318135B (zh) 一种基于可信执行环境的Java代码安全动态载入方法
US20170262657A1 (en) Method and device for providing verifying application integrity
WO2015192637A1 (zh) 软件安装包的加固保护方法和装置
KR20160145014A (ko) 하드웨어-기반 스택 제어 정보 보호
CN104123481A (zh) 防止应用程序被篡改的方法及装置
US20170262658A1 (en) Method and device for providing verifying application integrity
You et al. Reference hijacking: Patching, protecting and analyzing on unmodified and non-rooted android devices
CN106709286A (zh) 一种对apk资源包进行安全加固的方法
Ibrahim et al. SafetyNOT: on the usage of the SafetyNet attestation API in Android
Lim et al. Structural analysis of packing schemes for extracting hidden codes in mobile malware
CN111950035A (zh) 对apk文件完整性保护的方法、系统、设备及存储介质
US20150026483A1 (en) Systems and Methods for Mobile Application Protection
CN107169318A (zh) 一种应用程序安全保护的方法及装置
US8844024B1 (en) Systems and methods for using tiered signing certificates to manage the behavior of executables
CN112784222A (zh) 一种安卓apk安装包防篡改校验方法
Banescu et al. Detecting patching of executables without system calls
US8775822B2 (en) Computer-implemented method and system for protecting a software installation after certification
CN105278954A (zh) 反破解安卓app及其运行方式
KR101907846B1 (ko) 의존 관계형 위변조 무결성 체크를 이용한 암호화 처리장치 및 방법
CN111522555B (zh) apk文件的加固方法、解密方法及相关装置

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20210511

WW01 Invention patent application withdrawn after publication