APK Shared Object Compression With Runtime Decompression
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing compression algorithms for APK files in Android systems, such as the deflate algorithm, have limitations that prevent the use of higher compression rates, making it difficult to reduce the size of APK applications effectively while ensuring compatibility and normal operation.
Innovation Solution
The method involves compressing shared object files using a higher compression algorithm like LZMA, modifying the invoking files to invoke a decompression function, and encapsulating these files into a new APK application, allowing for decompression during runtime, thus overcoming the limitations of the default compression algorithm.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the default deflate compression algorithm is used for SO files in APK applications, then compatibility with the Android system is maintained and normal operation is ensured, but the compression rate is limited and the APK file size cannot be reduced effectively
Solution Approach 1:
The patent applies preliminary action by pre-compressing SO files using higher compression algorithms (like LZMA) before packaging them into the APK, and preparing decompression functionality in advance so that the system can operate with compressed files from the start without requiring runtime compression operations
Solution Approach 2:
The patent introduces an intermediary decompression mechanism that acts as a bridge between the highly compressed SO files and the Android system's expected input format. This intermediary layer handles the decompression transparently, allowing the system to work with highly compressed files while maintaining compatibility with the Android runtime environment
2Productivity
If a higher compression algorithm like LZMA is used to compress SO files, then the compression rate is improved and APK file size is reduced, but the Android system's default decompression algorithm cannot directly decompress these files
Solution Approach 1:
The patent applies parameter changes by modifying the compression algorithm parameter from the default deflate to higher compression algorithms like LZMA or bzip2. This changes the compression characteristics to achieve better compression ratios, while simultaneously introducing corresponding decompression capabilities to handle the new compression format
Solution Approach 2:
The patent segments the compression and decompression functions into separate components. The compression function uses high-ratio algorithms independently, while the decompression function is implemented as a separate module that can be selectively activated. This segmentation allows the system to use optimal compression algorithms without being constrained by the system's default decompression capabilities
3Weight of stationary object
If the APK application is recompressed after optimizing service logic and resources, then the file size may be further reduced, but the operation system's limitations prevent changing the default compression algorithm
Solution Approach 1:
The patent extracts the compression algorithm selection from the operating system's fixed defaults and moves it to the application packaging stage. By extracting this freedom of choice, developers can select optimal compression algorithms during APK creation, and the extracted decompression capability is embedded in the APK itself, bypassing the system's algorithm limitations
Data Source
Figure 1A
Figure 1B
Figure 1C
AI summary
The size of a source application is reduced by compressing a plurality of invoked files, such as SO files, in the source application with a compression algorithm that has a higher compression rate compared to a default compression rate. A decompression file that corresponds with the compression algorithm is inserted into a plurality of invoking files in the source application so that the source application itself can decompress the invoked files that were compressed with the compression algorithm.