# US 2019/0243974 A1 · Method and apparatus for anti-repackaging

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2019/0243974 A1
- Document ID: US20190243974A1
- Status: Published application
- Kind: A1
- Application number: 16/381,857
- Filed: 2019-04-11
- Published: 2019-08-08
- Earliest claimed: 2016-10-11
- Assignees: Alibaba Group Holding Limited
- Applicants: Alibaba Group Holding Limited
- Inventors: Yaoguang CHEN; Jiashui WANG
- Web page: https://patentgrep.com/patent/US20190243974A1

## CPC

- G06F 21/566: {Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities}
- G06F 8/61: Installation
- G06F 21/14: against software analysis or reverse engineering, e.g. by obfuscation
- G06F 21/16: Program or content traceability, e.g. by watermarking
- G06F 21/51: at application loading time, e.g. accepting, rejecting, starting or inhibiting executable software based on integrity or source reliability
- G06F 21/563: {by source code analysis}
- G06F 21/1063: {Personalisation}
- G06F 2221/033: Test or assess software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A target file is run in an installation package. A secure dynamic library is loaded in the installation package. Based on a code in the target file, digital watermark information embedded in the target file and verification information stored in the secure dynamic library is retrieved. Based on the digital watermark information and the verification information, a determination is made whether the installation package is a repackaged installation package.

## Claims

### Claim 1

A computer-implemented method for anti-repackaging, comprising:
running a target file in an installation package;
loading a secure dynamic library in the installation package;
retrieving, based on a code in the target file, digital watermark information embedded in the target file and verification information stored in the secure dynamic library; and
determining, based on the digital watermark information and the verification information, whether the installation package is a repackaged installation package.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein:
the target file is a target file obtained after predetermined code is compiled; and
the digital watermark information is embedded at an end of the target file.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein retrieving the digital watermark information comprises:
determining a start address of the digital watermark information in the target file based on an original length of the target file, wherein the original length is a length of the target file before the digital watermark information is embedded; and
retrieving the digital watermark information from the target file based on the start address.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein:
determining whether the installation package is the repackaged installation package comprises:
determining whether the digital watermark information is consistent with the verification information;
in response to determining that the digital watermark information is consistent with the verification information:
determining that the installation package is an original installation package; and
in response to determining that the digital watermark information is inconsistent with the verification information:
determining that the installation package is a repackaged installation package.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein determining, based on the digital watermark information and the verification information, whether the installation package is the repackaged installation package comprises:
when the digital watermark information is an instruction:
performing an operation based on the instruction to obtain an operation result;
determining whether the operation result is consistent with the verification information;
in response to determining that the operation result is consistent with the verification information:
determining that the installation package is an original installation package; and
in response to determining that the operation result is inconsistent with the verification information:
determining that the installation package is a repackaged installation package.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein determining, based on the digital watermark information and the verification information, whether the installation package is the repackaged installation package comprises:
when the digital watermark information is an instruction:
performing an operation based on the instruction to obtain an operation result;
determining whether the operation result is consistent with an operation result in the verification information; and
determining whether the instruction is consistent with an instruction in the verification information.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, further comprising:
in response to determining that the operation result is consistent with the operation result in the verification information and the instruction is consistent with the instruction in the verification information:
determining that the installation package is an original installation package; and
in response to determining that the operation result is inconsistent with the verification information:
determining that the installation package is the repackaged installation package.

### Claim 8

A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations for anti-repackaging, comprising:
running a target file in an installation package;
loading a secure dynamic library in the installation package;
retrieving, based on a code in the target file, digital watermark information embedded in the target file and verification information stored in the secure dynamic library; and
determining, based on the digital watermark information and the verification information, whether the installation package is a repackaged installation package.

### Claim 9 (depends on 8)

The non-transitory, computer-readable medium of claim 8, wherein:
the target file is a target file obtained after predetermined code is compiled; and
the digital watermark information is embedded at an end of the target file.

### Claim 10 (depends on 9)

The non-transitory, computer-readable medium of claim 9, wherein retrieving the digital watermark information comprises:
determining a start address of the digital watermark information in the target file based on an original length of the target file, wherein the original length is a length of the target file before the digital watermark information is embedded; and
retrieving the digital watermark information from the target file based on the start address.

### Claim 11 (depends on 8)

The non-transitory, computer-readable medium of claim 8, wherein:
determining whether the installation package is the repackaged installation package comprises:
determining whether the digital watermark information is consistent with the verification information;
in response to determining that the digital watermark information is consistent with the verification information:
determining that the installation package is an original installation package; and
in response to determining that the digital watermark information is inconsistent with the verification information:
determining that the installation package is a repackaged installation package.

### Claim 12 (depends on 8)

The non-transitory, computer-readable medium of claim 8, wherein determining, based on the digital watermark information and the verification information, whether the installation package is the repackaged installation package comprises:
when the digital watermark information is an instruction:
performing an operation based on the instruction to obtain an operation result;
determining whether the operation result is consistent with the verification information;
in response to determining that the operation result is consistent with the verification information:
determining that the installation package is an original installation package; and
in response to determining that the operation result is inconsistent with the verification information:
determining that the installation package is a repackaged installation package.

### Claim 13 (depends on 8)

The non-transitory, computer-readable medium of claim 8, wherein determining, based on the digital watermark information and the verification information, whether the installation package is the repackaged installation package comprises:
when the digital watermark information is an instruction:
performing an operation based on the instruction to obtain an operation result;
determining whether the operation result is consistent with an operation result in the verification information; and
determining whether the instruction is consistent with an instruction in the verification information.

### Claim 14 (depends on 13)

The non-transitory, computer-readable medium of claim 13, further comprising:
in response to determining that the operation result is consistent with the operation result in the verification information and the instruction is consistent with the instruction in the verification information:
determining that the installation package is an original installation package; and
in response to determining that the operation result is inconsistent with the verification information:
determining that the installation package is the repackaged installation package.

### Claim 15

A computer-implemented system for anti-repackaging, comprising:
one or more computers; and
one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:
running a target file in an installation package;
loading a secure dynamic library in the installation package;
retrieving, based on a code in the target file, digital watermark information embedded in the target file and verification information stored in the secure dynamic library; and
determining, based on the digital watermark information and the verification information, whether the installation package is a repackaged installation package.

### Claim 16 (depends on 15)

The computer-implemented system of claim 15, wherein:
the target file is a target file obtained after predetermined code is compiled; and
the digital watermark information is embedded at an end of the target file.

### Claim 17 (depends on 16)

The computer-implemented system of claim 16, wherein retrieving the digital watermark information comprises:
determining a start address of the digital watermark information in the target file based on an original length of the target file, wherein the original length is a length of the target file before the digital watermark information is embedded; and
retrieving the digital watermark information from the target file based on the start address.

### Claim 18 (depends on 15)

The computer-implemented system of claim 15, wherein:
determining whether the installation package is the repackaged installation package comprises:
determining whether the digital watermark information is consistent with the verification information;
in response to determining that the digital watermark information is consistent with the verification information:
determining that the installation package is an original installation package; and
in response to determining that the digital watermark information is inconsistent with the verification information:
determining that the installation package is a repackaged installation package.

### Claim 19 (depends on 15)

The computer-implemented system of claim 15, wherein determining, based on the digital watermark information and the verification information, whether the installation package is the repackaged installation package comprises:
when the digital watermark information is an instruction:
performing an operation based on the instruction to obtain an operation result;
determining whether the operation result is consistent with the verification information;
in response to determining that the operation result is consistent with the verification information:
determining that the installation package is an original installation package; and
in response to determining that the operation result is inconsistent with the verification information:
determining that the installation package is a repackaged installation package.

### Claim 20 (depends on 15)

The computer-implemented system of claim 15, wherein determining, based on the digital watermark information and the verification information, whether the installation package is the repackaged installation package comprises:
when the digital watermark information is an instruction:
performing an operation based on the instruction to obtain an operation result;
determining whether the operation result is consistent with an operation result in the verification information;
determining whether the instruction is consistent with an instruction in the verification information;
in response to determining that the operation result is consistent with the operation result in the verification information and the instruction is consistent with the instruction in the verification information:
determining that the installation package is an original installation package; and
in response to determining that the operation result is inconsistent with the verification information:
determining that the installation package is the repackaged installation package.
