CN109271759B - So file security reinforcement technical method based on android platform - Google Patents

So file security reinforcement technical method based on android platform Download PDF

Info

Publication number
CN109271759B
CN109271759B CN201811120565.8A CN201811120565A CN109271759B CN 109271759 B CN109271759 B CN 109271759B CN 201811120565 A CN201811120565 A CN 201811120565A CN 109271759 B CN109271759 B CN 109271759B
Authority
CN
China
Prior art keywords
file
character string
java
array
reading
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.)
Active
Application number
CN201811120565.8A
Other languages
Chinese (zh)
Other versions
CN109271759A (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.)
Kaimi Technology Co ltd
Original Assignee
Kaimi Technology 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 Kaimi Technology Co ltd filed Critical Kaimi Technology Co ltd
Priority to CN201811120565.8A priority Critical patent/CN109271759B/en
Publication of CN109271759A publication Critical patent/CN109271759A/en
Application granted granted Critical
Publication of CN109271759B publication Critical patent/CN109271759B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

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

Abstract

The invention discloses a technical method for security reinforcement of so files based on an android platform. The method belongs to the technical field of so file security reinforcement, processes the form aspect of the so file, enables the so file not to exist in the form of the file, enables the so file to be dynamically encrypted and decrypted in a memory, prevents an attacker from directly obtaining the so file from the local, increases the difficulty of illegal cracking, and has good effects on static analysis resistance and dynamic debugging resistance. The method comprises a so file reinforcing process and a so file decrypting and loading process; when the Android project needs to use the content in the so file, the encrypted character string array in the java file is read, the character strings in the character string array are dynamically shifted, decrypted and spliced through a custom algorithm, the spliced character strings are written into an app/pkgName/lib directory of the java file in a file stream mode, and are loaded and called in a system load so file mode, and are deleted after the calling is completed.

Description

So file security reinforcement technical method based on android platform
Technical Field
The invention relates to the technical field of so file security reinforcement, in particular to a so file security reinforcement technical method based on an android platform.
Background
Currently, there are two general types of so file reinforcement, one is to perform reinforcement processing on the so file itself, and the other is to perform obfuscation encryption processing on Native codes inside the so file. At present, the two reinforcing modes of the so file exist in a file form, so that the so file is fixedly encrypted and decrypted in a memory, an attacker can directly obtain the so file from the local easily, the difficulty of illegal cracking is reduced, and the effect on resisting static analysis and dynamic debugging is poor.
Disclosure of Invention
The invention aims to solve the defects of the existing so file security reinforcement, and provides the technical method for the security reinforcement of the so file based on the android platform, which is used for processing the form aspect of the so file, enabling the so file not to exist in the form of the file, dynamically encrypting and decrypting the so file in the memory, preventing an attacker from directly obtaining the so file from the local, increasing the difficulty of illegal cracking, and having good effects on static analysis resistance and anti-dynamic debugging resistance.
The technical problem is solved by the following technical scheme:
the security reinforcing technical method of the so file based on the android platform comprises a so file reinforcing process and a so file decrypting and loading process;
the so file consolidation process is as follows:
(A1) reading the unreinforced so file, and reading the unreinforced so file into the memory in a file stream mode;
(A2) converting the file stream in the memory into a byte array, and carrying out shift encryption on the byte array according to a custom algorithm to obtain a new byte array;
(A3) then circularly reading the byte array, and orderly writing the read byte array into a java file in a character string form with a fixed length to finally obtain a complete character string array;
the so file decryption loading process is as follows:
(A4) when the Android project needs to use the content in the so file, the encrypted character string array in the java file is read, the character strings in the character string array are dynamically shifted, decrypted and spliced through a custom algorithm, the spliced character strings are written into an app/pkgName/lib directory of the java file in a file stream mode, and are loaded and called in a system load so file mode, and are deleted after the calling is completed.
Compared with a general so file reinforcing mode, the reinforcing scheme can process the so file in a form so that the so file does not exist in a file form, dynamically encrypts and decrypts in the memory, prevents an attacker from directly obtaining the so file from the local, increases the difficulty of illegal cracking, and has good effects on static analysis resistance and dynamic debugging resistance.
Preferably, in step a1, before reading the non-reinforced so file, firstly, preparing the so file used by the Android project; a so file supported by each CPU framework including armeabi, x86, and armeabi-v7 a;
in step a2, when converting a file stream in the memory into a byte array, a reinforcement project needs to be prepared, the project is created with java as a template, and uses pure java language, which aims to reinforce the so file.
In the step A3, when the byte array is read circularly, the so file is also placed in a specified directory, a reinforcement project is operated, the so file is subjected to a series of processing, and finally a txt file is output, wherein the txt file content is composed of a plurality of character strings; reading so in a file format in a file stream mode, encrypting in a byte mode, outputting every 2048 bytes as the length of a character string after encryption is finished, outputting in the residual length when the length is less than 2048, and adding double quotation marks and commas at the head and the tail of the character string to make the format of the character string uniform; storing all character strings in the txt file as a character string array in a java file according to an output sequence;
in the step a4, when the Android project needs to use the content in the so file, the character string array is also assembled, the final character string is actually an encrypted file, the character string is decrypted and stored in the sd card of the mobile phone in the form of a file stream, which is equivalent to restoring the so file, and then the loading method is called.
Preferably, the so files include so files supported by respective CPU frameworks of armeabi, x86, and armeabi-v7 a.
The invention can achieve the following effects:
compared with a general so file reinforcing mode, the reinforcing scheme disclosed by the invention has the advantages that the form aspect of the so file is processed, the so file does not exist in the form of the file, the so file is dynamically encrypted and decrypted in the memory, an attacker is prevented from directly obtaining the so file from the local, the illegal cracking difficulty is increased, and the reinforcing scheme has good effects on static analysis resistance and anti-dynamic debugging resistance.
Drawings
Fig. 1 is a schematic flow chart of the so file strengthening process of the present invention.
Fig. 2 is a schematic flow chart of the so file decryption loading process of the present invention.
Detailed Description
The invention is further described with reference to the following figures and examples.
In the embodiment, the so file security reinforcement technical method based on the android platform is shown in fig. 1 and 2 and comprises a so file reinforcement process and a so file decryption loading process;
the so file consolidation process is as follows:
(A1) reading the unreinforced so file, and reading the unreinforced so file into the memory in a file stream mode;
(A2) converting the file stream in the memory into a byte array, and carrying out shift encryption on the byte array according to a custom algorithm to obtain a new byte array;
(A3) then circularly reading the byte array, and orderly writing the read byte array into a java file in a character string form with a fixed length to finally obtain a complete character string array;
the so file decryption loading process is as follows:
(A4) when the Android project needs to use the content in the so file, the encrypted character string array in the java file is read, the character strings in the character string array are dynamically shifted, decrypted and spliced through a custom algorithm, the spliced character strings are written into an app/pkgName/lib directory of the java file in a file stream mode, and are loaded and called in a system load so file mode, and are deleted after the calling is completed.
In the step A1, before reading the unreinforced so file, firstly preparing the so file used by the Android project; a so file supported by each CPU framework including armeabi, x86, and armeabi-v7 a;
in step a2, when converting a file stream in the memory into a byte array, a reinforcement project needs to be prepared, the project is created with java as a template, and uses pure java language, which aims to reinforce the so file.
In the step A3, when the byte array is read circularly, the so file is also placed in a specified directory, a reinforcement project is operated, the so file is subjected to a series of processing, and finally a txt file is output, wherein the txt file content is composed of a plurality of character strings; reading so in a file format in a file stream mode, encrypting in a byte mode, outputting every 2048 bytes as the length of a character string after encryption is finished, outputting in the residual length when the length is less than 2048, and adding double quotation marks and commas at the head and the tail of the character string to make the format of the character string uniform; storing all character strings in the txt file as a character string array in a java file according to an output sequence;
in the step a4, when the Android project needs to use the content in the so file, the character string array is also assembled, the final character string is actually an encrypted file, the character string is decrypted and stored in the sd card of the mobile phone in the form of a file stream, which is equivalent to restoring the so file, and then the loading method is called.
Compared with a general so file reinforcing mode, the reinforcing scheme can process the so file in a form so that the so file does not exist in a file form, dynamically encrypts and decrypts in the memory, prevents an attacker from directly obtaining the so file from the local, increases the difficulty of illegal cracking, and has good effects on static analysis resistance and dynamic debugging resistance.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the implementation is not limited to the above-described embodiments, and those skilled in the art can make various changes or modifications within the scope of the appended claims.

Claims (1)

1. The security reinforcing technical method of the so file based on the android platform is characterized by comprising a so file reinforcing process and a so file decrypting and loading process;
the so file consolidation process is as follows:
(A1) reading the unreinforced so file, and reading the unreinforced so file into the memory in a file stream mode;
(A2) converting the file stream in the memory into a byte array, and carrying out shift encryption on the byte array according to a custom algorithm to obtain a new byte array;
(A3) then circularly reading the byte array, and orderly writing the read byte array into a java file in a character string form with a fixed length to finally obtain a complete character string array;
the so file decryption loading process is as follows:
(A4) when the Android project needs to use the content in the so file, reading the encrypted character string array in the java file,
dynamically performing self-defined algorithm shift decryption and splicing on the character strings in the character string array,
writing the spliced character strings into an app/pkgName/lib directory of a java file in a file stream mode, loading and calling the app/pkgName/lib directory in a system load mode,
and delete it from the local place after calling out and finishing;
in the step A1, before reading the unreinforced so file, firstly preparing the so file used by the Android project; a so file supported by each CPU framework including armeabi, x86, and armeabi-v7 a;
in the step A2, when converting the file stream in the memory into a byte array, a reinforcement project needs to be prepared, wherein the project is created by using java as a template, uses pure java language and aims to reinforce the so file;
in the step A3, when the byte array is read circularly, the so file is also placed in a specified directory, a reinforcement project is operated, the so file is subjected to a series of processing, and finally a txt file is output, wherein the txt file content is composed of a plurality of character strings; reading so in a file format in a file stream mode, encrypting in a byte mode, outputting every 2048 bytes as the length of a character string after encryption is finished, outputting in the residual length when the length is less than 2048, and adding double quotation marks and commas at the head and the tail of the character string to make the format of the character string uniform; storing all character strings in the txt file as a character string array in a java file according to an output sequence;
in the step A4, when the Android project needs to use the content in the so file, the character string arrays are also spliced, the final character string is actually an encrypted file, the character string is decrypted and stored in an sd card of the mobile phone in a file stream form, which is equivalent to restoring the so file, and then the loading method is called;
the so file includes so files supported by the respective CPU frameworks of armeabi, x86, and armeabi-v7 a;
the so file is processed in a form that the so file does not exist in a file form, so that the so file is dynamically encrypted and decrypted in the memory, an attacker is prevented from directly obtaining the so file from the local, the difficulty of illegal cracking is increased, and the so file has good effects on static analysis resistance and dynamic debugging resistance.
CN201811120565.8A 2018-09-26 2018-09-26 So file security reinforcement technical method based on android platform Active CN109271759B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811120565.8A CN109271759B (en) 2018-09-26 2018-09-26 So file security reinforcement technical method based on android platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811120565.8A CN109271759B (en) 2018-09-26 2018-09-26 So file security reinforcement technical method based on android platform

Publications (2)

Publication Number Publication Date
CN109271759A CN109271759A (en) 2019-01-25
CN109271759B true CN109271759B (en) 2022-04-05

Family

ID=65198884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811120565.8A Active CN109271759B (en) 2018-09-26 2018-09-26 So file security reinforcement technical method based on android platform

Country Status (1)

Country Link
CN (1) CN109271759B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324317B (en) * 2020-02-18 2024-03-26 上海东普信息科技有限公司 Local printing face list method, device, equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105278954A (en) * 2015-09-25 2016-01-27 杭州哲信信息技术有限公司 Anti-cracking Android APP and operation mode thereof
CN105930745A (en) * 2016-04-25 2016-09-07 北京珊瑚灵御科技有限公司 Android platform-based character string reinforcement method
CN106650327A (en) * 2016-11-24 2017-05-10 湖南鼎源蓝剑信息科技有限公司 so file dynamic recovery-based Android application reinforcement method
CN107273723B (en) * 2017-07-07 2022-01-28 广东工业大学 So file shell adding-based Android platform application software protection method

Also Published As

Publication number Publication date
CN109271759A (en) 2019-01-25

Similar Documents

Publication Publication Date Title
CN106203006A (en) Android application reinforcement means based on dex Yu so file Dynamic Execution
CN111475824B (en) Data access method, device, equipment and storage medium
CN104408337A (en) Reinforcement method for preventing reverse of APK (Android package) file
CN104317625A (en) Dynamic loading method for APK files
US20150169881A1 (en) Method And Apparatus For Providing String Encryption And Decryption In Program Files
KR20130030771A (en) Method, apparatus and system for processing firmware based on firmware over the air technology
CN102236757A (en) Software protection method and system applicable to Android system
CN107291485B (en) Dynamic link library reinforcing method, operation method, reinforcing device and safety system
CN103902342A (en) System updating and upgrading method and system in enclosed environment
CN108052805B (en) Data encryption and decryption method and device
WO2019062015A1 (en) Source code protection method, application server, and computer-readable storage medium
CN103246830A (en) Encrypting processing method, encrypting processing device, deciphering processing method and deciphering processing device of client side scripting
CN109271759B (en) So file security reinforcement technical method based on android platform
CN102779048A (en) Method and device for operating hypertext markup language5 (HTML5) application program at mobile terminal
CN104811209A (en) Compressed file data embedding method and device capable of resisting longest matching detection
CN116522368A (en) Firmware decryption analysis method for Internet of things equipment, electronic equipment and medium
US11601283B2 (en) Message authentication code (MAC) based compression and decompression
CN116015767A (en) Data processing method, device, equipment and medium
CN110119601A (en) Program reinforcement means and device based on application program installation kit
CN112181366B (en) Mobile application development framework based on cross-platform interaction
CN104462883A (en) APK file strengthening method
CN112035803B (en) Protection method and device based on Windows platform software
CN110119600A (en) Program reinforcement means and device based on application program installation kit
CN108932436B (en) Android system-based software security reinforcement method for APP specification
KR101667774B1 (en) Apparatus and Method of Providing Security for Script 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
GR01 Patent grant
GR01 Patent grant