提交 65384c18 编写于 作者: 囧jt's avatar 囧jt

modify:

[Android]-add DoKitMCHummerHelper.java
上级 fac6f52b
......@@ -116,7 +116,6 @@ public class SlideBar extends FrameLayout {
}
@Override
@SuppressLint("ClickableViewAccessibility")
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
......@@ -132,6 +131,7 @@ public class SlideBar extends FrameLayout {
mText.setAlpha(0);
setPressed(true);
}
event.setAction(MotionEvent.ACTION_DOWN);
} else if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_OUTSIDE) {
if (sliderPosition >= (getMeasuredWidth() - thumbWidth) * 0.7) {
//到70%就行
......@@ -141,6 +141,7 @@ public class SlideBar extends FrameLayout {
}
sliding = false;
setPressed(false);
event.setAction(MotionEvent.ACTION_UP);
} else if (event.getAction() == MotionEvent.ACTION_MOVE && sliding) {
sliderPosition = (int) (initialSliderPosition + (event.getX() - initialSlidingX));
if (sliderPosition <= 0) sliderPosition = 0;
......@@ -153,6 +154,7 @@ public class SlideBar extends FrameLayout {
mText.setAlpha(0);
}
setMarginLeftExtra(sliderPosition);
event.setAction(MotionEvent.ACTION_MOVE);
}
return true;
}
......
......@@ -20,7 +20,9 @@ import org.objectweb.asm.tree.ClassNode
open class AbsClassTransformer : ClassTransformer {
fun onCommInterceptor(context: TransformContext, klass: ClassNode): Boolean {
"===onCommInterceptor--->$this====${klass.className}===".println()
if (context.isRelease()) {
return true
}
......
......@@ -23,7 +23,7 @@ import org.objectweb.asm.tree.VarInsnNode
*/
//@Priority(1)
//@AutoService(ClassTransformer::class)
class BigImgTransformer : AbsClassTransformer() {
class BigImgClassTransformer : AbsClassTransformer() {
override fun transform(context: TransformContext, klass: ClassNode): ClassNode {
if (onCommInterceptor(context, klass)) {
......
......@@ -23,7 +23,7 @@ import org.objectweb.asm.tree.*
*/
//@Priority(0)
//@AutoService(ClassTransformer::class)
class CommTransformer : AbsClassTransformer() {
class CommClassTransformer : AbsClassTransformer() {
private val SHADOW_URL =
......
......@@ -25,7 +25,7 @@ import org.objectweb.asm.tree.*
*/
//@Priority(3)
//@AutoService(ClassTransformer::class)
class EnterMethodStackTransformer : AbsClassTransformer() {
class EnterMSClassTransformer : AbsClassTransformer() {
private val thresholdTime = DoKitExtUtil.slowMethodExt.stackMethod.thresholdTime
private val level = 0
......
......@@ -16,13 +16,13 @@ import org.objectweb.asm.tree.*
* 作 者:jint(金台)
* 版 本:1.0
* 创建日期:2020/5/14-18:07
* 描 述:全局业务代码慢函数 wiki:https://juejin.im/post/5e8d87c4f265da47ad218e6b
* 描 述:全局慢函数业务代码慢函数 wiki:https://juejin.im/post/5e8d87c4f265da47ad218e6b
* 修订历史:
* ================================================
*/
//@Priority(2)
//@AutoService(ClassTransformer::class)
class GlobalSlowMethodTransformer : AbsClassTransformer() {
class GSMClassTransformer : AbsClassTransformer() {
val thresholdTime = DoKitExtUtil.slowMethodExt.normalMethod.thresholdTime
override fun transform(context: TransformContext, klass: ClassNode): ClassNode {
......
package com.didichuxing.doraemonkit.plugin.transform
import com.didichuxing.doraemonkit.plugin.asmtransformer.DoKitAsmTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.BigImgTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.CommTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.EnterMethodStackTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.GlobalSlowMethodTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.BigImgClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.CommClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.EnterMSClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.GSMClassTransformer
import com.didiglobal.booster.transform.Transformer
import org.gradle.api.Project
......@@ -18,10 +18,10 @@ class DoKitCommTransform(androidProject: Project) : DoKitBaseTransform(androidPr
override val transformers = listOf<Transformer>(
DoKitAsmTransformer(
listOf(
CommTransformer(),
BigImgTransformer(),
GlobalSlowMethodTransformer(),
EnterMethodStackTransformer()
CommClassTransformer(),
BigImgClassTransformer(),
GSMClassTransformer(),
EnterMSClassTransformer()
)
)
)
......
......@@ -2,10 +2,10 @@ package com.didichuxing.doraemonkit.plugin.transform
import com.android.build.api.variant.VariantInfo
import com.didichuxing.doraemonkit.plugin.asmtransformer.DoKitAsmTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.BigImgTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.CommTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.EnterMethodStackTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.GlobalSlowMethodTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.BigImgClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.CommClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.EnterMSClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.GSMClassTransformer
import com.didiglobal.booster.transform.Transformer
import org.gradle.api.Project
......@@ -15,10 +15,10 @@ internal class DoKitCommTransformV34(project: Project) : DoKitBaseTransform(proj
override val transformers = listOf<Transformer>(
DoKitAsmTransformer(
listOf(
CommTransformer(),
BigImgTransformer(),
GlobalSlowMethodTransformer(),
EnterMethodStackTransformer()
CommClassTransformer(),
BigImgClassTransformer(),
GSMClassTransformer(),
EnterMSClassTransformer()
)
)
)
......
......@@ -8,7 +8,7 @@ ext {
//1:依赖dokit远程aar运行
run_type : 0,
group_id : 'io.github.didi.dokit',
version : '3.4.3.106'
version : '3.4.3.107'
]
android = [compileSdkVersion : 29,
......
package com.didichuxing.doraemonkit.kit.mc.ability
import android.view.MotionEvent
import android.view.View
import com.didichuxing.doraemonkit.DoKit
import com.didichuxing.doraemonkit.constant.WSMode
......@@ -7,6 +8,7 @@ import com.didichuxing.doraemonkit.kit.core.DoKitManager
import com.didichuxing.doraemonkit.kit.core.DokitAbility
import com.didichuxing.doraemonkit.kit.mc.all.DoKitMcManager
import com.didichuxing.doraemonkit.kit.mc.all.hook.View_onClickListenerEventHook
import com.didichuxing.doraemonkit.kit.mc.all.hook.View_onTouchEventHook
import com.didichuxing.doraemonkit.kit.mc.client.ClientDokitView
import com.didichuxing.doraemonkit.kit.mc.server.HostDokitView
import com.didichuxing.doraemonkit.kit.mc.server.RecordingDokitView
......@@ -66,6 +68,10 @@ class DokitMcModuleProcessor : DokitAbility.DokitModuleProcessor {
View.OnClickListener::class.java, View_onClickListenerEventHook()
)
// DexposedBridge.findAndHookMethod(
// View::class.java, "onTouchEvent", MotionEvent::class.java,
// View_onTouchEventHook()
// )
}
else -> {
......
......@@ -3,6 +3,7 @@ package com.didichuxing.doraemonkit.kit.mc.all.ui
import android.annotation.SuppressLint
import android.os.Build
import android.os.Bundle
import android.view.MotionEvent
import android.view.View
import android.view.accessibility.AccessibilityEvent
import android.view.accessibility.AccessibilityManager
......@@ -18,6 +19,7 @@ import com.didichuxing.doraemonkit.kit.mc.all.DoKitWindowManager
import com.didichuxing.doraemonkit.kit.mc.all.hook.AccessibilityGetInstanceMethodHook
import com.didichuxing.doraemonkit.kit.mc.all.hook.View_onClickListenerEventHook
import com.didichuxing.doraemonkit.kit.mc.all.hook.View_onInitializeAccessibilityEventHook
import com.didichuxing.doraemonkit.kit.mc.all.hook.View_onTouchEventHook
import com.didichuxing.doraemonkit.kit.mc.server.DoKitWsServer
import com.didichuxing.doraemonkit.kit.mc.server.HostDokitView
import com.didichuxing.doraemonkit.kit.mc.util.CodeUtils
......@@ -87,15 +89,6 @@ class DoKitMcHostFragment : BaseFragment() {
//对于Android9.0以下的系统 需要反射将AccessibilityManager.mIsEnabled变量改成true
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
McHookUtil.hookAccessibilityManager(activity)
// val sendAccessibilityEventInternalMethod = XposedHelpers.findMethodExact(
// View::class.java,
// "sendAccessibilityEventInternal",
// Int::class.java
// )
// DexposedBridge.hookMethod(
// sendAccessibilityEventInternalMethod,
// View_sendAccessibilityEventInternalHook()
// )
}
//绕过无障碍的权限
......@@ -104,54 +97,36 @@ class DoKitMcHostFragment : BaseFragment() {
"isEnabled",
AccessibilityGetInstanceMethodHook()
)
//hook sendAccessibilityEventUnchecked
// val sendAccessibilityEventUncheckedMethod = XposedHelpers.findMethodExact(
// View::class.java,
// "sendAccessibilityEventUnchecked",
// AccessibilityEvent::class.java
// )
// DexposedBridge.hookMethod(
// sendAccessibilityEventUncheckedMethod,
// View_sendAccessibilityEventUncheckedHook()
// )
// val sendAccessibilityEventUncheckedInternalMethod = XposedHelpers.findMethodExact(
//hook onInitializeAccessibilityEvent
// val onInitializeAccessibilityEventMethod = XposedHelpers.findMethodExact(
// View::class.java,
// "sendAccessibilityEventUncheckedInternal",
// "onInitializeAccessibilityEvent",
// AccessibilityEvent::class.java
// )
// DexposedBridge.hookMethod(
// sendAccessibilityEventUncheckedInternalMethod,
// View_sendAccessibilityEventUncheckedInternalHook()
// onInitializeAccessibilityEventMethod,
// View_onInitializeAccessibilityEventHook()
// )
//hook onInitializeAccessibilityEvent
val onInitializeAccessibilityEventMethod = XposedHelpers.findMethodExact(
DexposedBridge.findAndHookMethod(
View::class.java,
"onInitializeAccessibilityEvent",
AccessibilityEvent::class.java
)
DexposedBridge.hookMethod(
onInitializeAccessibilityEventMethod,
AccessibilityEvent::class.java,
View_onInitializeAccessibilityEventHook()
)
// DexposedBridge.findAndHookMethod(
// View.OnClickListener::class.java, "onClick", View::class.java,
// View_onClickListenerEventHook()
// )
//hook OnTouchListener#onTouch
// val onTouchEventMethod = XposedHelpers.findMethodExact(
//hook View#onTouchEvent
// val onTouchEventEventMethod = XposedHelpers.findMethodExact(
// View::class.java,
// "onTouchEvent",
// MotionEvent::class.java
// )
//
// DexposedBridge.hookMethod(onTouchEventMethod, View_onTouchEventHook())
// DexposedBridge.hookMethod(
// onTouchEventEventMethod,
// View_onTouchEventHook()
// )
} catch (e: Exception) {
e.printStackTrace()
......
package com.didichuxing.doraemonkit.kit.mc.client
/**
* ================================================
* 作 者:jint(金台)
* 版 本:1.0
* 创建日期:2021/9/2-11:05
* 描 述:从机同步执行失败
* 修订历史:
* ================================================
*/
interface ClientSyncFailedListener {
}
\ No newline at end of file
package com.didichuxing.doraemonkit.kit.mc.client
/**
* ================================================
* 作 者:jint(金台)
* 版 本:1.0
* 创建日期:2021/9/2-11:05
* 描 述:从机同步执行成功
* 修订历史:
* ================================================
*/
interface ClientSyncSucceededListener {
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import com.didichuxing.doraemonkit.mc.R
import com.didichuxing.doraemonkit.util.ConvertUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
......@@ -29,7 +30,26 @@ import kotlinx.coroutines.launch
class RecordingDokitView : AbsDokitView() {
private var mRedDot: View? = null
private var mExtend: TextView? = null
private lateinit var mDotFlow: Flow<Int>
private lateinit var mEllipsisFlow: Flow<Int>
override fun onCreate(context: Context?) {
mDotFlow = flow {
while (true) {
emit(0)
delay(500)
emit(1)
delay(500)
}
}
mEllipsisFlow = flow {
while (true) {
(0..3).forEach {
emit(it)
delay(500)
}
}
}
}
override fun onCreateView(context: Context?, rootView: FrameLayout?): View {
......@@ -41,14 +61,7 @@ class RecordingDokitView : AbsDokitView() {
mRedDot = findViewById(R.id.red_dot)
mExtend = findViewById(R.id.tv_extend)
doKitViewScope.launch {
flow {
while (true) {
emit(0)
delay(500)
emit(1)
delay(500)
}
}.flowOn(Dispatchers.IO)
mDotFlow.flowOn(Dispatchers.IO)
.collect {
when (it) {
0 -> mRedDot?.visibility = View.VISIBLE
......@@ -61,14 +74,7 @@ class RecordingDokitView : AbsDokitView() {
doKitViewScope.launch {
flow {
while (true) {
(0..3).forEach {
emit(it)
delay(500)
}
}
}.flowOn(Dispatchers.IO)
mEllipsisFlow.flowOn(Dispatchers.IO)
.collect {
when (it) {
0 -> mExtend?.text = ""
......
......@@ -20,7 +20,9 @@ import org.objectweb.asm.tree.ClassNode
open class AbsClassTransformer : ClassTransformer {
fun onCommInterceptor(context: TransformContext, klass: ClassNode): Boolean {
"===onCommInterceptor--->$this====${klass.className}===".println()
if (context.isRelease()) {
return true
}
......
......@@ -23,7 +23,7 @@ import org.objectweb.asm.tree.VarInsnNode
*/
//@Priority(1)
//@AutoService(ClassTransformer::class)
class BigImgTransformer : AbsClassTransformer() {
class BigImgClassTransformer : AbsClassTransformer() {
override fun transform(context: TransformContext, klass: ClassNode): ClassNode {
if (onCommInterceptor(context, klass)) {
......
......@@ -23,7 +23,7 @@ import org.objectweb.asm.tree.*
*/
//@Priority(0)
//@AutoService(ClassTransformer::class)
class CommTransformer : AbsClassTransformer() {
class CommClassTransformer : AbsClassTransformer() {
private val SHADOW_URL =
......
......@@ -25,7 +25,7 @@ import org.objectweb.asm.tree.*
*/
//@Priority(3)
//@AutoService(ClassTransformer::class)
class EnterMethodStackTransformer : AbsClassTransformer() {
class EnterMSClassTransformer : AbsClassTransformer() {
private val thresholdTime = DoKitExtUtil.slowMethodExt.stackMethod.thresholdTime
private val level = 0
......
......@@ -16,13 +16,13 @@ import org.objectweb.asm.tree.*
* 作 者:jint(金台)
* 版 本:1.0
* 创建日期:2020/5/14-18:07
* 描 述:全局业务代码慢函数 wiki:https://juejin.im/post/5e8d87c4f265da47ad218e6b
* 描 述:全局慢函数业务代码慢函数 wiki:https://juejin.im/post/5e8d87c4f265da47ad218e6b
* 修订历史:
* ================================================
*/
//@Priority(2)
//@AutoService(ClassTransformer::class)
class GlobalSlowMethodTransformer : AbsClassTransformer() {
class GSMClassTransformer : AbsClassTransformer() {
val thresholdTime = DoKitExtUtil.slowMethodExt.normalMethod.thresholdTime
override fun transform(context: TransformContext, klass: ClassNode): ClassNode {
......
package com.didichuxing.doraemonkit.plugin.transform
import com.didichuxing.doraemonkit.plugin.asmtransformer.DoKitAsmTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.BigImgTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.CommTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.EnterMethodStackTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.GlobalSlowMethodTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.BigImgClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.CommClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.EnterMSClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.GSMClassTransformer
import com.didiglobal.booster.transform.Transformer
import org.gradle.api.Project
......@@ -18,10 +18,10 @@ class DoKitCommTransform(androidProject: Project) : DoKitBaseTransform(androidPr
override val transformers = listOf<Transformer>(
DoKitAsmTransformer(
listOf(
CommTransformer(),
BigImgTransformer(),
GlobalSlowMethodTransformer(),
EnterMethodStackTransformer()
CommClassTransformer(),
BigImgClassTransformer(),
GSMClassTransformer(),
EnterMSClassTransformer()
)
)
)
......
......@@ -2,10 +2,10 @@ package com.didichuxing.doraemonkit.plugin.transform
import com.android.build.api.variant.VariantInfo
import com.didichuxing.doraemonkit.plugin.asmtransformer.DoKitAsmTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.BigImgTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.CommTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.EnterMethodStackTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.GlobalSlowMethodTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.BigImgClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.CommClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.EnterMSClassTransformer
import com.didichuxing.doraemonkit.plugin.classtransformer.GSMClassTransformer
import com.didiglobal.booster.transform.Transformer
import org.gradle.api.Project
......@@ -15,10 +15,10 @@ internal class DoKitCommTransformV34(project: Project) : DoKitBaseTransform(proj
override val transformers = listOf<Transformer>(
DoKitAsmTransformer(
listOf(
CommTransformer(),
BigImgTransformer(),
GlobalSlowMethodTransformer(),
EnterMethodStackTransformer()
CommClassTransformer(),
BigImgClassTransformer(),
GSMClassTransformer(),
EnterMSClassTransformer()
)
)
)
......
package com.didichuxing.doraemonkit.rpc;
package com.didichuxing.doraemonkit;
import android.view.View;
......
{
"allAbis": [
"armeabi-v7a",
"arm64-v8a",
"x86",
"x86_64"
],
"validAbis": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
]
}
\ No newline at end of file
{
"ndkHandlerSupportedAbis": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
],
"ndkHandlerDefaultAbis": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
],
"externalNativeBuildAbiFilters": [],
"ndkConfigAbiFilters": [],
"splitsFilterAbis": [],
"ideBuildOnlyTargetAbi": true
}
\ No newline at end of file
{
"allAbis": [
"armeabi-v7a",
"arm64-v8a",
"x86",
"x86_64"
],
"validAbis": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
]
}
\ No newline at end of file
{
"ndkHandlerSupportedAbis": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
],
"ndkHandlerDefaultAbis": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
],
"externalNativeBuildAbiFilters": [],
"ndkConfigAbiFilters": [
"armeabi-v7a",
"x86_64",
"arm64-v8a",
"x86"
],
"splitsFilterAbis": [],
"ideBuildOnlyTargetAbi": true
}
\ No newline at end of file
# This is the CMakeCache file.
# For build in directory: /Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86
# It was generated by CMake: /Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
//No help, variable specified on the command line.
ANDROID_ABI:UNINITIALIZED=x86
//No help, variable specified on the command line.
ANDROID_NDK:UNINITIALIZED=/Users/didi/Library/Android/sdk/ndk/21.4.7075529
//No help, variable specified on the command line.
ANDROID_PLATFORM:UNINITIALIZED=android-16
//No help, variable specified on the command line.
CMAKE_ANDROID_ARCH_ABI:UNINITIALIZED=x86
//No help, variable specified on the command line.
CMAKE_ANDROID_NDK:UNINITIALIZED=/Users/didi/Library/Android/sdk/ndk/21.4.7075529
//Archiver
CMAKE_AR:FILEPATH=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ar
//Flags used by the compiler during all build types.
CMAKE_ASM_FLAGS:STRING=
//Flags used by the compiler during debug builds.
CMAKE_ASM_FLAGS_DEBUG:STRING=
//Flags used by the compiler during release builds.
CMAKE_ASM_FLAGS_RELEASE:STRING=
//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=Debug
//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=
//Flags used by the compiler during debug builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=
//Flags used by the compiler during release builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=
//LLVM archiver
CMAKE_C_COMPILER_AR:FILEPATH=CMAKE_C_COMPILER_AR-NOTFOUND
//Generate index for LLVM archive
CMAKE_C_COMPILER_RANLIB:FILEPATH=CMAKE_C_COMPILER_RANLIB-NOTFOUND
//Flags used by the compiler during all build types.
CMAKE_C_FLAGS:STRING=
//Flags used by the compiler during debug builds.
CMAKE_C_FLAGS_DEBUG:STRING=
//Flags used by the compiler during release builds for minimum
// size.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the compiler during release builds.
CMAKE_C_FLAGS_RELEASE:STRING=
//Flags used by the compiler during release builds with debug info.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//Libraries linked by default with all C applications.
CMAKE_C_STANDARD_LIBRARIES:STRING=-latomic -lm
//Flags used by the linker.
CMAKE_EXE_LINKER_FLAGS:STRING=
//Flags used by the linker during debug builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON
//No help, variable specified on the command line.
CMAKE_FIND_ROOT_PATH:UNINITIALIZED=/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/prefab/x86/prefab
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
//No help, variable specified on the command line.
CMAKE_LIBRARY_OUTPUT_DIRECTORY:UNINITIALIZED=/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build/intermediates/cmake/debug/obj/x86
//Path to a program.
CMAKE_LINKER:FILEPATH=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ld
//No help, variable specified on the command line.
CMAKE_MAKE_PROGRAM:UNINITIALIZED=/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja
//Flags used by the linker during the creation of modules.
CMAKE_MODULE_LINKER_FLAGS:STRING=
//Flags used by the linker during debug builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_NM:FILEPATH=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-nm
//Path to a program.
CMAKE_OBJCOPY:FILEPATH=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-objcopy
//Path to a program.
CMAKE_OBJDUMP:FILEPATH=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-objdump
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=libxhook
//Ranlib
CMAKE_RANLIB:FILEPATH=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ranlib
//No help, variable specified on the command line.
CMAKE_RUNTIME_OUTPUT_DIRECTORY:UNINITIALIZED=/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build/intermediates/cmake/debug/obj/x86
//Flags used by the linker during the creation of dll's.
CMAKE_SHARED_LINKER_FLAGS:STRING=
//Flags used by the linker during debug builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO
//Flags used by the linker during the creation of static libraries.
CMAKE_STATIC_LINKER_FLAGS:STRING=
//Flags used by the linker during debug builds.
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_STRIP:FILEPATH=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-strip
//No help, variable specified on the command line.
CMAKE_SYSTEM_NAME:UNINITIALIZED=Android
//No help, variable specified on the command line.
CMAKE_SYSTEM_VERSION:UNINITIALIZED=16
//The CMake toolchain file
CMAKE_TOOLCHAIN_FILE:FILEPATH=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake
//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make. This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
//Value Computed by CMake
libxhook_BINARY_DIR:STATIC=/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86
//Value Computed by CMake
libxhook_SOURCE_DIR:STATIC=/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook
//Path to a library.
log-lib:FILEPATH=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16/liblog.so
//Dependencies for the target
xhook_LIB_DEPENDS:STATIC=general;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16/liblog.so;
########################
# INTERNAL cache entries
########################
//ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=10
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=2
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ctest
//ADVANCED property for variable: CMAKE_C_COMPILER_AR
CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB
CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES
CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Ninja
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook
//Install .so files without execute permission.
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RANLIB
CMAKE_RANLIB-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STRIP
CMAKE_STRIP-ADVANCED:INTERNAL=1
//uname command
CMAKE_UNAME:INTERNAL=/usr/bin/uname
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
set(CMAKE_C_COMPILER "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang")
set(CMAKE_C_COMPILER_ARG1 "")
set(CMAKE_C_COMPILER_ID "Clang")
set(CMAKE_C_COMPILER_VERSION "9.0")
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
set(CMAKE_C_COMPILER_WRAPPER "")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
set(CMAKE_C_PLATFORM_ID "")
set(CMAKE_C_SIMULATE_ID "")
set(CMAKE_C_SIMULATE_VERSION "")
set(CMAKE_AR "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ar")
set(CMAKE_C_COMPILER_AR "CMAKE_C_COMPILER_AR-NOTFOUND")
set(CMAKE_RANLIB "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ranlib")
set(CMAKE_C_COMPILER_RANLIB "CMAKE_C_COMPILER_RANLIB-NOTFOUND")
set(CMAKE_LINKER "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ld")
set(CMAKE_COMPILER_IS_GNUCC )
set(CMAKE_C_COMPILER_LOADED 1)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_C_ABI_COMPILED TRUE)
set(CMAKE_COMPILER_IS_MINGW )
set(CMAKE_COMPILER_IS_CYGWIN )
if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1)
set(UNIX 1)
endif()
set(CMAKE_C_COMPILER_ENV_VAR "CC")
if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_C_COMPILER_ID_RUN 1)
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_C_LINKER_PREFERENCE 10)
# Save compiler ABI information.
set(CMAKE_C_SIZEOF_DATA_PTR "4")
set(CMAKE_C_COMPILER_ABI "ELF")
set(CMAKE_C_LIBRARY_ARCHITECTURE "")
if(CMAKE_C_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_C_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
endif()
if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "")
endif()
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;dl;c;gcc;dl")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/9.0.9/lib/linux/i386;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/i686-linux-android/lib;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
set(CMAKE_HOST_SYSTEM "Darwin-20.3.0")
set(CMAKE_HOST_SYSTEM_NAME "Darwin")
set(CMAKE_HOST_SYSTEM_VERSION "20.3.0")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
include("/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake")
set(CMAKE_SYSTEM "Android-1")
set(CMAKE_SYSTEM_NAME "Android")
set(CMAKE_SYSTEM_VERSION "1")
set(CMAKE_SYSTEM_PROCESSOR "i686")
set(CMAKE_CROSSCOMPILING "TRUE")
set(CMAKE_SYSTEM_LOADED 1)
The target system is: Android - 1 - i686
The host system is: Darwin - 20.3.0 - x86_64
Determining if the C compiler works passed with the following output:
Change Dir: /Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/CMakeFiles/CMakeTmp
Run Build Command:"/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja" "cmTC_eb4af"
[1/2] Building C object CMakeFiles/cmTC_eb4af.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_eb4af
Detecting C compiler ABI info compiled with the following output:
Change Dir: /Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/CMakeFiles/CMakeTmp
Run Build Command:"/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja" "cmTC_ecd80"
[1/2] Building C object CMakeFiles/cmTC_ecd80.dir/CMakeCCompilerABI.c.o
[2/2] Linking C executable cmTC_ecd80
Android (7019983 based on r365631c3) clang version 9.0.9 (https://android.googlesource.com/toolchain/llvm-project a2a1e703c0edb03ba29944e529ccbf457742737b) (based on LLVM 9.0.9svn)
Target: i686-none-linux-android16
Thread model: posix
InstalledDir: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin
Found candidate GCC installation: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x
Found candidate GCC installation: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/x86_64-linux-android/4.9.x
Selected GCC installation: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x
Candidate multilib: .;@m32
Selected multilib: .;@m32
"/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld" --sysroot=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -pie -z noexecstack --warn-shared-textrel -z now -z relro --hash-style=both --enable-new-dtags --eh-frame-hdr -m elf_i386 -dynamic-linker /system/bin/linker -o cmTC_ecd80 /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16/crtbegin_dynamic.o -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/9.0.9/lib/linux/i386 -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16 -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/lib -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib --exclude-libs libgcc.a --exclude-libs libgcc_real.a --exclude-libs libatomic.a --build-id --fatal-warnings --no-undefined --gc-sections CMakeFiles/cmTC_ecd80.dir/CMakeCCompilerABI.c.o -lgcc -ldl -lc -lgcc -ldl /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16/crtend_android.o
Parsed C implicit link information from above output:
link line regex: [^( *|.*[/\])(i686-linux-android-ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command:"/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja" "cmTC_ecd80"]
ignore line: [[1/2] Building C object CMakeFiles/cmTC_ecd80.dir/CMakeCCompilerABI.c.o]
ignore line: [[2/2] Linking C executable cmTC_ecd80]
ignore line: [Android (7019983 based on r365631c3) clang version 9.0.9 (https://android.googlesource.com/toolchain/llvm-project a2a1e703c0edb03ba29944e529ccbf457742737b) (based on LLVM 9.0.9svn)]
ignore line: [Target: i686-none-linux-android16]
ignore line: [Thread model: posix]
ignore line: [InstalledDir: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin]
ignore line: [Found candidate GCC installation: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x]
ignore line: [Found candidate GCC installation: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/x86_64-linux-android/4.9.x]
ignore line: [Selected GCC installation: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x]
ignore line: [Candidate multilib: .]
ignore line: [@m32]
ignore line: [Selected multilib: .]
ignore line: [@m32]
link line: [ "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld" --sysroot=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -pie -z noexecstack --warn-shared-textrel -z now -z relro --hash-style=both --enable-new-dtags --eh-frame-hdr -m elf_i386 -dynamic-linker /system/bin/linker -o cmTC_ecd80 /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16/crtbegin_dynamic.o -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/9.0.9/lib/linux/i386 -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16 -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/lib -L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib --exclude-libs libgcc.a --exclude-libs libgcc_real.a --exclude-libs libatomic.a --build-id --fatal-warnings --no-undefined --gc-sections CMakeFiles/cmTC_ecd80.dir/CMakeCCompilerABI.c.o -lgcc -ldl -lc -lgcc -ldl /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16/crtend_android.o]
arg [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld] ==> ignore
arg [--sysroot=/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot] ==> ignore
arg [-pie] ==> ignore
arg [-znoexecstack] ==> ignore
arg [--warn-shared-textrel] ==> ignore
arg [-znow] ==> ignore
arg [-zrelro] ==> ignore
arg [--hash-style=both] ==> ignore
arg [--enable-new-dtags] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [-m] ==> ignore
arg [elf_i386] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/system/bin/linker] ==> ignore
arg [-o] ==> ignore
arg [cmTC_ecd80] ==> ignore
arg [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16/crtbegin_dynamic.o] ==> ignore
arg [-L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/9.0.9/lib/linux/i386] ==> dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/9.0.9/lib/linux/i386]
arg [-L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x] ==> dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x]
arg [-L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16] ==> dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16]
arg [-L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android] ==> dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android]
arg [-L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/lib] ==> dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/lib]
arg [-L/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib] ==> dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib]
arg [--exclude-libs] ==> ignore
arg [libgcc.a] ==> ignore
arg [--exclude-libs] ==> ignore
arg [libgcc_real.a] ==> ignore
arg [--exclude-libs] ==> ignore
arg [libatomic.a] ==> ignore
arg [--build-id] ==> ignore
arg [--fatal-warnings] ==> ignore
arg [--no-undefined] ==> ignore
arg [--gc-sections] ==> ignore
arg [CMakeFiles/cmTC_ecd80.dir/CMakeCCompilerABI.c.o] ==> ignore
arg [-lgcc] ==> lib [gcc]
arg [-ldl] ==> lib [dl]
arg [-lc] ==> lib [c]
arg [-lgcc] ==> lib [gcc]
arg [-ldl] ==> lib [dl]
arg [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16/crtend_android.o] ==> ignore
collapse library dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/9.0.9/lib/linux/i386] ==> [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/9.0.9/lib/linux/i386]
collapse library dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x] ==> [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x]
collapse library dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16] ==> [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16]
collapse library dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android] ==> [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android]
collapse library dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/lib] ==> [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/i686-linux-android/lib]
collapse library dir [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib] ==> [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib]
implicit libs: [gcc;dl;c;gcc;dl]
implicit dirs: [/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/9.0.9/lib/linux/i386;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/16;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/i686-linux-android/lib;/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib]
implicit fwks: []
Detecting C [-std=c11] compiler features compiled with the following output:
Change Dir: /Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/CMakeFiles/CMakeTmp
Run Build Command:"/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja" "cmTC_4f518"
[1/2] Building C object CMakeFiles/cmTC_4f518.dir/feature_tests.c.o
[2/2] Linking C executable cmTC_4f518
Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:1c_restrict
Feature record: C_FEATURE:1c_static_assert
Feature record: C_FEATURE:1c_variadic_macros
Detecting C [-std=c99] compiler features compiled with the following output:
Change Dir: /Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/CMakeFiles/CMakeTmp
Run Build Command:"/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja" "cmTC_528fe"
[1/2] Building C object CMakeFiles/cmTC_528fe.dir/feature_tests.c.o
[2/2] Linking C executable cmTC_528fe
Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:1c_restrict
Feature record: C_FEATURE:0c_static_assert
Feature record: C_FEATURE:1c_variadic_macros
Detecting C [-std=c90] compiler features compiled with the following output:
Change Dir: /Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/CMakeFiles/CMakeTmp
Run Build Command:"/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja" "cmTC_6579a"
[1/2] Building C object CMakeFiles/cmTC_6579a.dir/feature_tests.c.o
[2/2] Linking C executable cmTC_6579a
Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:0c_restrict
Feature record: C_FEATURE:0c_static_assert
Feature record: C_FEATURE:0c_variadic_macros
/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/CMakeFiles/rebuild_cache.dir
/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/CMakeFiles/edit_cache.dir
/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/CMakeFiles/xhook.dir
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
const char features[] = {"\n"
"C_FEATURE:"
#if ((__clang_major__ * 100) + __clang_minor__) >= 304
"1"
#else
"0"
#endif
"c_function_prototypes\n"
"C_FEATURE:"
#if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
"1"
#else
"0"
#endif
"c_restrict\n"
"C_FEATURE:"
#if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
"1"
#else
"0"
#endif
"c_static_assert\n"
"C_FEATURE:"
#if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
"1"
#else
"0"
#endif
"c_variadic_macros\n"
};
int main(int argc, char** argv) { (void)argv; return features[argc]; }
{
"abi": "X86",
"info": {
"abi": "X86",
"bitness": 32,
"deprecated": false,
"default": true
},
"originalCxxBuildFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86",
"cxxBuildFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86",
"abiPlatformVersion": 16,
"cmake": {
"cmakeWrappingBaseFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cxx/debug/x86",
"cmakeArtifactsBaseFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86",
"effectiveConfiguration": {
"name": "traditional-android-studio-cmake-environment",
"description": "Composite reified CMakeSettings configuration",
"generator": "Ninja",
"inheritEnvironments": [
"ndk"
],
"buildRoot": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86",
"cmakeToolchain": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake",
"cmakeExecutable": "/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/cmake",
"variables": [
{
"name": "CMAKE_FIND_ROOT_PATH",
"value": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/prefab/x86/prefab"
},
{
"name": "CMAKE_BUILD_TYPE",
"value": "Debug"
},
{
"name": "CMAKE_TOOLCHAIN_FILE",
"value": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake"
},
{
"name": "ANDROID_ABI",
"value": "x86"
},
{
"name": "ANDROID_NDK",
"value": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529"
},
{
"name": "ANDROID_PLATFORM",
"value": "android-16"
},
{
"name": "CMAKE_ANDROID_ARCH_ABI",
"value": "x86"
},
{
"name": "CMAKE_ANDROID_NDK",
"value": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529"
},
{
"name": "CMAKE_EXPORT_COMPILE_COMMANDS",
"value": "ON"
},
{
"name": "CMAKE_LIBRARY_OUTPUT_DIRECTORY",
"value": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build/intermediates/cmake/debug/obj/x86"
},
{
"name": "CMAKE_RUNTIME_OUTPUT_DIRECTORY",
"value": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build/intermediates/cmake/debug/obj/x86"
},
{
"name": "CMAKE_MAKE_PROGRAM",
"value": "/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja"
},
{
"name": "CMAKE_SYSTEM_NAME",
"value": "Android"
},
{
"name": "CMAKE_SYSTEM_VERSION",
"value": "16"
}
]
},
"cmakeServerLogFile": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/cmake_server_log.txt"
},
"variant": {
"buildSystemArgumentList": [],
"cFlagsList": [],
"cppFlagsList": [],
"variantName": "debug",
"objFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build/intermediates/cmake/debug/obj",
"soFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build/intermediates/cmake/debug/lib",
"isDebuggableEnabled": true,
"validAbiList": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
],
"buildTargetSet": [],
"implicitBuildTargetSet": [],
"cmakeSettingsConfiguration": "android-gradle-plugin-predetermined-name",
"module": {
"cxxFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx",
"splitsAbiFilterSet": [],
"intermediatesFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build/intermediates",
"gradleModulePathName": ":dokit-xhook",
"moduleRootFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook",
"moduleBuildFile": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build.gradle",
"makeFile": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/CMakeLists.txt",
"buildSystem": "CMAKE",
"ndkFolder": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529",
"ndkVersion": "21.4.7075529",
"ndkSupportedAbiList": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
],
"ndkDefaultAbiList": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
],
"ndkDefaultStl": "LIBCXX_STATIC",
"ndkMetaPlatforms": {
"min": 16,
"max": 30,
"aliases": {
"20": 19,
"25": 24,
"J": 16,
"J-MR1": 17,
"J-MR2": 18,
"K": 19,
"L": 21,
"L-MR1": 22,
"M": 23,
"N": 24,
"N-MR1": 24,
"O": 26,
"O-MR1": 27,
"P": 28,
"Q": 29,
"R": 30
}
},
"ndkMetaAbiList": [
{
"abi": "ARMEABI_V7A",
"bitness": 32,
"deprecated": false,
"default": true
},
{
"abi": "ARM64_V8A",
"bitness": 64,
"deprecated": false,
"default": true
},
{
"abi": "X86",
"bitness": 32,
"deprecated": false,
"default": true
},
{
"abi": "X86_64",
"bitness": 64,
"deprecated": false,
"default": true
}
],
"originalCmakeToolchainFile": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake",
"cmakeToolchainFile": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake",
"cmake": {
"isValidCmakeAvailable": true,
"cmakeExe": "/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/cmake",
"minimumCmakeVersion": "3.10.2",
"ninjaExe": "/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja",
"isPreferCmakeFileApiEnabled": true
},
"stlSharedObjectMap": {
"LIBCXX_SHARED": {
"ARMEABI_V7A": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/libc++_shared.so",
"ARM64_V8A": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so",
"X86": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/i686-linux-android/libc++_shared.so",
"X86_64": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so"
},
"LIBCXX_STATIC": {},
"NONE": {},
"SYSTEM": {}
},
"project": {
"rootBuildGradleFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android",
"cxxFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/.cxx",
"compilerSettingsCacheFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/.cxx",
"sdkFolder": "/Users/didi/Library/Android/sdk",
"isNativeCompilerSettingsCacheEnabled": false,
"isBuildOnlyTargetAbiEnabled": true,
"isCmakeBuildCohabitationEnabled": false,
"isPrefabEnabled": false,
"isV2NativeModelEnabled": true
},
"nativeBuildOutputLevel": "QUIET"
},
"prefabDirectory": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/prefab"
},
"buildSettings": {
"environmentVariables": []
},
"prefabFolder": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/prefab/x86"
}
\ No newline at end of file
# Install script for directory: /Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Debug")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "0")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "TRUE")
endif()
if(CMAKE_INSTALL_COMPONENT)
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"supportedProtocolVersions":[{"isExperimental":true,"major":1,"minor":1}],"type":"hello"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {
"type": "handshake",
"cookie": "gradle-cmake-cookie",
"protocolVersion": {
"isExperimental": true,
"major": 1,
"minor": 1
},
"sourceDirectory": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook",
"buildDirectory": "/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86",
"generator": "Ninja"
}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"gradle-cmake-cookie","inReplyTo":"handshake","type":"reply"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {
"type": "configure",
"cacheArguments": [
"",
"-DCMAKE_FIND_ROOT_PATH\u003d/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/prefab/x86/prefab",
"-DCMAKE_BUILD_TYPE\u003dDebug",
"-DCMAKE_TOOLCHAIN_FILE\u003d/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake",
"-DANDROID_ABI\u003dx86",
"-DANDROID_NDK\u003d/Users/didi/Library/Android/sdk/ndk/21.4.7075529",
"-DANDROID_PLATFORM\u003dandroid-16",
"-DCMAKE_ANDROID_ARCH_ABI\u003dx86",
"-DCMAKE_ANDROID_NDK\u003d/Users/didi/Library/Android/sdk/ndk/21.4.7075529",
"-DCMAKE_EXPORT_COMPILE_COMMANDS\u003dON",
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY\u003d/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build/intermediates/cmake/debug/obj/x86",
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY\u003d/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/build/intermediates/cmake/debug/obj/x86",
"-DCMAKE_MAKE_PROGRAM\u003d/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja",
"-DCMAKE_SYSTEM_NAME\u003dAndroid",
"-DCMAKE_SYSTEM_VERSION\u003d16"
]
}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","message":"Check for working C compiler: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang","type":"message"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: Check for working C compiler: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
CMAKE SERVER: Check for working C compiler: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","progressCurrent":33,"progressMaximum":1000,"progressMessage":"Configuring","progressMinimum":0,"type":"progress"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","message":"Check for working C compiler: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- works","type":"message"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: Check for working C compiler: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- works
CMAKE SERVER: Check for working C compiler: /Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- works
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","message":"Detecting C compiler ABI info","type":"message"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: Detecting C compiler ABI info
CMAKE SERVER: Detecting C compiler ABI info
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","progressCurrent":65,"progressMaximum":1000,"progressMessage":"Configuring","progressMinimum":0,"type":"progress"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","message":"Detecting C compiler ABI info - done","type":"message"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: Detecting C compiler ABI info - done
CMAKE SERVER: Detecting C compiler ABI info - done
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","message":"Detecting C compile features","type":"message"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: Detecting C compile features
CMAKE SERVER: Detecting C compile features
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","progressCurrent":96,"progressMaximum":1000,"progressMessage":"Configuring","progressMinimum":0,"type":"progress"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","progressCurrent":126,"progressMaximum":1000,"progressMessage":"Configuring","progressMinimum":0,"type":"progress"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","progressCurrent":155,"progressMaximum":1000,"progressMessage":"Configuring","progressMinimum":0,"type":"progress"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","message":"Detecting C compile features - done","type":"message"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: Detecting C compile features - done
CMAKE SERVER: Detecting C compile features - done
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","progressCurrent":1000,"progressMaximum":1000,"progressMessage":"Configuring","progressMinimum":0,"type":"progress"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","message":"Configuring done","type":"message"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: Configuring done
CMAKE SERVER: Configuring done
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"configure","type":"reply"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"type":"compute"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"compute","progressCurrent":1000,"progressMaximum":1000,"progressMessage":"Generating","progressMinimum":0,"type":"progress"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"compute","message":"Generating done","type":"message"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: Generating done
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"cookie":"","inReplyTo":"compute","type":"reply"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"type":"cmakeInputs"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"buildFiles":[{"isCMake":true,"isTemporary":false,"sources":["/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Platform/Android-Determine.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeSystem.cmake.in","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeSystemSpecificInitialize.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Platform/Android-Initialize.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineCCompiler.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineCompiler.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Platform/Android-Determine-C.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Platform/Android/Determine-Compiler.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeFindBinUtils.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Compiler/Clang-FindBinUtils.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeCCompiler.cmake.in","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeSystemSpecificInformation.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeGenericSystem.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Platform/Android.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Platform/Linux.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Platform/UnixPaths.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeCInformation.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeLanguageInformation.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Compiler/Clang-C.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Compiler/Clang.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Compiler/CMakeCommonCompilerMacros.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Compiler/GNU.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Compiler/CMakeCommonCompilerMacros.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Platform/Android-Clang-C.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Platform/Android-Clang.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeCommonLanguageInclude.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCompilerCommon.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineCompilerABI.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeParseImplicitLinkInfo.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeCCompilerABI.c","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineCompileFeatures.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Internal/FeatureTesting.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Compiler/Clang-C-FeatureTests.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Compiler/Clang-C-FeatureTests.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/Compiler/Clang-C-FeatureTests.cmake","/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeCCompiler.cmake.in"]},{"isCMake":false,"isTemporary":false,"sources":["CMakeLists.txt","/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake","/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/platforms.cmake","/Users/didi/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake"]},{"isCMake":false,"isTemporary":true,"sources":[".cxx/cmake/debug/x86/CMakeFiles/3.10.2/CMakeSystem.cmake",".cxx/cmake/debug/x86/CMakeFiles/3.10.2/CMakeCCompiler.cmake",".cxx/cmake/debug/x86/CMakeFiles/feature_tests.c",".cxx/cmake/debug/x86/CMakeFiles/feature_tests.c",".cxx/cmake/debug/x86/CMakeFiles/feature_tests.c",".cxx/cmake/debug/x86/CMakeFiles/3.10.2/CMakeCCompiler.cmake"]}],"cmakeRootDirectory":"/Users/didi/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10","cookie":"","inReplyTo":"cmakeInputs","sourceDirectory":"/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook","type":"reply"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"type":"codemodel"}
CMAKE SERVER: ]== "CMake Server" ==]
CMAKE SERVER:
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"configurations":[{"name":"Debug","projects":[{"buildDirectory":"/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86","name":"libxhook","sourceDirectory":"/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook","targets":[{"artifacts":["/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86/libxhook.a"],"buildDirectory":"/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/.cxx/cmake/debug/x86","fileGroups":[{"compileFlags":"-g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O0 -fno-limit-debug-info -fPIC ","includePath":[{"path":"/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook/src/main/cpp/libxhook"}],"isGenerated":false,"language":"C","sources":["src/main/cpp/libxhook/xh_core.c","src/main/cpp/libxhook/xh_elf.c","src/main/cpp/libxhook/xh_jni.c","src/main/cpp/libxhook/xh_log.c","src/main/cpp/libxhook/xh_util.c","src/main/cpp/libxhook/xh_version.c","src/main/cpp/libxhook/xhook.c"]}],"fullName":"libxhook.a","linkerLanguage":"C","name":"xhook","sourceDirectory":"/Users/didi/project/android/dokit_github/DoraemonKit/Android/dokit-xhook","sysroot":"/Users/didi/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot","type":"STATIC_LIBRARY"}]}]}],"cookie":"","inReplyTo":"codemodel","type":"reply"}
CMAKE SERVER: ]== "CMake Server" ==]
{
"ndk": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529",
"revision": {
"mMajor": 21,
"mMinor": 4,
"mMicro": 7075529,
"mPreview": 0,
"mPrecision": "MICRO",
"mPreviewSeparator": " "
}
}
\ No newline at end of file
[
{
"level": "INFO",
"message": "android.ndkVersion from module build.gradle is [not set]",
"diagnosticCode": "UNKNOWN"
},
{
"level": "INFO",
"message": "android.ndkPath from module build.gradle is not set",
"diagnosticCode": "UNKNOWN"
},
{
"level": "INFO",
"message": "ndk.dir in local.properties is not set",
"diagnosticCode": "UNKNOWN"
},
{
"level": "INFO",
"message": "Not considering ANDROID_NDK_HOME because support was removed after deprecation period.",
"diagnosticCode": "UNKNOWN"
},
{
"level": "INFO",
"message": "sdkFolder is /Users/didi/Library/Android/sdk",
"diagnosticCode": "UNKNOWN"
},
{
"level": "INFO",
"message": "Because no explicit NDK was requested, the default version [21.4.7075529] for this Android Gradle Plugin will be used",
"diagnosticCode": "UNKNOWN"
}
]
\ No newline at end of file
{
"sdkFolder": "/Users/didi/Library/Android/sdk",
"sideBySideNdkFolderNames": [
"21.4.7075529",
"22.1.7171670"
]
}
\ No newline at end of file
{
"ndk": "/Users/didi/Library/Android/sdk/ndk/21.4.7075529",
"revision": {
"mMajor": 21,
"mMinor": 4,
"mMicro": 7075529,
"mPreview": 0,
"mPrecision": "MICRO",
"mPreviewSeparator": " "
}
}
\ No newline at end of file
[
{
"level": "INFO",
"message": "android.ndkVersion from module build.gradle is [21.4.7075529]",
"diagnosticCode": "UNKNOWN"
},
{
"level": "INFO",
"message": "android.ndkPath from module build.gradle is not set",
"diagnosticCode": "UNKNOWN"
},
{
"level": "INFO",
"message": "ndk.dir in local.properties is not set",
"diagnosticCode": "UNKNOWN"
},
{
"level": "INFO",
"message": "Not considering ANDROID_NDK_HOME because support was removed after deprecation period.",
"diagnosticCode": "UNKNOWN"
},
{
"level": "INFO",
"message": "sdkFolder is /Users/didi/Library/Android/sdk",
"diagnosticCode": "UNKNOWN"
}
]
\ No newline at end of file
{
"ndkVersionFromDsl": "21.4.7075529",
"sdkFolder": "/Users/didi/Library/Android/sdk",
"sideBySideNdkFolderNames": [
"21.4.7075529",
"22.1.7171670"
]
}
\ No newline at end of file
/build
.cxx
.gradle
\ No newline at end of file
cmake_minimum_required(VERSION 3.4.1)
project(libxhook C)
set(xhook_source_dir src/main/cpp/libxhook)
set(xhook_source
${xhook_source_dir}/xh_core.c
${xhook_source_dir}/xh_elf.c
${xhook_source_dir}/xh_jni.c
${xhook_source_dir}/xh_log.c
${xhook_source_dir}/xh_util.c
${xhook_source_dir}/xh_version.c
${xhook_source_dir}/xhook.c
# ${xhook_source_dir}/xhook_ext.c
)
add_library(xhook STATIC ${xhook_source})
find_library(
log-lib
log
)
target_include_directories(
xhook
PUBLIC ${xhook_source_dir}
)
target_link_libraries(
xhook
${log-lib}
)
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: '../upload.gradle'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
ndkVersion '21.4.7075529'
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion_16"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
externalNativeBuild {
cmake {
targets = ['xhook']
}
exportHeaders {
from('src/main/cpp/libxhook') {
include '**/*.h'
}
}
}
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//implementation rootProject.ext.dependencies["appcompat"]
implementation rootProject.ext.dependencies["kotlin"]
}
ARTIFACT_ID=dokitx-xhook
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original from file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.didichuxing.doraemonkit">
</manifest>
\ No newline at end of file
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#include <inttypes.h>
#include <stdio.h>
#include <stdint.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <regex.h>
#include <setjmp.h>
#include <errno.h>
#include "queue.h"
#include "tree.h"
#include "xh_errno.h"
#include "xh_log.h"
#include "xh_elf.h"
#include "xh_version.h"
#include "xh_core.h"
#define XH_CORE_DEBUG 0
//registered hook info collection
typedef struct xh_core_hook_info
{
#if XH_CORE_DEBUG
char *pathname_regex_str;
#endif
regex_t pathname_regex;
char *symbol;
void *new_func;
void **old_func;
TAILQ_ENTRY(xh_core_hook_info,) link;
} xh_core_hook_info_t;
typedef TAILQ_HEAD(xh_core_hook_info_queue, xh_core_hook_info,) xh_core_hook_info_queue_t;
//ignored hook info collection
typedef struct xh_core_ignore_info
{
#if XH_CORE_DEBUG
char *pathname_regex_str;
#endif
regex_t pathname_regex;
char *symbol; //NULL meaning for all symbols
TAILQ_ENTRY(xh_core_ignore_info,) link;
} xh_core_ignore_info_t;
typedef TAILQ_HEAD(xh_core_ignore_info_queue, xh_core_ignore_info,) xh_core_ignore_info_queue_t;
//required info from /proc/self/maps
typedef struct xh_core_map_info
{
char *pathname;
uintptr_t base_addr;
xh_elf_t elf;
RB_ENTRY(xh_core_map_info) link;
} xh_core_map_info_t;
static __inline__ int xh_core_map_info_cmp(xh_core_map_info_t *a, xh_core_map_info_t *b)
{
return strcmp(a->pathname, b->pathname);
}
typedef RB_HEAD(xh_core_map_info_tree, xh_core_map_info) xh_core_map_info_tree_t;
RB_GENERATE_STATIC(xh_core_map_info_tree, xh_core_map_info, link, xh_core_map_info_cmp)
//signal handler for SIGSEGV
//for xh_elf_init(), xh_elf_hook(), xh_elf_check_elfheader()
static int xh_core_sigsegv_enable = 1; //enable by default
static struct sigaction xh_core_sigsegv_act_old;
static volatile int xh_core_sigsegv_flag = 0;
static sigjmp_buf xh_core_sigsegv_env;
static void xh_core_sigsegv_handler(int sig)
{
(void)sig;
if(xh_core_sigsegv_flag)
siglongjmp(xh_core_sigsegv_env, 1);
else
sigaction(SIGSEGV, &xh_core_sigsegv_act_old, NULL);
}
static int xh_core_add_sigsegv_handler()
{
struct sigaction act;
if(!xh_core_sigsegv_enable) return 0;
if(0 != sigemptyset(&act.sa_mask)) return (0 == errno ? XH_ERRNO_UNKNOWN : errno);
act.sa_handler = xh_core_sigsegv_handler;
if(0 != sigaction(SIGSEGV, &act, &xh_core_sigsegv_act_old))
return (0 == errno ? XH_ERRNO_UNKNOWN : errno);
return 0;
}
static void xh_core_del_sigsegv_handler()
{
if(!xh_core_sigsegv_enable) return;
sigaction(SIGSEGV, &xh_core_sigsegv_act_old, NULL);
}
static xh_core_hook_info_queue_t xh_core_hook_info = TAILQ_HEAD_INITIALIZER(xh_core_hook_info);
static xh_core_ignore_info_queue_t xh_core_ignore_info = TAILQ_HEAD_INITIALIZER(xh_core_ignore_info);
static xh_core_map_info_tree_t xh_core_map_info = RB_INITIALIZER(&xh_core_map_info);
static pthread_mutex_t xh_core_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t xh_core_cond = PTHREAD_COND_INITIALIZER;
static volatile int xh_core_inited = 0;
static volatile int xh_core_init_ok = 0;
static volatile int xh_core_async_inited = 0;
static volatile int xh_core_async_init_ok = 0;
static pthread_mutex_t xh_core_refresh_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_t xh_core_refresh_thread_tid;
static volatile int xh_core_refresh_thread_running = 0;
static volatile int xh_core_refresh_thread_do = 0;
int xh_core_register(const char *pathname_regex_str, const char *symbol,
void *new_func, void **old_func)
{
xh_core_hook_info_t *hi;
regex_t regex;
if(NULL == pathname_regex_str || NULL == symbol || NULL == new_func) return XH_ERRNO_INVAL;
if(xh_core_inited)
{
XH_LOG_ERROR("do not register hook after refresh(): %s, %s", pathname_regex_str, symbol);
return XH_ERRNO_INVAL;
}
if(0 != regcomp(&regex, pathname_regex_str, REG_NOSUB)) return XH_ERRNO_INVAL;
if(NULL == (hi = malloc(sizeof(xh_core_hook_info_t)))) return XH_ERRNO_NOMEM;
if(NULL == (hi->symbol = strdup(symbol)))
{
free(hi);
return XH_ERRNO_NOMEM;
}
#if XH_CORE_DEBUG
if(NULL == (hi->pathname_regex_str = strdup(pathname_regex_str)))
{
free(hi->symbol);
free(hi);
return XH_ERRNO_NOMEM;
}
#endif
hi->pathname_regex = regex;
hi->new_func = new_func;
hi->old_func = old_func;
pthread_mutex_lock(&xh_core_mutex);
TAILQ_INSERT_TAIL(&xh_core_hook_info, hi, link);
pthread_mutex_unlock(&xh_core_mutex);
return 0;
}
int xh_core_ignore(const char *pathname_regex_str, const char *symbol)
{
xh_core_ignore_info_t *ii;
regex_t regex;
if(NULL == pathname_regex_str) return XH_ERRNO_INVAL;
if(xh_core_inited)
{
XH_LOG_ERROR("do not ignore hook after refresh(): %s, %s", pathname_regex_str, symbol ? symbol : "ALL");
return XH_ERRNO_INVAL;
}
if(0 != regcomp(&regex, pathname_regex_str, REG_NOSUB)) return XH_ERRNO_INVAL;
if(NULL == (ii = malloc(sizeof(xh_core_ignore_info_t)))) return XH_ERRNO_NOMEM;
if(NULL != symbol)
{
if(NULL == (ii->symbol = strdup(symbol)))
{
free(ii);
return XH_ERRNO_NOMEM;
}
}
else
{
ii->symbol = NULL; //ignore all symbols
}
#if XH_CORE_DEBUG
if(NULL == (ii->pathname_regex_str = strdup(pathname_regex_str)))
{
free(ii->symbol);
free(ii);
return XH_ERRNO_NOMEM;
}
#endif
ii->pathname_regex = regex;
pthread_mutex_lock(&xh_core_mutex);
TAILQ_INSERT_TAIL(&xh_core_ignore_info, ii, link);
pthread_mutex_unlock(&xh_core_mutex);
return 0;
}
static int xh_core_check_elf_header(uintptr_t base_addr, const char *pathname)
{
if(!xh_core_sigsegv_enable)
{
return xh_elf_check_elfheader(base_addr);
}
else
{
int ret = XH_ERRNO_UNKNOWN;
xh_core_sigsegv_flag = 1;
if(0 == sigsetjmp(xh_core_sigsegv_env, 1))
{
ret = xh_elf_check_elfheader(base_addr);
}
else
{
ret = XH_ERRNO_SEGVERR;
XH_LOG_WARN("catch SIGSEGV when check_elfheader: %s", pathname);
}
xh_core_sigsegv_flag = 0;
return ret;
}
}
static void xh_core_hook_impl(xh_core_map_info_t *mi)
{
//init
if(0 != xh_elf_init(&(mi->elf), mi->base_addr, mi->pathname)) return;
//hook
xh_core_hook_info_t *hi;
xh_core_ignore_info_t *ii;
int ignore;
TAILQ_FOREACH(hi, &xh_core_hook_info, link) //find hook info
{
if(0 == regexec(&(hi->pathname_regex), mi->pathname, 0, NULL, 0))
{
ignore = 0;
TAILQ_FOREACH(ii, &xh_core_ignore_info, link) //find ignore info
{
if(0 == regexec(&(ii->pathname_regex), mi->pathname, 0, NULL, 0))
{
if(NULL == ii->symbol) //ignore all symbols
return;
if(0 == strcmp(ii->symbol, hi->symbol)) //ignore the current symbol
{
ignore = 1;
break;
}
}
}
if(0 == ignore)
xh_elf_hook(&(mi->elf), hi->symbol, hi->new_func, hi->old_func);
}
}
}
static void xh_core_hook(xh_core_map_info_t *mi)
{
if(!xh_core_sigsegv_enable)
{
xh_core_hook_impl(mi);
}
else
{
xh_core_sigsegv_flag = 1;
if(0 == sigsetjmp(xh_core_sigsegv_env, 1))
{
xh_core_hook_impl(mi);
}
else
{
XH_LOG_WARN("catch SIGSEGV when init or hook: %s", mi->pathname);
}
xh_core_sigsegv_flag = 0;
}
}
static void xh_core_refresh_impl()
{
char line[512];
FILE *fp;
uintptr_t base_addr;
char perm[5];
unsigned long offset;
int pathname_pos;
char *pathname;
size_t pathname_len;
xh_core_map_info_t *mi, *mi_tmp;
xh_core_map_info_t mi_key;
xh_core_hook_info_t *hi;
xh_core_ignore_info_t *ii;
int match;
xh_core_map_info_tree_t map_info_refreshed = RB_INITIALIZER(&map_info_refreshed);
if(NULL == (fp = fopen("/proc/self/maps", "r")))
{
XH_LOG_ERROR("fopen /proc/self/maps failed");
return;
}
while(fgets(line, sizeof(line), fp))
{
if(sscanf(line, "%"PRIxPTR"-%*lx %4s %lx %*x:%*x %*d%n", &base_addr, perm, &offset, &pathname_pos) != 3) continue;
//check permission
if(perm[0] != 'r') continue;
if(perm[3] != 'p') continue; //do not touch the shared memory
//check offset
//
//We are trying to find ELF header in memory.
//It can only be found at the beginning of a mapped memory regions
//whose offset is 0.
if(0 != offset) continue;
//get pathname
while(isspace(line[pathname_pos]) && pathname_pos < (int)(sizeof(line) - 1))
pathname_pos += 1;
if(pathname_pos >= (int)(sizeof(line) - 1)) continue;
pathname = line + pathname_pos;
pathname_len = strlen(pathname);
if(0 == pathname_len) continue;
if(pathname[pathname_len - 1] == '\n')
{
pathname[pathname_len - 1] = '\0';
pathname_len -= 1;
}
if(0 == pathname_len) continue;
if('[' == pathname[0]) continue;
//check pathname
//if we need to hook this elf?
match = 0;
TAILQ_FOREACH(hi, &xh_core_hook_info, link) //find hook info
{
if(0 == regexec(&(hi->pathname_regex), pathname, 0, NULL, 0))
{
TAILQ_FOREACH(ii, &xh_core_ignore_info, link) //find ignore info
{
if(0 == regexec(&(ii->pathname_regex), pathname, 0, NULL, 0))
{
if(NULL == ii->symbol)
goto check_finished;
if(0 == strcmp(ii->symbol, hi->symbol))
goto check_continue;
}
}
match = 1;
check_continue:
break;
}
}
check_finished:
if(0 == match) continue;
//check elf header format
//We are trying to do ELF header checking as late as possible.
if(0 != xh_core_check_elf_header(base_addr, pathname)) continue;
//check existed map item
mi_key.pathname = pathname;
if(NULL != (mi = RB_FIND(xh_core_map_info_tree, &xh_core_map_info, &mi_key)))
{
//exist
RB_REMOVE(xh_core_map_info_tree, &xh_core_map_info, mi);
//repeated?
//We only keep the first one, that is the real base address
if(NULL != RB_INSERT(xh_core_map_info_tree, &map_info_refreshed, mi))
{
#if XH_CORE_DEBUG
XH_LOG_DEBUG("repeated map info when update: %s", line);
#endif
free(mi->pathname);
free(mi);
continue;
}
//re-hook if base_addr changed
if(mi->base_addr != base_addr)
{
mi->base_addr = base_addr;
xh_core_hook(mi);
}
}
else
{
//not exist, create a new map info
if(NULL == (mi = (xh_core_map_info_t *)malloc(sizeof(xh_core_map_info_t)))) continue;
if(NULL == (mi->pathname = strdup(pathname)))
{
free(mi);
continue;
}
mi->base_addr = base_addr;
//repeated?
//We only keep the first one, that is the real base address
if(NULL != RB_INSERT(xh_core_map_info_tree, &map_info_refreshed, mi))
{
#if XH_CORE_DEBUG
XH_LOG_DEBUG("repeated map info when create: %s", line);
#endif
free(mi->pathname);
free(mi);
continue;
}
//hook
xh_core_hook(mi); //hook
}
}
fclose(fp);
//free all missing map item, maybe dlclosed?
RB_FOREACH_SAFE(mi, xh_core_map_info_tree, &xh_core_map_info, mi_tmp)
{
#if XH_CORE_DEBUG
XH_LOG_DEBUG("remove missing map info: %s", mi->pathname);
#endif
RB_REMOVE(xh_core_map_info_tree, &xh_core_map_info, mi);
if(mi->pathname) free(mi->pathname);
free(mi);
}
//save the new refreshed map info tree
xh_core_map_info = map_info_refreshed;
XH_LOG_INFO("map refreshed");
#if XH_CORE_DEBUG
RB_FOREACH(mi, xh_core_map_info_tree, &xh_core_map_info)
XH_LOG_DEBUG(" %"PRIxPTR" %s\n", mi->base_addr, mi->pathname);
#endif
}
static void *xh_core_refresh_thread_func(void *arg)
{
(void)arg;
pthread_setname_np(pthread_self(), "xh_refresh_loop");
while(xh_core_refresh_thread_running)
{
//waiting for a refresh task or exit
pthread_mutex_lock(&xh_core_mutex);
while(!xh_core_refresh_thread_do && xh_core_refresh_thread_running)
{
pthread_cond_wait(&xh_core_cond, &xh_core_mutex);
}
if(!xh_core_refresh_thread_running)
{
pthread_mutex_unlock(&xh_core_mutex);
break;
}
xh_core_refresh_thread_do = 0;
pthread_mutex_unlock(&xh_core_mutex);
//refresh
pthread_mutex_lock(&xh_core_refresh_mutex);
xh_core_refresh_impl();
pthread_mutex_unlock(&xh_core_refresh_mutex);
}
return NULL;
}
static void xh_core_init_once()
{
if(xh_core_inited) return;
pthread_mutex_lock(&xh_core_mutex);
if(xh_core_inited) goto end;
xh_core_inited = 1;
//dump debug info
XH_LOG_INFO("%s\n", xh_version_str_full());
#if XH_CORE_DEBUG
xh_core_hook_info_t *hi;
TAILQ_FOREACH(hi, &xh_core_hook_info, link)
XH_LOG_INFO(" hook: %s @ %s, (%p, %p)\n", hi->symbol, hi->pathname_regex_str,
hi->new_func, hi->old_func);
xh_core_ignore_info_t *ii;
TAILQ_FOREACH(ii, &xh_core_ignore_info, link)
XH_LOG_INFO(" ignore: %s @ %s\n", ii->symbol ? ii->symbol : "ALL ",
ii->pathname_regex_str);
#endif
//register signal handler
if(0 != xh_core_add_sigsegv_handler()) goto end;
//OK
xh_core_init_ok = 1;
end:
pthread_mutex_unlock(&xh_core_mutex);
}
static void xh_core_init_async_once()
{
if(xh_core_async_inited) return;
pthread_mutex_lock(&xh_core_mutex);
if(xh_core_async_inited) goto end;
xh_core_async_inited = 1;
//create async refresh thread
xh_core_refresh_thread_running = 1;
if(0 != pthread_create(&xh_core_refresh_thread_tid, NULL, &xh_core_refresh_thread_func, NULL))
{
xh_core_refresh_thread_running = 0;
goto end;
}
//OK
xh_core_async_init_ok = 1;
end:
pthread_mutex_unlock(&xh_core_mutex);
}
int xh_core_refresh(int async)
{
//init
xh_core_init_once();
if(!xh_core_init_ok) return XH_ERRNO_UNKNOWN;
if(async)
{
//init for async
xh_core_init_async_once();
if(!xh_core_async_init_ok) return XH_ERRNO_UNKNOWN;
//refresh async
pthread_mutex_lock(&xh_core_mutex);
xh_core_refresh_thread_do = 1;
pthread_cond_signal(&xh_core_cond);
pthread_mutex_unlock(&xh_core_mutex);
}
else
{
//refresh sync
pthread_mutex_lock(&xh_core_refresh_mutex);
xh_core_refresh_impl();
pthread_mutex_unlock(&xh_core_refresh_mutex);
}
return 0;
}
void xh_core_clear()
{
//stop the async refresh thread
if(xh_core_async_init_ok)
{
pthread_mutex_lock(&xh_core_mutex);
xh_core_refresh_thread_running = 0;
pthread_cond_signal(&xh_core_cond);
pthread_mutex_unlock(&xh_core_mutex);
pthread_join(xh_core_refresh_thread_tid, NULL);
xh_core_async_init_ok = 0;
}
xh_core_async_inited = 0;
//unregister the sig handler
if(xh_core_init_ok)
{
xh_core_del_sigsegv_handler();
xh_core_init_ok = 0;
}
xh_core_inited = 0;
pthread_mutex_lock(&xh_core_mutex);
pthread_mutex_lock(&xh_core_refresh_mutex);
//free all map info
xh_core_map_info_t *mi, *mi_tmp;
RB_FOREACH_SAFE(mi, xh_core_map_info_tree, &xh_core_map_info, mi_tmp)
{
RB_REMOVE(xh_core_map_info_tree, &xh_core_map_info, mi);
if(mi->pathname) free(mi->pathname);
free(mi);
}
//free all hook info
xh_core_hook_info_t *hi, *hi_tmp;
TAILQ_FOREACH_SAFE(hi, &xh_core_hook_info, link, hi_tmp)
{
TAILQ_REMOVE(&xh_core_hook_info, hi, link);
#if XH_CORE_DEBUG
free(hi->pathname_regex_str);
#endif
regfree(&(hi->pathname_regex));
free(hi->symbol);
free(hi);
}
//free all ignore info
xh_core_ignore_info_t *ii, *ii_tmp;
TAILQ_FOREACH_SAFE(ii, &xh_core_ignore_info, link, ii_tmp)
{
TAILQ_REMOVE(&xh_core_ignore_info, ii, link);
#if XH_CORE_DEBUG
free(ii->pathname_regex_str);
#endif
regfree(&(ii->pathname_regex));
free(ii->symbol);
free(ii);
}
pthread_mutex_unlock(&xh_core_refresh_mutex);
pthread_mutex_unlock(&xh_core_mutex);
}
void xh_core_enable_debug(int flag)
{
xh_log_priority = (flag ? ANDROID_LOG_DEBUG : ANDROID_LOG_WARN);
}
void xh_core_enable_sigsegv_protection(int flag)
{
xh_core_sigsegv_enable = (flag ? 1 : 0);
}
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#ifndef XH_CORE_H
#define XH_CORE_H 1
#ifdef __cplusplus
extern "C" {
#endif
int xh_core_register(const char *pathname_regex_str, const char *symbol,
void *new_func, void **old_func);
int xh_core_ignore(const char *pathname_regex_str, const char *symbol);
int xh_core_refresh(int async);
void xh_core_clear();
void xh_core_enable_debug(int flag);
void xh_core_enable_sigsegv_protection(int flag);
#ifdef __cplusplus
}
#endif
#endif
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#ifndef XH_ELF_H
#define XH_ELF_H 1
#include <stdint.h>
#include <elf.h>
#include <link.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
const char *pathname;
ElfW(Addr) base_addr;
ElfW(Addr) bias_addr;
ElfW(Ehdr) *ehdr;
ElfW(Phdr) *phdr;
ElfW(Dyn) *dyn; //.dynamic
ElfW(Word) dyn_sz;
const char *strtab; //.dynstr (string-table)
ElfW(Sym) *symtab; //.dynsym (symbol-index to string-table's offset)
ElfW(Addr) relplt; //.rel.plt or .rela.plt
ElfW(Word) relplt_sz;
ElfW(Addr) reldyn; //.rel.dyn or .rela.dyn
ElfW(Word) reldyn_sz;
ElfW(Addr) relandroid; //android compressed rel or rela
ElfW(Word) relandroid_sz;
//for ELF hash
uint32_t *bucket;
uint32_t bucket_cnt;
uint32_t *chain;
uint32_t chain_cnt; //invalid for GNU hash
//append for GNU hash
uint32_t symoffset;
ElfW(Addr) *bloom;
uint32_t bloom_sz;
uint32_t bloom_shift;
int is_use_rela;
int is_use_gnu_hash;
} xh_elf_t;
int xh_elf_init(xh_elf_t *self, uintptr_t base_addr, const char *pathname);
int xh_elf_hook(xh_elf_t *self, const char *symbol, void *new_func, void **old_func);
int xh_elf_check_elfheader(uintptr_t base_addr);
#ifdef __cplusplus
}
#endif
#endif
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#ifndef XH_ERRNO_H
#define XH_ERRNO_H 1
#define XH_ERRNO_UNKNOWN 1001
#define XH_ERRNO_INVAL 1002
#define XH_ERRNO_NOMEM 1003
#define XH_ERRNO_REPEAT 1004
#define XH_ERRNO_NOTFND 1005
#define XH_ERRNO_BADMAPS 1006
#define XH_ERRNO_FORMAT 1007
#define XH_ERRNO_ELFINIT 1008
#define XH_ERRNO_SEGVERR 1009
#endif
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#include <jni.h>
#include "xhook.h"
#define JNI_API_DEF(f) Java_com_qiyi_xhook_NativeHandler_##f
JNIEXPORT jint JNI_API_DEF(refresh)(JNIEnv *env, jobject obj, jboolean async)
{
(void)env;
(void)obj;
return xhook_refresh(async ? 1 : 0);
}
JNIEXPORT void JNI_API_DEF(clear)(JNIEnv *env, jobject obj)
{
(void)env;
(void)obj;
xhook_clear();
}
JNIEXPORT void JNI_API_DEF(enableDebug)(JNIEnv *env, jobject obj, jboolean flag)
{
(void)env;
(void)obj;
xhook_enable_debug(flag ? 1 : 0);
}
JNIEXPORT void JNI_API_DEF(enableSigSegvProtection)(JNIEnv *env, jobject obj, jboolean flag)
{
(void)env;
(void)obj;
xhook_enable_sigsegv_protection(flag ? 1 : 0);
}
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#include <android/log.h>
#include "xh_log.h"
android_LogPriority xh_log_priority = ANDROID_LOG_WARN;
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#ifndef XH_LOG_H
#define XH_LOG_H 1
#include <android/log.h>
#ifdef __cplusplus
extern "C" {
#endif
extern android_LogPriority xh_log_priority;
#define XH_LOG_TAG "xhook"
#define XH_LOG_DEBUG(fmt, ...) do{if(xh_log_priority <= ANDROID_LOG_DEBUG) __android_log_print(ANDROID_LOG_DEBUG, XH_LOG_TAG, fmt, ##__VA_ARGS__);}while(0)
#define XH_LOG_INFO(fmt, ...) do{if(xh_log_priority <= ANDROID_LOG_INFO) __android_log_print(ANDROID_LOG_INFO, XH_LOG_TAG, fmt, ##__VA_ARGS__);}while(0)
#define XH_LOG_WARN(fmt, ...) do{if(xh_log_priority <= ANDROID_LOG_WARN) __android_log_print(ANDROID_LOG_WARN, XH_LOG_TAG, fmt, ##__VA_ARGS__);}while(0)
#define XH_LOG_ERROR(fmt, ...) do{if(xh_log_priority <= ANDROID_LOG_ERROR) __android_log_print(ANDROID_LOG_ERROR, XH_LOG_TAG, fmt, ##__VA_ARGS__);}while(0)
#ifdef __cplusplus
}
#endif
#endif
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#include <unistd.h>
#include <stdint.h>
#include <inttypes.h>
#include <elf.h>
#include <link.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include "xh_util.h"
#include "xh_errno.h"
#include "xh_log.h"
#define PAGE_START(addr) ((addr) & PAGE_MASK)
#define PAGE_END(addr) (PAGE_START(addr + sizeof(uintptr_t) - 1) + PAGE_SIZE)
#define PAGE_COVER(addr) (PAGE_END(addr) - PAGE_START(addr))
int xh_util_get_mem_protect(uintptr_t addr, size_t len, const char *pathname, unsigned int *prot)
{
uintptr_t start_addr = addr;
uintptr_t end_addr = addr + len;
FILE *fp;
char line[512];
uintptr_t start, end;
char perm[5];
int load0 = 1;
int found_all = 0;
*prot = 0;
if(NULL == (fp = fopen("/proc/self/maps", "r"))) return XH_ERRNO_BADMAPS;
while(fgets(line, sizeof(line), fp))
{
if(NULL != pathname)
if(NULL == strstr(line, pathname)) continue;
if(sscanf(line, "%"PRIxPTR"-%"PRIxPTR" %4s ", &start, &end, perm) != 3) continue;
if(perm[3] != 'p') continue;
if(start_addr >= start && start_addr < end)
{
if(load0)
{
//first load segment
if(perm[0] == 'r') *prot |= PROT_READ;
if(perm[1] == 'w') *prot |= PROT_WRITE;
if(perm[2] == 'x') *prot |= PROT_EXEC;
load0 = 0;
}
else
{
//others
if(perm[0] != 'r') *prot &= ~PROT_READ;
if(perm[1] != 'w') *prot &= ~PROT_WRITE;
if(perm[2] != 'x') *prot &= ~PROT_EXEC;
}
if(end_addr <= end)
{
found_all = 1;
break; //finished
}
else
{
start_addr = end; //try to find the next load segment
}
}
}
fclose(fp);
if(!found_all) return XH_ERRNO_SEGVERR;
return 0;
}
int xh_util_get_addr_protect(uintptr_t addr, const char *pathname, unsigned int *prot)
{
return xh_util_get_mem_protect(addr, sizeof(addr), pathname, prot);
}
int xh_util_set_addr_protect(uintptr_t addr, unsigned int prot)
{
if(0 != mprotect((void *)PAGE_START(addr), PAGE_COVER(addr), (int)prot))
return 0 == errno ? XH_ERRNO_UNKNOWN : errno;
return 0;
}
void xh_util_flush_instruction_cache(uintptr_t addr)
{
__builtin___clear_cache((void *)PAGE_START(addr), (void *)PAGE_END(addr));
}
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#ifndef XH_UTILS_H
#define XH_UTILS_H 1
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__LP64__)
#define XH_UTIL_FMT_LEN "16"
#define XH_UTIL_FMT_X "llx"
#else
#define XH_UTIL_FMT_LEN "8"
#define XH_UTIL_FMT_X "x"
#endif
#define XH_UTIL_FMT_FIXED_X XH_UTIL_FMT_LEN XH_UTIL_FMT_X
#define XH_UTIL_FMT_FIXED_S XH_UTIL_FMT_LEN "s"
int xh_util_get_mem_protect(uintptr_t addr, size_t len, const char *pathname, unsigned int *prot);
int xh_util_get_addr_protect(uintptr_t addr, const char *pathname, unsigned int *prot);
int xh_util_set_addr_protect(uintptr_t addr, unsigned int prot);
void xh_util_flush_instruction_cache(uintptr_t addr);
#ifdef __cplusplus
}
#endif
#endif
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#include "xh_version.h"
#define XH_VERSION_MAJOR 1
#define XH_VERSION_MINOR 2
#define XH_VERSION_EXTRA 0
#define XH_VERSION ((XH_VERSION_MAJOR << 16) | (XH_VERSION_MINOR << 8) | (XH_VERSION_EXTRA))
#define XH_VERSION_TO_STR_HELPER(x) #x
#define XH_VERSION_TO_STR(x) XH_VERSION_TO_STR_HELPER(x)
#define XH_VERSION_STR XH_VERSION_TO_STR(XH_VERSION_MAJOR) "." \
XH_VERSION_TO_STR(XH_VERSION_MINOR) "." \
XH_VERSION_TO_STR(XH_VERSION_EXTRA)
#if defined(__arm__)
#define XH_VERSION_ARCH "arm"
#elif defined(__aarch64__)
#define XH_VERSION_ARCH "aarch64"
#elif defined(__i386__)
#define XH_VERSION_ARCH "x86"
#elif defined(__x86_64__)
#define XH_VERSION_ARCH "x86_64"
#else
#define XH_VERSION_ARCH "unknown"
#endif
#define XH_VERSION_STR_FULL "libxhook "XH_VERSION_STR" ("XH_VERSION_ARCH")"
unsigned int xh_version()
{
return XH_VERSION;
}
const char *xh_version_str()
{
return XH_VERSION_STR;
}
const char *xh_version_str_full()
{
return XH_VERSION_STR_FULL;
}
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#ifndef XH_VERSION_H
#define XH_VERSION_H 1
#ifdef __cplusplus
extern "C" {
#endif
unsigned int xh_version();
const char *xh_version_str();
const char *xh_version_str_full();
#ifdef __cplusplus
}
#endif
#endif
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#include "xh_core.h"
#include "xhook.h"
int xhook_register(const char *pathname_regex_str, const char *symbol,
void *new_func, void **old_func)
{
return xh_core_register(pathname_regex_str, symbol, new_func, old_func);
}
int xhook_ignore(const char *pathname_regex_str, const char *symbol)
{
return xh_core_ignore(pathname_regex_str, symbol);
}
int xhook_refresh(int async)
{
return xh_core_refresh(async);
}
void xhook_clear()
{
return xh_core_clear();
}
void xhook_enable_debug(int flag)
{
return xh_core_enable_debug(flag);
}
void xhook_enable_sigsegv_protection(int flag)
{
return xh_core_enable_sigsegv_protection(flag);
}
// Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2018-04-11.
#ifndef XHOOK_H
#define XHOOK_H 1
#ifdef __cplusplus
extern "C" {
#endif
#define XHOOK_EXPORT __attribute__((visibility("default")))
int xhook_register(const char *pathname_regex_str, const char *symbol,
void *new_func, void **old_func) XHOOK_EXPORT;
int xhook_ignore(const char *pathname_regex_str, const char *symbol) XHOOK_EXPORT;
int xhook_refresh(int async) XHOOK_EXPORT;
void xhook_clear() XHOOK_EXPORT;
void xhook_enable_debug(int flag) XHOOK_EXPORT;
void xhook_enable_sigsegv_protection(int flag) XHOOK_EXPORT;
#ifdef __cplusplus
}
#endif
#endif
#!/usr/bin/env bash
echo -n "please enter bintray userid ->"
read userid_bintray
echo -n "please enter bintray apikey ->"
read apikey_bintray
../gradlew clean build --stacktrace --info bintrayUpload -PbintrayUser=${userid_bintray} -PbintrayKey=${apikey_bintray} -PdryRun=false
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册