├── README.md ├── art ├── Android应用源代码的保护与破解.pdf ├── Android插件化-1.pdf ├── md_anim │ ├── Transition.gif │ ├── ciecular_reveal.gif │ ├── custom_wujie.gif │ ├── custom_youjie.gif │ ├── custom_youjie_mask.gif │ ├── selectableItemBackground.gif │ ├── selectableItemBackgroundBorderless.gif │ ├── shareelement.gif │ └── shareelement.png └── progressdrawable.gif ├── source_code ├── IntentWrapper.java ├── arsc_about │ └── arsc_decode │ │ ├── README.md │ │ ├── constants.py │ │ ├── constants.pyc │ │ ├── parse.py │ │ ├── res │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── res_struct.py │ │ └── res_struct.pyc │ │ └── test ├── databinding │ └── CheckBoxBindingAdapter.java ├── hotfix_about │ └── hotfixdemo │ │ ├── .externalNativeBuild │ │ └── cmake │ │ │ ├── debug │ │ │ └── armeabi │ │ │ │ ├── .ninja_deps │ │ │ │ ├── .ninja_log │ │ │ │ ├── CMakeCache.txt │ │ │ │ ├── CMakeFiles │ │ │ │ ├── 3.6.0-rc2 │ │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ │ └── CMakeSystem.cmake │ │ │ │ ├── CMakeOutput.log │ │ │ │ ├── TargetDirectories.txt │ │ │ │ ├── cmake.check_cache │ │ │ │ └── native-lib.dir │ │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ └── cpp │ │ │ │ │ └── native-lib.cpp.o │ │ │ │ ├── android_gradle_build.json │ │ │ │ ├── build.ninja │ │ │ │ ├── cmake_build_command.txt │ │ │ │ ├── cmake_build_output.txt │ │ │ │ ├── cmake_install.cmake │ │ │ │ └── rules.ninja │ │ │ └── release │ │ │ └── armeabi │ │ │ ├── CMakeCache.txt │ │ │ ├── CMakeFiles │ │ │ ├── 3.6.0-rc2 │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ └── CMakeSystem.cmake │ │ │ ├── CMakeOutput.log │ │ │ ├── TargetDirectories.txt │ │ │ └── cmake.check_cache │ │ │ ├── android_gradle_build.json │ │ │ ├── build.ninja │ │ │ ├── cmake_build_command.txt │ │ │ ├── cmake_build_output.txt │ │ │ ├── cmake_install.cmake │ │ │ └── rules.ninja │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── build.gradle │ │ ├── hotfixdemo.iml │ │ ├── proguard-rules.pro │ │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── guolei │ │ │ └── hotfixdemo │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ │ └── native-lib.cpp │ │ ├── java │ │ │ └── com │ │ │ │ ├── guolei │ │ │ │ └── hotfixdemo │ │ │ │ │ ├── Log.java │ │ │ │ │ ├── LogFix.java │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ ├── MethodSizeCase.java │ │ │ │ │ ├── MyApplication.java │ │ │ │ │ ├── PatchResource.java │ │ │ │ │ ├── PatchSo.java │ │ │ │ │ ├── ReplaceUtil.java │ │ │ │ │ └── User.java │ │ │ │ └── tmall │ │ │ │ └── wireless │ │ │ │ └── jandfix │ │ │ │ ├── Constants.java │ │ │ │ ├── IMethodReplace.java │ │ │ │ ├── IMethodSize.java │ │ │ │ ├── MethodReplace5_0.java │ │ │ │ ├── MethodReplace5_1.java │ │ │ │ ├── MethodReplace6_0.java │ │ │ │ ├── MethodReplaceArt4_0.java │ │ │ │ ├── MethodReplaceDalvik4_0.java │ │ │ │ ├── MethodReplaceProxy.java │ │ │ │ ├── MethodSize5_1.java │ │ │ │ ├── MethodSize6_0.java │ │ │ │ ├── MethodSizeCase.java │ │ │ │ ├── MethodSizeUtils.java │ │ │ │ └── UnsafeProxy.java │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── guolei │ │ └── hotfixdemo │ │ └── ExampleUnitTest.java ├── nestedscroll │ └── StickNavLayout.java ├── plugin_about │ ├── Android插件化-1.pdf │ ├── Android插件化-2.pdf │ ├── README.md │ ├── plugin_1.apk │ ├── plugin_1 │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── plugin_1.iml │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── guolei │ │ │ │ └── plugin_1 │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── guolei │ │ │ │ │ └── plugin_1 │ │ │ │ │ ├── People.java │ │ │ │ │ ├── PluginActivity.java │ │ │ │ │ ├── PluginContentProvider.java │ │ │ │ │ └── PluginReceiver.java │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ └── activity_plugin.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── guolei │ │ │ └── plugin_1 │ │ │ └── ExampleUnitTest.java │ ├── plugin_so.apk │ ├── plugin_so │ │ ├── .externalNativeBuild │ │ │ └── cmake │ │ │ │ ├── debug │ │ │ │ └── armeabi │ │ │ │ │ ├── .ninja_deps │ │ │ │ │ ├── .ninja_log │ │ │ │ │ ├── CMakeCache.txt │ │ │ │ │ ├── CMakeFiles │ │ │ │ │ ├── 3.6.0-rc2 │ │ │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ │ │ └── CMakeSystem.cmake │ │ │ │ │ ├── CMakeOutput.log │ │ │ │ │ ├── TargetDirectories.txt │ │ │ │ │ ├── cmake.check_cache │ │ │ │ │ └── native-lib.dir │ │ │ │ │ │ └── src │ │ │ │ │ │ └── main │ │ │ │ │ │ └── cpp │ │ │ │ │ │ └── native-lib.cpp.o │ │ │ │ │ ├── android_gradle_build.json │ │ │ │ │ ├── build.ninja │ │ │ │ │ ├── cmake_build_command.txt │ │ │ │ │ ├── cmake_build_output.txt │ │ │ │ │ ├── cmake_install.cmake │ │ │ │ │ └── rules.ninja │ │ │ │ └── release │ │ │ │ └── armeabi │ │ │ │ ├── .ninja_deps │ │ │ │ ├── .ninja_log │ │ │ │ ├── CMakeCache.txt │ │ │ │ ├── CMakeFiles │ │ │ │ ├── 3.6.0-rc2 │ │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ │ └── CMakeSystem.cmake │ │ │ │ ├── CMakeOutput.log │ │ │ │ ├── TargetDirectories.txt │ │ │ │ ├── cmake.check_cache │ │ │ │ └── native-lib.dir │ │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ └── cpp │ │ │ │ │ └── native-lib.cpp.o │ │ │ │ ├── android_gradle_build.json │ │ │ │ ├── build.ninja │ │ │ │ ├── cmake_build_command.txt │ │ │ │ ├── cmake_build_output.txt │ │ │ │ ├── cmake_install.cmake │ │ │ │ └── rules.ninja │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── build.gradle │ │ ├── plugin_so.iml │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── guolei │ │ │ │ └── plugin_so │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── cpp │ │ │ │ └── native-lib.cpp │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── guolei │ │ │ │ │ └── so │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ └── activity_plugin.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── guolei │ │ │ └── plugin_so │ │ │ └── ExampleUnitTest.java │ ├── plugindemo-release-unsigned.apk │ ├── plugindemo │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── plugindemo.iml │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── guolei │ │ │ │ └── plugindemo │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── guolei │ │ │ │ │ └── plugindemo │ │ │ │ │ ├── Constants.java │ │ │ │ │ ├── DelegateContentProvider.java │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ ├── MyApplication.java │ │ │ │ │ ├── StubService.java │ │ │ │ │ ├── TestService.java │ │ │ │ │ ├── TwoActivity.java │ │ │ │ │ ├── binderhook │ │ │ │ │ └── BinderHookHandler.java │ │ │ │ │ └── core │ │ │ │ │ ├── ActivityManagerProxy.java │ │ │ │ │ └── HookInstrumentation.java │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ └── activity_two.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── guolei │ │ │ └── plugindemo │ │ │ └── ExampleUnitTest.java │ └── simpledex.jar └── simplerecyclerviewadapter │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ ├── simplerecyclerviewadapter.iml │ └── src │ ├── androidTest │ └── java │ │ └── guolei │ │ └── com │ │ └── simplerecyclerviewadapter │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ ├── guolei │ │ │ └── com │ │ │ │ └── simplerecyclerviewadapter │ │ │ │ ├── Item1.java │ │ │ │ ├── Item2.java │ │ │ │ ├── Item3.java │ │ │ │ ├── ItemEmpty.java │ │ │ │ └── MainActivity.java │ │ └── simpleadapter │ │ │ ├── BaseItem.java │ │ │ ├── BaseViewHolder.java │ │ │ └── SimpleRecyclerViewAdapter.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── item_1.xml │ │ ├── item_2.xml │ │ ├── item_3.xml │ │ ├── item_4.xml │ │ └── item_empty.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── guolei │ └── com │ └── simplerecyclerviewadapter │ └── ExampleUnitTest.java └── xposed_about ├── Android最强黑科技-Xposed.pdf └── out-dex2jar.jar /README.md: -------------------------------------------------------------------------------- 1 | # blog_resource 2 | my personal blog resource 3 | 4 | * Xposed简介以及去小米桌面广告的简单实现 [![](https://badge.juejin.im/entry/5a1017da51882575cb73b00d/likes.svg?style=flat-square)](https://juejin.im/post/5a1017acf265da432840713d) 5 | * [自定义双向绑定](https://github.com/Guolei1130/blog_resource/blob/master/source_code/databinding/CheckBoxBindingAdapter.java) 6 | * source_code/plugin_about 下为Android插件化相关代码及PDF,其中的所有代码均在Nexus 5,Android 6.0的Dalvik虚拟机下测试通过 7 | 8 | * [一个简单的MockServer](https://github.com/Guolei1130/SimpleMockServer) 9 | * [解析ARSC文件的 python脚本,但是目前还有点小问题](https://github.com/Guolei1130/blog_resource/tree/master/source_code/arsc_about/arsc_decode) 10 | [![](https://badge.juejin.im/entry/5ac5d0af518825557459ee6a/likes.svg?style=flat-square)](https://juejin.im/post/5ac5d015f265da239a600a72) 11 | -------------------------------------------------------------------------------- /art/Android应用源代码的保护与破解.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/Android应用源代码的保护与破解.pdf -------------------------------------------------------------------------------- /art/Android插件化-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/Android插件化-1.pdf -------------------------------------------------------------------------------- /art/md_anim/Transition.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/md_anim/Transition.gif -------------------------------------------------------------------------------- /art/md_anim/ciecular_reveal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/md_anim/ciecular_reveal.gif -------------------------------------------------------------------------------- /art/md_anim/custom_wujie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/md_anim/custom_wujie.gif -------------------------------------------------------------------------------- /art/md_anim/custom_youjie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/md_anim/custom_youjie.gif -------------------------------------------------------------------------------- /art/md_anim/custom_youjie_mask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/md_anim/custom_youjie_mask.gif -------------------------------------------------------------------------------- /art/md_anim/selectableItemBackground.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/md_anim/selectableItemBackground.gif -------------------------------------------------------------------------------- /art/md_anim/selectableItemBackgroundBorderless.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/md_anim/selectableItemBackgroundBorderless.gif -------------------------------------------------------------------------------- /art/md_anim/shareelement.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/md_anim/shareelement.gif -------------------------------------------------------------------------------- /art/md_anim/shareelement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/md_anim/shareelement.png -------------------------------------------------------------------------------- /art/progressdrawable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/art/progressdrawable.gif -------------------------------------------------------------------------------- /source_code/arsc_about/arsc_decode/README.md: -------------------------------------------------------------------------------- 1 | ### 解析ARSC的python脚本 2 | 3 | 目前还有点问题 4 | 5 | 参考的尼古拉斯赵四的java版解析 -------------------------------------------------------------------------------- /source_code/arsc_about/arsc_decode/constants.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: UTF-8 -*- 3 | 4 | 5 | resStringPoolChunkOffset = 0 6 | packageChunkOffset = 0 7 | keyStringPoolChunkOffset=0 8 | typeStringPoolChunkOffset=0 9 | 10 | resTypeOffset=0 -------------------------------------------------------------------------------- /source_code/arsc_about/arsc_decode/constants.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/arsc_about/arsc_decode/constants.pyc -------------------------------------------------------------------------------- /source_code/arsc_about/arsc_decode/parse.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: UTF-8 -*- 3 | 4 | import sys 5 | 6 | from struct import * 7 | 8 | import constants as constants 9 | import res.res_struct as rs 10 | 11 | def parseFile(params): 12 | if len(params) < 1: 13 | print "must have a file" 14 | exit(0) 15 | filePath = sys.argv[1] 16 | arscFile = open(filePath,"r+") 17 | 18 | # res_chunk_header = rs.res_chunk_header() 19 | # res_chunk_header.parse(arscFile) 20 | 21 | res_table_header = rs.res_table_header() 22 | res_table_header.parse(arscFile) 23 | 24 | res_string_pool_header = rs.res_string_pool_header() 25 | res_string_pool_header.parse(arscFile) 26 | 27 | res_package = rs.res_package() 28 | res_package.parse(arscFile) 29 | 30 | res_type_string_pool = rs.res_type_string_pool() 31 | res_type_string_pool.parse(arscFile) 32 | 33 | res_key_string_pool = rs.res_key_string_pool() 34 | res_key_string_pool.parse(arscFile) 35 | 36 | rs.parse_res(arscFile,filePath) 37 | 38 | 39 | arscFile.close() 40 | if __name__ == '__main__': 41 | 42 | parseFile(sys.argv) -------------------------------------------------------------------------------- /source_code/arsc_about/arsc_decode/res/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: UTF-8 -*- 3 | -------------------------------------------------------------------------------- /source_code/arsc_about/arsc_decode/res/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/arsc_about/arsc_decode/res/__init__.pyc -------------------------------------------------------------------------------- /source_code/arsc_about/arsc_decode/res/res_struct.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/arsc_about/arsc_decode/res/res_struct.pyc -------------------------------------------------------------------------------- /source_code/arsc_about/arsc_decode/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/arsc_about/arsc_decode/test -------------------------------------------------------------------------------- /source_code/databinding/CheckBoxBindingAdapter.java: -------------------------------------------------------------------------------- 1 | package com; 2 | 3 | // _ _ _ _ 4 | //__ _____ _ __| | _| |_(_) | ___ 5 | //\ \ /\ / / _ \| '__| |/ / __| | |/ _ \ 6 | // \ V V / (_) | | | <| |_| | | __/ 7 | // \_/\_/ \___/|_| |_|\_\\__|_|_|\___| 8 | 9 | 10 | import android.databinding.BindingAdapter; 11 | import android.databinding.BindingMethods; 12 | import android.databinding.InverseBindingAdapter; 13 | import android.databinding.InverseBindingListener; 14 | import android.widget.CheckBox; 15 | import android.widget.CompoundButton; 16 | 17 | /** 18 | * Copyright © 2013-2017 Worktile. All Rights Reserved. 19 | * Author: guolei 20 | * Email: 1120832563@qq.com 21 | * Date: 17/11/21 22 | * Time: 下午2:27 23 | * Desc: 24 | */ 25 | @BindingMethods({ 26 | 27 | }) 28 | public class CheckBoxBindingAdapter { 29 | 30 | @BindingAdapter("android:checked") 31 | public static void setChecked(CheckBox box, boolean checked) { 32 | if (box.isChecked() == checked) { 33 | return; 34 | } 35 | box.setChecked(checked); 36 | } 37 | 38 | @InverseBindingAdapter(attribute = "android:checked",event = "checkChangeListener") 39 | public static boolean getChecked(CheckBox box) { 40 | return box.isChecked(); 41 | } 42 | 43 | @BindingAdapter(value = {"checkChangeListener"}, requireAll = false) 44 | public static void setCheckChangeListener(CheckBox box, final InverseBindingListener checkChangeListener) { 45 | box.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { 46 | @Override 47 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 48 | if (checkChangeListener != null) { 49 | checkChangeListener.onChange(); 50 | } 51 | } 52 | }); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/.ninja_deps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/.ninja_deps -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/.ninja_log: -------------------------------------------------------------------------------- 1 | # ninja log v5 2 | 0 346 0 CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o cae960fe60d34b5b 3 | 347 453 0 ../../../../build/intermediates/cmake/debug/obj/armeabi/libnative-lib.so baf086bcaf754902 4 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/3.6.0-rc2/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "Clang") 4 | set(CMAKE_C_COMPILER_VERSION "") 5 | set(CMAKE_C_COMPILER_WRAPPER "") 6 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "") 7 | set(CMAKE_C_COMPILE_FEATURES "") 8 | set(CMAKE_C90_COMPILE_FEATURES "") 9 | set(CMAKE_C99_COMPILE_FEATURES "") 10 | set(CMAKE_C11_COMPILE_FEATURES "") 11 | 12 | set(CMAKE_C_PLATFORM_ID "") 13 | set(CMAKE_C_SIMULATE_ID "") 14 | set(CMAKE_C_SIMULATE_VERSION "") 15 | 16 | set(CMAKE_AR "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar") 17 | set(CMAKE_RANLIB "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ranlib") 18 | set(CMAKE_LINKER "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld") 19 | set(CMAKE_COMPILER_IS_GNUCC ) 20 | set(CMAKE_C_COMPILER_LOADED 1) 21 | set(CMAKE_C_COMPILER_WORKS TRUE) 22 | set(CMAKE_C_ABI_COMPILED TRUE) 23 | set(CMAKE_COMPILER_IS_MINGW ) 24 | set(CMAKE_COMPILER_IS_CYGWIN ) 25 | if(CMAKE_COMPILER_IS_CYGWIN) 26 | set(CYGWIN 1) 27 | set(UNIX 1) 28 | endif() 29 | 30 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 31 | 32 | if(CMAKE_COMPILER_IS_MINGW) 33 | set(MINGW 1) 34 | endif() 35 | set(CMAKE_C_COMPILER_ID_RUN 1) 36 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 37 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 38 | set(CMAKE_C_LINKER_PREFERENCE 10) 39 | 40 | # Save compiler ABI information. 41 | set(CMAKE_C_SIZEOF_DATA_PTR "4") 42 | set(CMAKE_C_COMPILER_ABI "ELF") 43 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 44 | 45 | if(CMAKE_C_SIZEOF_DATA_PTR) 46 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 47 | endif() 48 | 49 | if(CMAKE_C_COMPILER_ABI) 50 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 51 | endif() 52 | 53 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 54 | set(CMAKE_LIBRARY_ARCHITECTURE "") 55 | endif() 56 | 57 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 58 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 59 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 60 | endif() 61 | 62 | 63 | 64 | 65 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "dl;c;dl") 66 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x;/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/lib;/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm/usr/lib") 67 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 68 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/3.6.0-rc2/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "Clang") 4 | set(CMAKE_CXX_COMPILER_VERSION "") 5 | set(CMAKE_CXX_COMPILER_WRAPPER "") 6 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "") 7 | set(CMAKE_CXX_COMPILE_FEATURES "") 8 | set(CMAKE_CXX98_COMPILE_FEATURES "") 9 | set(CMAKE_CXX11_COMPILE_FEATURES "") 10 | set(CMAKE_CXX14_COMPILE_FEATURES "") 11 | 12 | set(CMAKE_CXX_PLATFORM_ID "") 13 | set(CMAKE_CXX_SIMULATE_ID "") 14 | set(CMAKE_CXX_SIMULATE_VERSION "") 15 | 16 | set(CMAKE_AR "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar") 17 | set(CMAKE_RANLIB "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ranlib") 18 | set(CMAKE_LINKER "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld") 19 | set(CMAKE_COMPILER_IS_GNUCXX ) 20 | set(CMAKE_CXX_COMPILER_LOADED 1) 21 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 22 | set(CMAKE_CXX_ABI_COMPILED TRUE) 23 | set(CMAKE_COMPILER_IS_MINGW ) 24 | set(CMAKE_COMPILER_IS_CYGWIN ) 25 | if(CMAKE_COMPILER_IS_CYGWIN) 26 | set(CYGWIN 1) 27 | set(UNIX 1) 28 | endif() 29 | 30 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 31 | 32 | if(CMAKE_COMPILER_IS_MINGW) 33 | set(MINGW 1) 34 | endif() 35 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 36 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 37 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) 38 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 39 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 40 | 41 | # Save compiler ABI information. 42 | set(CMAKE_CXX_SIZEOF_DATA_PTR "4") 43 | set(CMAKE_CXX_COMPILER_ABI "ELF") 44 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 45 | 46 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 47 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 48 | endif() 49 | 50 | if(CMAKE_CXX_COMPILER_ABI) 51 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 52 | endif() 53 | 54 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 55 | set(CMAKE_LIBRARY_ARCHITECTURE "") 56 | endif() 57 | 58 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 59 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 60 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 61 | endif() 62 | 63 | 64 | 65 | 66 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;dl;c;dl") 67 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x;/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/lib;/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm/usr/lib") 68 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 69 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/3.6.0-rc2/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Darwin-15.6.0") 2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin") 3 | set(CMAKE_HOST_SYSTEM_VERSION "15.6.0") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | include("/Users/guolei/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake") 7 | 8 | set(CMAKE_SYSTEM "Android-19") 9 | set(CMAKE_SYSTEM_NAME "Android") 10 | set(CMAKE_SYSTEM_VERSION "19") 11 | set(CMAKE_SYSTEM_PROCESSOR "armv5te") 12 | 13 | set(CMAKE_CROSSCOMPILING "TRUE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/edit_cache.dir 2 | /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/rebuild_cache.dir 3 | /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/native-lib.dir 4 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/android_gradle_build.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "buildFiles" : [ "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/CMakeLists.txt" ], 4 | "cleanCommands" : 5 | [ 6 | "/Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/cmake --build /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi --target clean" 7 | ], 8 | "cppFileExtensions" : [ "cpp" ], 9 | "libraries" : 10 | { 11 | "native-lib-Debug-armeabi" : 12 | { 13 | "abi" : "armeabi", 14 | "artifactName" : "native-lib", 15 | "buildCommand" : "/Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/cmake --build /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi --target native-lib", 16 | "buildType" : "debug", 17 | "files" : 18 | [ 19 | 20 | { 21 | "flags" : " -target armv5te-none-linux-androideabi -gcc-toolchain /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm -Dnative_lib_EXPORTS -isystem /Users/guolei/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /Users/guolei/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -isystem /Users/guolei/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -O0 -fno-limit-debug-info -O0 -fno-limit-debug-info -fPIC -c ", 22 | "src" : "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/src/main/cpp/native-lib.cpp", 23 | "workingDirectory" : "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi" 24 | } 25 | ], 26 | "output" : "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/build/intermediates/cmake/debug/obj/armeabi/libnative-lib.so", 27 | "toolchain" : "14328697835032828871" 28 | } 29 | }, 30 | "toolchains" : 31 | { 32 | "14328697835032828871" : 33 | { 34 | "cCompilerExecutable" : "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang", 35 | "cppCompilerExecutable" : "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++" 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/cmake_build_command.txt: -------------------------------------------------------------------------------- 1 | Executable : /Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/cmake 2 | arguments : 3 | -H/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo 4 | -B/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi 5 | -GAndroid Gradle - Ninja 6 | -DANDROID_ABI=armeabi 7 | -DANDROID_NDK=/Users/guolei/Library/Android/sdk/ndk-bundle 8 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/build/intermediates/cmake/debug/obj/armeabi 9 | -DCMAKE_BUILD_TYPE=Debug 10 | -DCMAKE_MAKE_PROGRAM=/Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/ninja 11 | -DCMAKE_TOOLCHAIN_FILE=/Users/guolei/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake 12 | -DANDROID_PLATFORM=android-19 13 | -DCMAKE_CXX_FLAGS= 14 | jvmArgs : 15 | 16 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/cmake_build_output.txt: -------------------------------------------------------------------------------- 1 | -- Check for working C compiler: /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang 2 | -- Check for working C compiler: /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- works 3 | -- Detecting C compiler ABI info 4 | -- Detecting C compiler ABI info - done 5 | -- Detecting C compile features 6 | -- Detecting C compile features - done 7 | -- Check for working CXX compiler: /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ 8 | -- Check for working CXX compiler: /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -- works 9 | -- Detecting CXX compiler ABI info 10 | -- Detecting CXX compiler ABI info - done 11 | -- Detecting CXX compile features 12 | -- Detecting CXX compile features - done 13 | -- Configuring done 14 | -- Generating done 15 | -- Build files have been written to: /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi 16 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "0") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi/rules.ninja: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Ninja" Generator, CMake Version 3.6 3 | 4 | # This file contains all the rules used to get the outputs files 5 | # built from the input files. 6 | # It is included in the main 'build.ninja'. 7 | 8 | # ============================================================================= 9 | # Project: Project 10 | # Configuration: Debug 11 | # ============================================================================= 12 | # ============================================================================= 13 | 14 | ############################################# 15 | # Rule for running custom commands. 16 | 17 | rule CUSTOM_COMMAND 18 | command = $COMMAND 19 | description = $DESC 20 | 21 | 22 | ############################################# 23 | # Rule for compiling CXX files. 24 | 25 | rule CXX_COMPILER__native-lib 26 | depfile = $DEP_FILE 27 | deps = gcc 28 | command = /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target armv5te-none-linux-androideabi -gcc-toolchain /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $IN_ABS 29 | description = Building CXX object $out 30 | 31 | 32 | ############################################# 33 | # Rule for linking CXX shared library. 34 | 35 | rule CXX_SHARED_LIBRARY_LINKER__native-lib 36 | command = $PRE_LINK && /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target armv5te-none-linux-androideabi -gcc-toolchain /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm -fPIC $LANGUAGE_COMPILE_FLAGS $ARCH_FLAGS $LINK_FLAGS -shared $SONAME_FLAG$SONAME -o $TARGET_FILE $in $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 37 | description = Linking CXX shared library $TARGET_FILE 38 | restat = $RESTAT 39 | 40 | 41 | ############################################# 42 | # Rule for re-running cmake. 43 | 44 | rule RERUN_CMAKE 45 | command = /Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/cmake -H/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo -B/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/debug/armeabi 46 | description = Re-running CMake... 47 | generator = 1 48 | 49 | 50 | ############################################# 51 | # Rule for cleaning all built files. 52 | 53 | rule CLEAN 54 | command = /Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/ninja -t clean 55 | description = Cleaning all built files... 56 | 57 | 58 | ############################################# 59 | # Rule for printing all primary targets available. 60 | 61 | rule HELP 62 | command = /Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/ninja -t targets 63 | description = All primary targets available: 64 | 65 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/3.6.0-rc2/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "Clang") 4 | set(CMAKE_C_COMPILER_VERSION "") 5 | set(CMAKE_C_COMPILER_WRAPPER "") 6 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "") 7 | set(CMAKE_C_COMPILE_FEATURES "") 8 | set(CMAKE_C90_COMPILE_FEATURES "") 9 | set(CMAKE_C99_COMPILE_FEATURES "") 10 | set(CMAKE_C11_COMPILE_FEATURES "") 11 | 12 | set(CMAKE_C_PLATFORM_ID "") 13 | set(CMAKE_C_SIMULATE_ID "") 14 | set(CMAKE_C_SIMULATE_VERSION "") 15 | 16 | set(CMAKE_AR "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar") 17 | set(CMAKE_RANLIB "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ranlib") 18 | set(CMAKE_LINKER "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld") 19 | set(CMAKE_COMPILER_IS_GNUCC ) 20 | set(CMAKE_C_COMPILER_LOADED 1) 21 | set(CMAKE_C_COMPILER_WORKS TRUE) 22 | set(CMAKE_C_ABI_COMPILED TRUE) 23 | set(CMAKE_COMPILER_IS_MINGW ) 24 | set(CMAKE_COMPILER_IS_CYGWIN ) 25 | if(CMAKE_COMPILER_IS_CYGWIN) 26 | set(CYGWIN 1) 27 | set(UNIX 1) 28 | endif() 29 | 30 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 31 | 32 | if(CMAKE_COMPILER_IS_MINGW) 33 | set(MINGW 1) 34 | endif() 35 | set(CMAKE_C_COMPILER_ID_RUN 1) 36 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 37 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 38 | set(CMAKE_C_LINKER_PREFERENCE 10) 39 | 40 | # Save compiler ABI information. 41 | set(CMAKE_C_SIZEOF_DATA_PTR "4") 42 | set(CMAKE_C_COMPILER_ABI "ELF") 43 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 44 | 45 | if(CMAKE_C_SIZEOF_DATA_PTR) 46 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 47 | endif() 48 | 49 | if(CMAKE_C_COMPILER_ABI) 50 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 51 | endif() 52 | 53 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 54 | set(CMAKE_LIBRARY_ARCHITECTURE "") 55 | endif() 56 | 57 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 58 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 59 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 60 | endif() 61 | 62 | 63 | 64 | 65 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "dl;c;dl") 66 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x;/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/lib;/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm/usr/lib") 67 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 68 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/3.6.0-rc2/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "Clang") 4 | set(CMAKE_CXX_COMPILER_VERSION "") 5 | set(CMAKE_CXX_COMPILER_WRAPPER "") 6 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "") 7 | set(CMAKE_CXX_COMPILE_FEATURES "") 8 | set(CMAKE_CXX98_COMPILE_FEATURES "") 9 | set(CMAKE_CXX11_COMPILE_FEATURES "") 10 | set(CMAKE_CXX14_COMPILE_FEATURES "") 11 | 12 | set(CMAKE_CXX_PLATFORM_ID "") 13 | set(CMAKE_CXX_SIMULATE_ID "") 14 | set(CMAKE_CXX_SIMULATE_VERSION "") 15 | 16 | set(CMAKE_AR "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar") 17 | set(CMAKE_RANLIB "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ranlib") 18 | set(CMAKE_LINKER "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld") 19 | set(CMAKE_COMPILER_IS_GNUCXX ) 20 | set(CMAKE_CXX_COMPILER_LOADED 1) 21 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 22 | set(CMAKE_CXX_ABI_COMPILED TRUE) 23 | set(CMAKE_COMPILER_IS_MINGW ) 24 | set(CMAKE_COMPILER_IS_CYGWIN ) 25 | if(CMAKE_COMPILER_IS_CYGWIN) 26 | set(CYGWIN 1) 27 | set(UNIX 1) 28 | endif() 29 | 30 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 31 | 32 | if(CMAKE_COMPILER_IS_MINGW) 33 | set(MINGW 1) 34 | endif() 35 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 36 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 37 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) 38 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 39 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 40 | 41 | # Save compiler ABI information. 42 | set(CMAKE_CXX_SIZEOF_DATA_PTR "4") 43 | set(CMAKE_CXX_COMPILER_ABI "ELF") 44 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 45 | 46 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 47 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 48 | endif() 49 | 50 | if(CMAKE_CXX_COMPILER_ABI) 51 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 52 | endif() 53 | 54 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 55 | set(CMAKE_LIBRARY_ARCHITECTURE "") 56 | endif() 57 | 58 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 59 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 60 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 61 | endif() 62 | 63 | 64 | 65 | 66 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;dl;c;dl") 67 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x;/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/lib;/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm/usr/lib") 68 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 69 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Guolei1130/blog_resource/7c64c7772555378ed3a621802a82c33529d94051/source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/3.6.0-rc2/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Darwin-15.6.0") 2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin") 3 | set(CMAKE_HOST_SYSTEM_VERSION "15.6.0") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | include("/Users/guolei/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake") 7 | 8 | set(CMAKE_SYSTEM "Android-19") 9 | set(CMAKE_SYSTEM_NAME "Android") 10 | set(CMAKE_SYSTEM_VERSION "19") 11 | set(CMAKE_SYSTEM_PROCESSOR "armv5te") 12 | 13 | set(CMAKE_CROSSCOMPILING "TRUE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/edit_cache.dir 2 | /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/rebuild_cache.dir 3 | /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/native-lib.dir 4 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/android_gradle_build.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "buildFiles" : [ "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/CMakeLists.txt" ], 4 | "cleanCommands" : 5 | [ 6 | "/Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/cmake --build /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi --target clean" 7 | ], 8 | "cppFileExtensions" : [ "cpp" ], 9 | "libraries" : 10 | { 11 | "native-lib-Release-armeabi" : 12 | { 13 | "abi" : "armeabi", 14 | "artifactName" : "native-lib", 15 | "buildCommand" : "/Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/cmake --build /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi --target native-lib", 16 | "buildType" : "release", 17 | "files" : 18 | [ 19 | 20 | { 21 | "flags" : " -target armv5te-none-linux-androideabi -gcc-toolchain /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm -Dnative_lib_EXPORTS -isystem /Users/guolei/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /Users/guolei/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -isystem /Users/guolei/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -Os -DNDEBUG -Os -DNDEBUG -fPIC -c ", 22 | "src" : "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/src/main/cpp/native-lib.cpp", 23 | "workingDirectory" : "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi" 24 | } 25 | ], 26 | "output" : "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/build/intermediates/cmake/release/obj/armeabi/libnative-lib.so", 27 | "toolchain" : "14328697835032828871" 28 | } 29 | }, 30 | "toolchains" : 31 | { 32 | "14328697835032828871" : 33 | { 34 | "cCompilerExecutable" : "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang", 35 | "cppCompilerExecutable" : "/Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++" 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/cmake_build_command.txt: -------------------------------------------------------------------------------- 1 | Executable : /Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/cmake 2 | arguments : 3 | -H/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo 4 | -B/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi 5 | -GAndroid Gradle - Ninja 6 | -DANDROID_ABI=armeabi 7 | -DANDROID_NDK=/Users/guolei/Library/Android/sdk/ndk-bundle 8 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/build/intermediates/cmake/release/obj/armeabi 9 | -DCMAKE_BUILD_TYPE=Release 10 | -DCMAKE_MAKE_PROGRAM=/Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/ninja 11 | -DCMAKE_TOOLCHAIN_FILE=/Users/guolei/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake 12 | -DANDROID_PLATFORM=android-19 13 | -DCMAKE_CXX_FLAGS= 14 | jvmArgs : 15 | 16 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/cmake_build_output.txt: -------------------------------------------------------------------------------- 1 | -- Check for working C compiler: /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang 2 | -- Check for working C compiler: /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- works 3 | -- Detecting C compiler ABI info 4 | -- Detecting C compiler ABI info - done 5 | -- Detecting C compile features 6 | -- Detecting C compile features - done 7 | -- Check for working CXX compiler: /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ 8 | -- Check for working CXX compiler: /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -- works 9 | -- Detecting CXX compiler ABI info 10 | -- Detecting CXX compiler ABI info - done 11 | -- Detecting CXX compile features 12 | -- Detecting CXX compile features - done 13 | -- Configuring done 14 | -- Generating done 15 | -- Build files have been written to: /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi 16 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /Users/guolei/AndroidStudioProjects/Demo/hotfixdemo 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Release") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "0") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.externalNativeBuild/cmake/release/armeabi/rules.ninja: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Ninja" Generator, CMake Version 3.6 3 | 4 | # This file contains all the rules used to get the outputs files 5 | # built from the input files. 6 | # It is included in the main 'build.ninja'. 7 | 8 | # ============================================================================= 9 | # Project: Project 10 | # Configuration: Release 11 | # ============================================================================= 12 | # ============================================================================= 13 | 14 | ############################################# 15 | # Rule for running custom commands. 16 | 17 | rule CUSTOM_COMMAND 18 | command = $COMMAND 19 | description = $DESC 20 | 21 | 22 | ############################################# 23 | # Rule for compiling CXX files. 24 | 25 | rule CXX_COMPILER__native-lib 26 | depfile = $DEP_FILE 27 | deps = gcc 28 | command = /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target armv5te-none-linux-androideabi -gcc-toolchain /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $IN_ABS 29 | description = Building CXX object $out 30 | 31 | 32 | ############################################# 33 | # Rule for linking CXX shared library. 34 | 35 | rule CXX_SHARED_LIBRARY_LINKER__native-lib 36 | command = $PRE_LINK && /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target armv5te-none-linux-androideabi -gcc-toolchain /Users/guolei/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/guolei/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm -fPIC $LANGUAGE_COMPILE_FLAGS $ARCH_FLAGS $LINK_FLAGS -shared $SONAME_FLAG$SONAME -o $TARGET_FILE $in $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 37 | description = Linking CXX shared library $TARGET_FILE 38 | restat = $RESTAT 39 | 40 | 41 | ############################################# 42 | # Rule for re-running cmake. 43 | 44 | rule RERUN_CMAKE 45 | command = /Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/cmake -H/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo -B/Users/guolei/AndroidStudioProjects/Demo/hotfixdemo/.externalNativeBuild/cmake/release/armeabi 46 | description = Re-running CMake... 47 | generator = 1 48 | 49 | 50 | ############################################# 51 | # Rule for cleaning all built files. 52 | 53 | rule CLEAN 54 | command = /Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/ninja -t clean 55 | description = Cleaning all built files... 56 | 57 | 58 | ############################################# 59 | # Rule for printing all primary targets available. 60 | 61 | rule HELP 62 | command = /Users/guolei/Library/Android/sdk/cmake/3.6.3155560/bin/ninja -t targets 63 | description = All primary targets available: 64 | 65 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html 3 | 4 | # Sets the minimum version of CMake required to build the native library. 5 | 6 | cmake_minimum_required(VERSION 3.4.1) 7 | 8 | 9 | # Creates and names a library, sets it as either STATIC 10 | # or SHARED, and provides the relative paths to its source code. 11 | # You can define multiple libraries, and CMake builds them for you. 12 | # Gradle automatically packages shared libraries with your APK. 13 | 14 | add_library( # Sets the name of the library. 15 | native-lib 16 | 17 | # Sets the library as a shared library. 18 | SHARED 19 | 20 | # Provides a relative path to your source file(s). 21 | src/main/cpp/native-lib.cpp 22 | ) 23 | 24 | # Searches for a specified prebuilt library and stores the path as a 25 | # variable. Because CMake includes system libraries in the search path by 26 | # default, you only need to specify the name of the public NDK library 27 | # you want to add. CMake verifies that the library exists before 28 | # completing its build. 29 | 30 | find_library( # Sets the name of the path variable. 31 | log-lib 32 | 33 | # Specifies the name of the NDK library that 34 | # you want CMake to locate. 35 | log ) 36 | 37 | # Specifies libraries CMake should link to your target library. You 38 | # can link multiple libraries, such as libraries you define in this 39 | # build script, prebuilt third-party libraries, or system libraries. 40 | 41 | target_link_libraries( # Specifies the target library. 42 | native-lib 43 | 44 | # Links the target library to the log library 45 | # included in the NDK. 46 | ${log-lib} 47 | ) -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.2" 6 | 7 | 8 | defaultConfig { 9 | applicationId "com.guolei.hotfixdemo" 10 | minSdkVersion 19 11 | targetSdkVersion 26 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | externalNativeBuild { 17 | cmake { 18 | cppFlags "" 19 | } 20 | } 21 | ndk { 22 | abiFilters 'armeabi' 23 | } 24 | } 25 | 26 | buildTypes { 27 | release { 28 | minifyEnabled false 29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 30 | } 31 | } 32 | 33 | 34 | externalNativeBuild { 35 | cmake { 36 | path "CMakeLists.txt" 37 | } 38 | } 39 | } 40 | 41 | dependencies { 42 | compile fileTree(dir: 'libs', include: ['*.jar']) 43 | compile 'com.android.support:appcompat-v7:26.1.0' 44 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 45 | testCompile 'junit:junit:4.12' 46 | androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', { 47 | exclude group: 'com.android.support', module: 'support-annotations' 48 | }) 49 | } 50 | 51 | apply plugin: 'patch-gradle-plugin' 52 | patchPlugin{ 53 | enable = true//如果enable为true则表明打出的包会在每个类的构造函数中注入代码 54 | } 55 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/androidTest/java/com/guolei/hotfixdemo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.guolei.hotfixdemo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.guolei.hotfixdemo", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/cpp/native-lib.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | extern "C" 6 | JNIEXPORT jstring 7 | JNICALL 8 | Java_com_guolei_hotfixdemo_MainActivity_stringFromJNI( 9 | JNIEnv *env, 10 | jobject /* this */) { 11 | std::string hello = "Hello from so"; 12 | return env->NewStringUTF(hello.c_str()); 13 | } 14 | 15 | extern "C" 16 | JNIEXPORT void JNICALL 17 | Java_com_guolei_hotfixdemo_MainActivity_replace(JNIEnv *env, 18 | jobject instance, 19 | jlong src, 20 | jlong des, 21 | jint size) { 22 | 23 | memcpy((void*)src, (void*)des, (size_t) size); 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/guolei/hotfixdemo/Log.java: -------------------------------------------------------------------------------- 1 | package com.guolei.hotfixdemo; 2 | 3 | // _ _ _ _ 4 | //__ _____ _ __| | _| |_(_) | ___ 5 | //\ \ /\ / / _ \| '__| |/ / __| | |/ _ \ 6 | // \ V V / (_) | | | <| |_| | | __/ 7 | // \_/\_/ \___/|_| |_|\_\\__|_|_|\___| 8 | 9 | 10 | /** 11 | * Copyright © 2013-2017 Worktile. All Rights Reserved. 12 | * Author: guolei 13 | * Email: 1120832563@qq.com 14 | * Date: 18/4/4 15 | * Time: 下午2:42 16 | * Desc: 17 | */ 18 | public class Log { 19 | 20 | public void log(){ 21 | android.util.Log.e("hotfix", "log: " ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/guolei/hotfixdemo/LogFix.java: -------------------------------------------------------------------------------- 1 | package com.guolei.hotfixdemo; 2 | 3 | // _ _ _ _ 4 | //__ _____ _ __| | _| |_(_) | ___ 5 | //\ \ /\ / / _ \| '__| |/ / __| | |/ _ \ 6 | // \ V V / (_) | | | <| |_| | | __/ 7 | // \_/\_/ \___/|_| |_|\_\\__|_|_|\___| 8 | 9 | 10 | /** 11 | * Copyright © 2013-2017 Worktile. All Rights Reserved. 12 | * Author: guolei 13 | * Email: 1120832563@qq.com 14 | * Date: 18/4/4 15 | * Time: 下午2:43 16 | * Desc: 17 | */ 18 | public class LogFix { 19 | public void log(){ 20 | android.util.Log.e("hotfix", "log: fix fix fix " ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/guolei/hotfixdemo/MethodSizeCase.java: -------------------------------------------------------------------------------- 1 | package com.guolei.hotfixdemo; 2 | 3 | // _ _ _ _ 4 | //__ _____ _ __| | _| |_(_) | ___ 5 | //\ \ /\ / / _ \| '__| |/ / __| | |/ _ \ 6 | // \ V V / (_) | | | <| |_| | | __/ 7 | // \_/\_/ \___/|_| |_|\_\\__|_|_|\___| 8 | 9 | 10 | /** 11 | * Copyright © 2013-2017 Worktile. All Rights Reserved. 12 | * Author: guolei 13 | * Email: 1120832563@qq.com 14 | * Date: 18/4/4 15 | * Time: 下午2:29 16 | * Desc: 17 | */ 18 | public class MethodSizeCase { 19 | public void method_1() { 20 | 21 | } 22 | 23 | public void method_2() { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/guolei/hotfixdemo/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.guolei.hotfixdemo; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | 7 | // _ _ _ _ 8 | //__ _____ _ __| | _| |_(_) | ___ 9 | //\ \ /\ / / _ \| '__| |/ / __| | |/ _ \ 10 | // \ V V / (_) | | | <| |_| | | __/ 11 | // \_/\_/ \___/|_| |_|\_\\__|_|_|\___| 12 | 13 | 14 | /** 15 | * Copyright © 2013-2017 Worktile. All Rights Reserved. 16 | * Author: guolei 17 | * Email: 1120832563@qq.com 18 | * Date: 18/4/2 19 | * Time: 上午10:30 20 | * Desc: 21 | */ 22 | public class MyApplication extends Application { 23 | 24 | @Override 25 | public void onCreate() { 26 | super.onCreate(); 27 | } 28 | 29 | @Override 30 | protected void attachBaseContext(Context base) { 31 | super.attachBaseContext(base); 32 | if (getSharedPreferences("hotfix", 0).getBoolean("enable_so", false)) { 33 | PatchSo.pathSo(base,"/sdcard/so_fix.apk"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/guolei/hotfixdemo/User.java: -------------------------------------------------------------------------------- 1 | package com.guolei.hotfixdemo; 2 | 3 | // _ _ _ _ 4 | //__ _____ _ __| | _| |_(_) | ___ 5 | //\ \ /\ / / _ \| '__| |/ / __| | |/ _ \ 6 | // \ V V / (_) | | | <| |_| | | __/ 7 | // \_/\_/ \___/|_| |_|\_\\__|_|_|\___| 8 | 9 | 10 | import java.util.Locale; 11 | 12 | /** 13 | * Copyright © 2013-2017 Worktile. All Rights Reserved. 14 | * Author: guolei 15 | * Email: 1120832563@qq.com 16 | * Date: 18/4/2 17 | * Time: 上午11:02 18 | * Desc: 19 | */ 20 | public class User { 21 | 22 | private String mUserName; 23 | private int mAge; 24 | 25 | public User(String userName, int age) { 26 | mUserName = userName; 27 | mAge = age; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return String.format(Locale.getDefault(), "origin:[username:%s,age:%d]", mUserName, mAge); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/Constants.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | /** 4 | * Created by jingchaoqinjc on 17/5/18. 5 | */ 6 | 7 | public interface Constants { 8 | 9 | int INVALID_SIZE = -1; 10 | } 11 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/IMethodReplace.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | /** 6 | * Created by jingchaoqinjc on 17/5/15. 7 | */ 8 | 9 | public interface IMethodReplace { 10 | 11 | public void replace(Method src, Method dest); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/IMethodSize.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | /** 4 | * Created by jingchaoqinjc on 17/5/16. 5 | */ 6 | 7 | public interface IMethodSize { 8 | 9 | int methodSize() throws Exception; 10 | 11 | int methodIndexOffset() throws Exception; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/MethodReplace5_0.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | 4 | import java.lang.reflect.Field; 5 | import java.lang.reflect.Method; 6 | import java.lang.reflect.Modifier; 7 | 8 | /** 9 | * Created by jingchaoqinjc on 17/5/15. 10 | */ 11 | 12 | public class MethodReplace5_0 implements IMethodReplace { 13 | 14 | 15 | static Field artMethodField; 16 | 17 | static { 18 | try { 19 | Class absMethodClass = Class.forName("java.lang.reflect.AbstractMethod"); 20 | artMethodField = absMethodClass.getDeclaredField("artMethod"); 21 | artMethodField.setAccessible(true); 22 | } catch (Exception e) { 23 | e.printStackTrace(); 24 | } 25 | } 26 | 27 | @Override 28 | public void replace(Method src, Method dest) { 29 | try { 30 | Object o1 = artMethodField.get(src); 31 | Object o2 = artMethodField.get(dest); 32 | replaceReal(o1, o2); 33 | } catch (Exception e) { 34 | e.printStackTrace(); 35 | } 36 | } 37 | 38 | private void replaceReal(Object src, Object dest) { 39 | Class c = src.getClass(); 40 | try { 41 | while (c != Object.class) { 42 | for (Field f : c.getDeclaredFields()) { 43 | f.setAccessible(true); 44 | if ((f.getModifiers() & Modifier.STATIC) == 0) { 45 | if (!f.getName().equals("declaringClass") && !f.getName().equals("methodIndex")) 46 | f.set(src, f.get(dest)); 47 | } 48 | } 49 | c = c.getSuperclass(); 50 | } 51 | } catch (Exception e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/MethodReplace5_1.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | import java.lang.reflect.Field; 4 | import java.lang.reflect.Method; 5 | 6 | /** 7 | * Created by jingchaoqinjc on 17/5/15. 8 | */ 9 | 10 | public class MethodReplace5_1 implements IMethodReplace { 11 | 12 | static Field artMethodField; 13 | 14 | static { 15 | try { 16 | Class absMethodClass = Class.forName("java.lang.reflect.AbstractMethod"); 17 | artMethodField = absMethodClass.getDeclaredField("artMethod"); 18 | artMethodField.setAccessible(true); 19 | } catch (Exception e) { 20 | e.printStackTrace(); 21 | } 22 | } 23 | 24 | @Override 25 | public void replace(Method src, Method dest) { 26 | try { 27 | Object o1 = artMethodField.get(src); 28 | Object o2 = artMethodField.get(dest); 29 | replaceReal(o1, o2); 30 | } catch (Exception e) { 31 | e.printStackTrace(); 32 | } 33 | } 34 | 35 | private void replaceReal(Object src, Object dest) throws Exception { 36 | int methodSize = MethodSizeUtils.methodSize(); 37 | int methodIndexOffset = MethodSizeUtils.methodIndexOffset(); 38 | //methodIndex need not replace,becase the process of finding method in vtable 39 | int methodIndexOffsetIndex = methodIndexOffset / 4; 40 | //why 1? index 0 is declaring_class, declaring_class need not replace. 41 | for (int i = 1, size = methodSize / 4; i < size; i++) { 42 | if (i != methodIndexOffsetIndex) { 43 | int value = UnsafeProxy.getIntVolatile(dest, i * 4); 44 | UnsafeProxy.putIntVolatile(src, i * 4, value); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/MethodReplace6_0.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | import java.lang.reflect.Field; 4 | import java.lang.reflect.Method; 5 | 6 | /** 7 | * Created by jingchaoqinjc on 17/5/15. 8 | */ 9 | 10 | public class MethodReplace6_0 implements IMethodReplace { 11 | 12 | static Field artMethodField; 13 | 14 | static { 15 | try { 16 | Class absMethodClass = Class.forName("java.lang.reflect.AbstractMethod"); 17 | artMethodField = absMethodClass.getDeclaredField("artMethod"); 18 | artMethodField.setAccessible(true); 19 | } catch (Exception e) { 20 | e.printStackTrace(); 21 | } 22 | } 23 | 24 | 25 | @Override 26 | public void replace(Method src, Method dest) { 27 | try { 28 | long artMethodSrc = (long) artMethodField.get(src); 29 | long artMethodDest = (long) artMethodField.get(dest); 30 | replaceReal(artMethodSrc, artMethodDest); 31 | } catch (Exception e) { 32 | e.printStackTrace(); 33 | } 34 | } 35 | 36 | private void replaceReal(long src, long dest) throws Exception { 37 | int methodSize = MethodSizeUtils.methodSize(); 38 | int methodIndexOffset = MethodSizeUtils.methodIndexOffset(); 39 | //methodIndex need not replace,becase the process of finding method in vtable 40 | int methodIndexOffsetIndex = methodIndexOffset / 4; 41 | //why 1? index 0 is declaring_class, declaring_class need not replace. 42 | for (int i = 1, size = methodSize / 4; i < size; i++) { 43 | if (i != methodIndexOffsetIndex) { 44 | int value = UnsafeProxy.getIntVolatile(dest + i * 4); 45 | UnsafeProxy.putIntVolatile(src + i * 4, value); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/MethodReplaceArt4_0.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | /** 6 | * Created by jingchaoqinjc on 17/5/15. 7 | */ 8 | 9 | public class MethodReplaceArt4_0 implements IMethodReplace{ 10 | @Override 11 | public void replace(Method src, Method dest) { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/MethodReplaceProxy.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import android.os.Build; 6 | 7 | /** 8 | * Created by jingchaoqinjc on 17/5/15. 9 | */ 10 | 11 | public class MethodReplaceProxy implements IMethodReplace { 12 | 13 | private IMethodReplace realReplace; 14 | 15 | private MethodReplaceProxy() { 16 | init(); 17 | } 18 | 19 | private void init() { 20 | if (Build.VERSION.SDK_INT >= 14 && Build.VERSION.SDK_INT < 21) { 21 | realReplace = new MethodReplaceDalvik4_0(); 22 | } else if (Build.VERSION.SDK_INT == 21) { 23 | realReplace = new MethodReplace5_0(); 24 | } else if (Build.VERSION.SDK_INT == 22) { 25 | realReplace = new MethodReplace5_1(); 26 | } else if (Build.VERSION.SDK_INT >= 23) { 27 | realReplace = new MethodReplace6_0(); 28 | } 29 | } 30 | 31 | public static MethodReplaceProxy instance() { 32 | return Holder.instance; 33 | } 34 | 35 | @Override 36 | public void replace(Method src, Method dest) { 37 | realReplace.replace(src, dest); 38 | } 39 | 40 | private static class Holder { 41 | static MethodReplaceProxy instance = new MethodReplaceProxy(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/MethodSize5_1.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | import java.lang.reflect.Field; 4 | import java.lang.reflect.Method; 5 | 6 | /** 7 | * Created by jingchaoqinjc on 17/5/16. 8 | */ 9 | 10 | public class MethodSize5_1 implements IMethodSize { 11 | 12 | private static int size =Constants.INVALID_SIZE; 13 | private static int methodIndexOffset = Constants.INVALID_SIZE; 14 | 15 | static { 16 | try { 17 | Field artMethodField; 18 | Class absMethodClass = Class.forName("java.lang.reflect.AbstractMethod"); 19 | artMethodField = absMethodClass.getDeclaredField("artMethod"); 20 | artMethodField.setAccessible(true); 21 | 22 | //init size 23 | Method method1 = MethodSizeCase.class.getDeclaredMethod("method1"); 24 | Method method2 = MethodSizeCase.class.getDeclaredMethod("method2"); 25 | 26 | Object object1 = artMethodField.get(method1); 27 | Object object2 = artMethodField.get(method2); 28 | 29 | long method1Addr = UnsafeProxy.getObjectAddress(object1); 30 | long method2Addr = UnsafeProxy.getObjectAddress(object2); 31 | size = (int) (method2Addr - method1Addr); 32 | if (size < 0) { 33 | size = -size; 34 | } 35 | 36 | //init methodIndexOffset 37 | Class artMethodClass = object1.getClass(); 38 | Field methodIndexField = artMethodClass.getDeclaredField("methodIndex"); 39 | 40 | methodIndexOffset = UnsafeProxy.objectFieldOffset(methodIndexField); 41 | } catch (Exception e) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | 46 | @Override 47 | public int methodSize() throws Exception { 48 | return size; 49 | } 50 | 51 | @Override 52 | public int methodIndexOffset() throws Exception { 53 | return methodIndexOffset; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/MethodSize6_0.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | import java.lang.reflect.Field; 4 | import java.lang.reflect.Method; 5 | 6 | /** 7 | * Created by jingchaoqinjc on 17/5/16. 8 | */ 9 | 10 | public class MethodSize6_0 implements IMethodSize { 11 | 12 | private static int methodSize = Constants.INVALID_SIZE; 13 | private static int methodIndexOffset = Constants.INVALID_SIZE; 14 | 15 | static Field artMethodField; 16 | 17 | static { 18 | try { 19 | Class absMethodClass = Class.forName("java.lang.reflect.AbstractMethod"); 20 | artMethodField = absMethodClass.getDeclaredField("artMethod"); 21 | artMethodField.setAccessible(true); 22 | 23 | //init size 24 | Method method1 = MethodSizeCase.class.getDeclaredMethod("method1"); 25 | Method method2 = MethodSizeCase.class.getDeclaredMethod("method2"); 26 | Method method3 = MethodSizeCase.class.getDeclaredMethod("method3"); 27 | 28 | long method1Addr = (long) artMethodField.get(method1); 29 | long method2Addr = (long) artMethodField.get(method2); 30 | long method3Addr = (long) artMethodField.get(method3); 31 | methodSize = (int) (method2Addr - method1Addr); 32 | if (methodSize < 0) { 33 | methodSize = -methodSize; 34 | } 35 | 36 | //init methodIndexOffset 37 | int method1MethodIndex = 0; 38 | Method[] methods = MethodSizeCase.class.getDeclaredMethods(); 39 | for (int i = 0, size = methods.length; i < size; i++) { 40 | if (methods[i].equals(method1)) { 41 | //why +1? Becase "FindVirtualMethodForVirtualOrInterface(method, sizeof(void*))" has the offset of sizeof(void*) 42 | method1MethodIndex = i + 1; 43 | break; 44 | } 45 | } 46 | 47 | for (int i = 1, size = methodSize / 4; i < size; i++) { 48 | int value1 = UnsafeProxy.getIntVolatile(method1Addr + i * 4); 49 | int value2 = UnsafeProxy.getIntVolatile(method2Addr + i * 4); 50 | int value3 = UnsafeProxy.getIntVolatile(method3Addr + i * 4); 51 | if (value1 == method1MethodIndex 52 | && value2 == method1MethodIndex + 1 53 | && value3 == method1MethodIndex + 2) { 54 | methodIndexOffset = i * 4; 55 | } 56 | } 57 | 58 | } catch (Exception e) { 59 | e.printStackTrace(); 60 | } 61 | } 62 | 63 | @Override 64 | public int methodSize() throws Exception { 65 | return methodSize; 66 | } 67 | 68 | @Override 69 | public int methodIndexOffset() throws Exception { 70 | return methodIndexOffset; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/MethodSizeCase.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | /** 4 | * Created by jingchaoqinjc on 17/5/16. 5 | */ 6 | public final class MethodSizeCase { 7 | 8 | private void method1() { 9 | } 10 | 11 | private void method2() { 12 | } 13 | 14 | private void method3() { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/java/com/tmall/wireless/jandfix/MethodSizeUtils.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.jandfix; 2 | 3 | import android.os.Build; 4 | 5 | /** 6 | * Created by jingchaoqinjc on 17/5/16. 7 | */ 8 | 9 | public class MethodSizeUtils { 10 | 11 | private static int size = Constants.INVALID_SIZE; 12 | private static IMethodSize methodSize = null; 13 | private static int methodIndexOffset = Constants.INVALID_SIZE; 14 | 15 | static { 16 | if (Build.VERSION.SDK_INT >= 14 && Build.VERSION.SDK_INT < 21) { 17 | } else if (Build.VERSION.SDK_INT == 21) { 18 | } else if (Build.VERSION.SDK_INT == 22) { 19 | methodSize = new MethodSize5_1(); 20 | } else if (Build.VERSION.SDK_INT >= 23) { 21 | methodSize = new MethodSize6_0(); 22 | } 23 | } 24 | 25 | public static int methodSize() throws Exception { 26 | if (size == Constants.INVALID_SIZE) { 27 | size = methodSize.methodSize(); 28 | } 29 | if(size == Constants.INVALID_SIZE){ 30 | throw new RuntimeException(); 31 | } 32 | return size; 33 | } 34 | 35 | public static int methodIndexOffset() throws Exception { 36 | if (methodIndexOffset == Constants.INVALID_SIZE) { 37 | methodIndexOffset = methodSize.methodIndexOffset(); 38 | } 39 | 40 | if(methodIndexOffset == Constants.INVALID_SIZE){ 41 | throw new RuntimeException(); 42 | } 43 | 44 | return methodIndexOffset; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /source_code/hotfix_about/hotfixdemo/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 |