IP Library Granted Patent US 10,740,443
Granted Patent B2
US 10,740,443 · App. 15/887,310 · Granted Aug 11, 2020

System and method for code obfuscation of application

Inventors: SangHun Jeon (Seongnam-si, KR); Dongpil Seo (Seongnam-si, KR); Sungbeom Ahn (Seongnam-si, KR); Kwang-Hee Han (Seongnam-si, KR); Wang Jin Oh (Seongnam-si, KR); Seong Yeol Lim (Seongnam-si, KR)
Assignee: Line Corporation
G06F21/14G06F8/41G06F21/12G06F21/125G06F21/62G06F21/64
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,740,443
App. No.
15/887,310
Granted
Aug 11, 2020
Kind
B2
Abstract

Provided is a method and system for code obfuscation of an application. A method configured as a computer may include receiving an application program package that includes an intermediate language (IL) code generated by compiling code for an application including a plurality of classes and a plurality of methods as a dex file over a network, selecting a protection target class or a protection target method from among the plurality of classes and the plurality of methods, encrypting the selected protection target class or the selected protection target method by retrieving and encrypting an IL code corresponding to the selected protection target class or the selected protection target method from the dex file, and adding decryption information for decrypting the encrypted protection target class or the encrypted protection target method to a secure module that is further included in the application program package.

Claims (73)

1. A method executed on at least one computer, the method comprising:

receiving, using at least one processor, an application program package over a network, the application program package including intermediate language (IL) code generated by compiling code for an application as a dex file, the application including a plurality of classes and a plurality of methods;

selecting, using the at least one processor, at least one protection target class or at least one protection target method from the plurality of classes and the plurality of methods, the selecting the at least one protection target class or at least one protection target method including selecting a subset of the classes or methods of the plurality of classes and the plurality of methods included in the application;

encrypting, using the at least one processor, the selected protection target class or the selected protection target method, the encrypting including retrieving and encrypting IL code corresponding to the selected protection target class or the selected protection target method from the dex file; and

adding, using the at least one processor, decryption information to a secure module that is further included in the application program package, the decryption information for decrypting the encrypted protection target class or the encrypted protection target method, wherein the decryption information includes the dex file, and the dex file includes (1) a class including the encrypted protection target method or a class index of the encrypted protection target method, (2) a method index of the encrypted protection target method, and (3) the protection target class or the protection target method for a case in which an electronic device executes the application using Android runtime (ART).

2. The method of claim 1 , wherein

the receiving includes receiving selection information for designating a class or a method over the network; and

the selecting comprises selecting the class or the method designated using the received selection information as the protection target class or the protection target method.

3. The method of claim 1 , wherein the selecting comprises:

retrieving a class or a method corresponding to a desired function of the application from among the plurality of classes and the plurality of methods; and

selecting the retrieved class or the retrieved method as the protection target class or the protection target method.

4. The method of claim 3 , wherein the desired function includes at least one of:

a billing function at a service provided through the application,

an authentication function at the service, and

a communication function with a server providing the service.

5. The method of claim 1 , wherein

the dex file includes a header that stores a number indicating a total number of classes included in the plurality of classes, and an offset of a class table; and

each of the classes of the plurality of classes includes an address offset of a method table with respect to a method included in each of the classes of the plurality of classes; and

the encrypting comprises retrieving IL code corresponding to the protection target class using the class table, or retrieving IL code corresponding to the protection target method using the method table.

6. The method of claim 1 , further comprising:

selecting, using the at least one processor, the decryption information based on a runtime scheme at an electronic device on which the application program package is to be installed; and

the adding comprises,

adding the decryption information to the secure module of the application program package, or

generating a plurality of different application program packages using different pieces of decryption information, each of the different pieces of decryption information corresponding to a plurality of runtime schemes, and

adding each of the different pieces of decryption information to a corresponding secure module of the generated plurality of different application program packages.

7. The method of claim 1 , wherein the decryption information further includes information associated with an address offset of the encrypted IL code, a size of the encrypted IL code, and a key used for encryption for a case in which an electronic device executes the application using Dalvik runtime.

8. The method of claim 7 , wherein the encrypted protection target method is decrypted at the electronic device by:

loading the encrypted IL code included in the dex file to a memory of the electronic device;

locating the encrypted protection target method in the encrypted IL code based on the address offset of the encrypted IL code included in a dex header of the dex file;

decrypting code corresponding to a size of the encrypted IL code corresponding to the encrypted protection target method using the key; and

overwriting the decrypted code on the dex header.

9. The method of claim 1 , wherein the encrypted protection target method is decrypted at the electronic device by:

compiling the dex file included in the decryption information using a converter;

acquiring a native code of the protection target class or the protection target method;

retrieving the encrypted IL code using the class index and the method index from a header of the dex file loaded to a memory of the electronic device; and

overwriting a native code corresponding to the encrypted IL code among the acquired native codes on the retrieved encrypted IL code.

10. The method of claim 1 , further comprising:

updating using the at least one processor, a cyclic redundancy check (CRC) and a hash value of the dex file changed in response to encrypting the IL code.

11. The method of claim 1 , further comprising:

transmitting, using the at least one processor, to an electronic device the application program package in which the IL code is encrypted and the decryption information is added in response to a request from the electronic device over the network.

12. A method executed using at least one computer, the method comprising:

receiving, using at least one processor, from a server over a network, an application program package that includes intermediate language (IL) code generated by compiling code for an application as a dex file and decryption information included in a secure module, the IL code including a plurality of classes and a plurality of methods and in which at least a portion of the IL code is encrypted, and the decrypted information is for decrypting the encrypted IL code;

decrypting, using the at least one processor, the encrypted IL code using the decryption information or by replacing the encrypted IL code with an IL code included in the decryption information; and

executing the decrypted IL code based on a runtime scheme applicable during an execution process of the application, wherein

the encrypted IL code is generated by encrypting an IL code of at least one protection target class or at least one protection target method selected at the server from among the plurality of classes and the plurality of methods of the application, the at least one protection target class or at least one protection target method being a subset of the classes or methods of the plurality of classes and the plurality of methods included in the application, and

the decryption information includes the dex file, and the dex file includes (1) a class including the encrypted protection target method or a class index of the encrypted protection target method, (2) a method index of the encrypted protection target method, and (3) the protection target class or the protection target method for a case in which an electronic device executes the application using Android runtime (ART).

13. The method of claim 12 , wherein the decryption information further includes information associated with an address offset of the encrypted IL code, a size of the encrypted IL code, and a key used for encryption, for Dalvik runtime.

14. The method of claim 13 , wherein the executing comprise:

loading the encrypted IL code included in the dex file to a memory;

locating the encrypted protection target method in the encrypted IL code based on the address offset of the encrypted IL code included in a dex header of the dex file;

decrypting the protection target method using the key; and

overwriting the decrypted code on the dex header.

15. The method of claim 12 , wherein the executing comprises decrypting the protection target method by:

compiling the dex file included in the decryption information using a converter;

acquiring a native code of the protection target class or the protection target method;

retrieving the encrypted IL code using the class index and the method index from a header of the dex file loaded to a memory; and

overwriting a native code corresponding to the encrypted IL code among the acquired native codes on the retrieved encrypted IL code.

16. A system of at least one server comprising one or more processors, wherein each of the one or more processors is configured to execute computer readable instructions to:

receive an application program package over a network, the application program package including intermediate language (IL) code generated by compiling code for an application as a dex file, the application including a plurality of classes and a plurality of methods;

select at least one protection target class or at least one protection target method from the plurality of classes and the plurality of methods, the selecting the at least one protection target class or at least one protection target method including selecting a subset of the classes or methods of the plurality of classes and the plurality of methods included in the application;

encrypt the selected protection target class or the selected protection target method, the encrypting including retrieving and encrypting IL code corresponding to the selected protection target class or the selected protection target method from the dex file; and

add decryption information to a secure module that is further included in the application program package, the decryption information for decrypting the encrypted protection target class or the encrypted protection target method, wherein the decryption information includes the dex file, and the dex file includes (1) a class including the encrypted protection target method or a class index of the encrypted protection target method, (2) a method index of the encrypted protection target method, and (3) the protection target class or the protection target method for a case in which an electronic device executes the application using Android runtime (ART).

17. The system of claim 16 , wherein each of the one or more processors are configured to:

receive selection information for designating a class or a method over the network; and

select the class or the method designated using the received selection information as the protection target class or the protection target method.

18. The system of claim 16 , wherein each of the one or more processors are configured to:

retrieve a class or a method corresponding to a desired function of the application from among the plurality of classes and the plurality of methods; and

select the retrieved class or the retrieved method as the protection target class or the protection target method.

19. The system of claim 16 , wherein each of the one or more processors are further configured to:

select the decryption information based on a runtime scheme at an electronic device on which the application program package is to be installed; and

add the selected decryption information to the secure module of the application program package, or

generate a plurality of different application program packages using different pieces of decryption information, each of the different pieces of decryption information corresponding to a plurality of runtime schemes, and

add each of the different pieces of decryption information to a corresponding secure module of the generated plurality of different application program packages.

Assignments (8)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 12, 2024
From: Z INTERMEDIATE GLOBAL CORPORATION
To: LY CORPORATION
Reel/Frame 067096/0431 →
CHANGE OF NAME Recorded Apr 10, 2024
From: LINE CORPORATION
To: Z INTERMEDIATE GLOBAL CORPORATION
Reel/Frame 067069/0467 →
CORRECTIVE ASSIGNMENT TO CORRECT THE THE CITY SHOULD BE SPELLED AS TOKYO PREVIOUSLY RECORDED AT REEL: 058597 FRAME: 0141. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jan 17, 2023
From: LINE CORPORATION
To: A HOLDINGS CORPORATION
Reel/Frame 062401/0328 →
CORRECTIVE ASSIGNMENT TO CORRECT THE SPELLING OF THE ASSIGNEES CITY IN THE ADDRESS SHOULD BE TOKYO, JAPAN PREVIOUSLY RECORDED AT REEL: 058597 FRAME: 0303. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jan 17, 2023
From: A HOLDINGS CORPORATION
To: LINE CORPORATION
Reel/Frame 062401/0490 →
CHANGE OF NAME Recorded Dec 28, 2021
From: LINE CORPORATION
To: A HOLDINGS CORPORATION
Reel/Frame 058597/0141 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 28, 2021
From: A HOLDINGS CORPORATION
To: LINE CORPORATION
Reel/Frame 058597/0303 →
NUNC PRO TUNC ASSIGNMENT Recorded Jun 12, 2018
From: JEON, SANGHUN; SEO, DONGPIL; AHN, SUNGBEOM; HAN, KWANG-HEE; OH, WANG JIN; LIM, SEONG YEOL
To: LINE CORPORATION
Reel/Frame 046053/0977 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 5, 2018
From: JEON, SANGHUN; SEO, DONGPIL; AHN, SUNGBEOM; HAN, KWANG-HEE; OH, WANG JIN; LIM, SEONG YEOL
To: LINE CORPORATION; LINE PLUS CORPORATION
Reel/Frame 045248/0350 →
Priority Claims (1)
KR 10-2015-0112741 · Aug 10, 2015 · national
Continuity (2)
Continuation PCTKR2016008588 · Aug 4, 2016
Related Publication 20180157808A1 · Jun 7, 2018