Skip to content

Commit f528428

Browse files
committed
feat:modify
1 parent c869675 commit f528428

File tree

3 files changed

+57
-56
lines changed

3 files changed

+57
-56
lines changed

fixAndroid14DebuggableLag/build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ android {
3636
}
3737
}
3838

39-
externalNativeBuild {
40-
cmake {
41-
path "src/main/cpp/CMakeLists.txt"
42-
version "3.22.1"
43-
}
44-
}
39+
// externalNativeBuild {
40+
// cmake {
41+
// path "src/main/cpp/CMakeLists.txt"
42+
// version "3.22.1"
43+
// }
44+
// }
4545
compileOptions {
4646
sourceCompatibility JavaVersion.VERSION_1_8
4747
targetCompatibility JavaVersion.VERSION_1_8
@@ -63,8 +63,7 @@ android {
6363
}
6464

6565
dependencies {
66-
implementation 'com.bytedance.android:shadowhook:1.0.9'
67-
66+
implementation libs.shadowhook
6867
}
6968

7069

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
## For more information about using CMake with Android Studio, read the
2-
## documentation: https://d.android.com/studio/projects/add-native-code.html.
3-
## For more examples on how to use CMake, see https://github.com/android/ndk-samples.
4-
#
5-
## Sets the minimum CMake version required for this project.
6-
#cmake_minimum_required(VERSION 3.22.1)
7-
#
8-
#
9-
#
10-
#
11-
#
12-
## Declares the project name. The project name can be accessed via ${ PROJECT_NAME},
13-
## Since this is the top level CMakeLists.txt, the project name is also accessible
14-
## with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level
15-
## build script scope).
16-
#project("fixandroid14debuggablelag")
17-
#
18-
## Creates and names a library, sets it as either STATIC
19-
## or SHARED, and provides the relative paths to its source code.
20-
## You can define multiple libraries, and CMake builds them for you.
21-
## Gradle automatically packages shared libraries with your APK.
22-
##
23-
## In this top level CMakeLists.txt, ${CMAKE_PROJECT_NAME} is used to define
24-
## the target library name; in the sub-module's CMakeLists.txt, ${PROJECT_NAME}
25-
## is preferred for the same purpose.
26-
##
27-
## In order to load a library into your app from Java/Kotlin, you must call
28-
## System.loadLibrary() and pass the name of the library defined here;
29-
## for GameActivity/NativeActivity derived applications, the same library name must be
30-
## used in the AndroidManifest.xml file.
31-
#
32-
#
33-
#find_package(shadowhook REQUIRED CONFIG)
34-
#
35-
#add_library(${CMAKE_PROJECT_NAME} SHARED
36-
# # List C/C++ source files with relative paths to this CMakeLists.txt.
37-
# fixandroid14debuggablelag.cpp)
38-
#
39-
## Specifies libraries CMake should link to your target library. You
40-
## can link libraries from various origins, such as libraries defined in this
41-
## build script, prebuilt third-party libraries, or Android system libraries.
42-
#
43-
#
44-
#target_link_libraries(${CMAKE_PROJECT_NAME}
45-
# # List libraries link to the target library
46-
# android
47-
# log
48-
# shadowhook::shadowhook)
1+
# For more information about using CMake with Android Studio, read the
2+
# documentation: https://d.android.com/studio/projects/add-native-code.html.
3+
# For more examples on how to use CMake, see https://github.com/android/ndk-samples.
4+
5+
# Sets the minimum CMake version required for this project.
6+
cmake_minimum_required(VERSION 3.22.1)
7+
8+
9+
10+
11+
12+
# Declares the project name. The project name can be accessed via ${ PROJECT_NAME},
13+
# Since this is the top level CMakeLists.txt, the project name is also accessible
14+
# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level
15+
# build script scope).
16+
project("fixandroid14debuggablelag")
17+
18+
# Creates and names a library, sets it as either STATIC
19+
# or SHARED, and provides the relative paths to its source code.
20+
# You can define multiple libraries, and CMake builds them for you.
21+
# Gradle automatically packages shared libraries with your APK.
22+
#
23+
# In this top level CMakeLists.txt, ${CMAKE_PROJECT_NAME} is used to define
24+
# the target library name; in the sub-module's CMakeLists.txt, ${PROJECT_NAME}
25+
# is preferred for the same purpose.
26+
#
27+
# In order to load a library into your app from Java/Kotlin, you must call
28+
# System.loadLibrary() and pass the name of the library defined here;
29+
# for GameActivity/NativeActivity derived applications, the same library name must be
30+
# used in the AndroidManifest.xml file.
31+
32+
33+
find_package(shadowhook REQUIRED CONFIG)
34+
35+
add_library(${CMAKE_PROJECT_NAME} SHARED
36+
# List C/C++ source files with relative paths to this CMakeLists.txt.
37+
fixandroid14debuggablelag.cpp)
38+
39+
# Specifies libraries CMake should link to your target library. You
40+
# can link libraries from various origins, such as libraries defined in this
41+
# build script, prebuilt third-party libraries, or Android system libraries.
42+
43+
44+
target_link_libraries(${CMAKE_PROJECT_NAME}
45+
# List libraries link to the target library
46+
android
47+
log
48+
shadowhook::shadowhook)

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ appcompat = "1.6.1"
99
material = "1.10.0"
1010
activity = "1.8.0"
1111
constraintlayout = "2.1.4"
12+
shadowhook = "1.0.9"
1213

1314
[libraries]
1415
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
@@ -19,6 +20,7 @@ androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version
1920
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
2021
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
2122
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
23+
shadowhook = { module = "com.bytedance.android:shadowhook", version.ref = "shadowhook" }
2224

2325
[plugins]
2426
androidApplication = { id = "com.android.application", version.ref = "agp" }

0 commit comments

Comments
 (0)