JIT Translation Function Modification for Android Swizzling
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The Android operating system's just-in-time (JIT) translation of Java bytecode to native machine code complicates modifications to mobile applications, as swizzled functions no longer operate correctly once translated, preventing SDKs from making necessary modifications to user interfaces and features.
Innovation Solution
Modifying the JIT translation function to redirect its execution to alternative code, which checks if the target function has been swizzled, allowing only unmodified functions to be translated into native machine code while preserving swizzling modifications by preventing translation of swizzled functions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If JIT translation is enabled for application functions, then execution performance is improved through native machine code optimization, but SDK modification capability deteriorates because swizzled functions cannot be properly modified after translation
Solution Approach 1:
The patent segments the JIT translation process by function, allowing selective translation based on whether a function has been swizzled. Unswizzled functions undergo JIT translation for optimization, while swizzled functions are excluded from translation to preserve modification capability. This segmentation resolves the contradiction by applying different translation behaviors to different function types.
Solution Approach 2:
The patent performs preliminary detection of swizzled functions before initiating JIT translation. By checking whether a function has been modified (swizzled) prior to translation, the system can prevent translation of swizzled functions while still translating unswizzled functions. This preliminary action ensures that modification capability is preserved where needed while optimization is applied where appropriate.
2Productivity
If all functions are translated to native machine code, then overall system performance improves, but the ability to modify specific functions deteriorates
Solution Approach 1:
The patent applies local quality by treating different functions differently based on their modification status. Swizzled functions are excluded from JIT translation to preserve their modifiability, while unswizzled functions undergo translation for optimization. This localized differentiation ensures that system performance is improved where possible without compromising the ease of modifying specific functions when needed.
3Adaptability or versatility
If JIT translation is prevented for swizzled functions, then modification capability is preserved, but execution performance for those functions deteriorates
Solution Approach 1:
The patent applies partial action by selectively preventing JIT translation only for swizzled functions while allowing translation for unswizzled functions. This partial prevention of translation preserves modification capability where needed without excessively impacting overall system performance, as only the subset of modified functions are excluded from optimization rather than all functions.
Data Source
AI summary
Techniques to facilitate prevention of just-in-time (JIT) translations of application functions are disclosed herein. In at least one implementation, a JIT translation function of an operating system is modified in memory to redirect the JIT translation function to execute alternative code when the JIT translation function is called. When the JIT translation function is called for an application function, the alternative code is executed to determine whether the application function has been modified. When the alternative code determines that the application function has been modified, the JIT translation function is prevented from translating the application function into a native machine code version. When the alternative code determines that the application function has not been modified, the JIT translation function is allowed to translate the application function into the native machine code version.


