Skip to content

Commit

Permalink
Convert to Linux line endings (LF)
Browse files Browse the repository at this point in the history
find . -type f -exec dos2unix {} \;
  • Loading branch information
chiteroman committed Oct 22, 2024
1 parent 15579aa commit 7ed05a4
Show file tree
Hide file tree
Showing 6 changed files with 280 additions and 280 deletions.
272 changes: 136 additions & 136 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,136 +1,136 @@
plugins {
alias(libs.plugins.android.application)
}

android {
namespace = "es.chiteroman.playintegrityfix"
compileSdk = 35
buildToolsVersion = "35.0.0"
ndkVersion = "27.1.12297006"

buildFeatures {
prefab = true
}

packaging {
resources {
excludes += "**"
}
}

defaultConfig {
applicationId = "es.chiteroman.playintegrityfix"
minSdk = 26
targetSdk = 35
versionCode = 17700
versionName = "v17.7"
multiDexEnabled = false

externalNativeBuild {
cmake {
abiFilters(
"arm64-v8a",
"armeabi-v7a"
)

arguments(
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON",
"-DANDROID_STL=none",
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
)

cFlags(
"-std=gnu23",
"-fvisibility=hidden",
"-fvisibility-inlines-hidden"
)

cppFlags(
"-std=gnu++26",
"-fno-exceptions",
"-fno-rtti",
"-fvisibility=hidden",
"-fvisibility-inlines-hidden"
)
}
}
}

buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
multiDexEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.30.3"
}
}
}

dependencies {
implementation(libs.cxx)
implementation(libs.hiddenapibypass)
}

tasks.register("updateModuleProp") {
doLast {
val versionName = project.android.defaultConfig.versionName
val versionCode = project.android.defaultConfig.versionCode

val modulePropFile = project.rootDir.resolve("module/module.prop")

var content = modulePropFile.readText()

content = content.replace(Regex("version=.*"), "version=$versionName")
content = content.replace(Regex("versionCode=.*"), "versionCode=$versionCode")

modulePropFile.writeText(content)
}
}

tasks.register("copyFiles") {
dependsOn("updateModuleProp")

doLast {
val moduleFolder = project.rootDir.resolve("module")
val dexFile =
project.layout.buildDirectory.get().asFile.resolve("intermediates/dex/release/minifyReleaseWithR8/classes.dex")
val soDir =
project.layout.buildDirectory.get().asFile.resolve("intermediates/stripped_native_libs/release/stripReleaseDebugSymbols/out/lib")

dexFile.copyTo(moduleFolder.resolve("classes.dex"), overwrite = true)

soDir.walk().filter { it.isFile && it.extension == "so" }.forEach { soFile ->
val abiFolder = soFile.parentFile.name
val destination = moduleFolder.resolve("zygisk/$abiFolder.so")
soFile.copyTo(destination, overwrite = true)
}
}
}

tasks.register<Zip>("zip") {
dependsOn("copyFiles")

archiveFileName.set("PlayIntegrityFix_${project.android.defaultConfig.versionName}.zip")
destinationDirectory.set(project.rootDir.resolve("out"))

from(project.rootDir.resolve("module"))
}

afterEvaluate {
tasks["assembleRelease"].finalizedBy("updateModuleProp", "copyFiles", "zip")
}
plugins {
alias(libs.plugins.android.application)
}

android {
namespace = "es.chiteroman.playintegrityfix"
compileSdk = 35
buildToolsVersion = "35.0.0"
ndkVersion = "27.1.12297006"

buildFeatures {
prefab = true
}

packaging {
resources {
excludes += "**"
}
}

defaultConfig {
applicationId = "es.chiteroman.playintegrityfix"
minSdk = 26
targetSdk = 35
versionCode = 17700
versionName = "v17.7"
multiDexEnabled = false

externalNativeBuild {
cmake {
abiFilters(
"arm64-v8a",
"armeabi-v7a"
)

arguments(
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON",
"-DANDROID_STL=none",
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
)

cFlags(
"-std=gnu23",
"-fvisibility=hidden",
"-fvisibility-inlines-hidden"
)

cppFlags(
"-std=gnu++26",
"-fno-exceptions",
"-fno-rtti",
"-fvisibility=hidden",
"-fvisibility-inlines-hidden"
)
}
}
}

buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
multiDexEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.30.3"
}
}
}

dependencies {
implementation(libs.cxx)
implementation(libs.hiddenapibypass)
}

tasks.register("updateModuleProp") {
doLast {
val versionName = project.android.defaultConfig.versionName
val versionCode = project.android.defaultConfig.versionCode

val modulePropFile = project.rootDir.resolve("module/module.prop")

var content = modulePropFile.readText()

content = content.replace(Regex("version=.*"), "version=$versionName")
content = content.replace(Regex("versionCode=.*"), "versionCode=$versionCode")

modulePropFile.writeText(content)
}
}

tasks.register("copyFiles") {
dependsOn("updateModuleProp")

doLast {
val moduleFolder = project.rootDir.resolve("module")
val dexFile =
project.layout.buildDirectory.get().asFile.resolve("intermediates/dex/release/minifyReleaseWithR8/classes.dex")
val soDir =
project.layout.buildDirectory.get().asFile.resolve("intermediates/stripped_native_libs/release/stripReleaseDebugSymbols/out/lib")

dexFile.copyTo(moduleFolder.resolve("classes.dex"), overwrite = true)

soDir.walk().filter { it.isFile && it.extension == "so" }.forEach { soFile ->
val abiFolder = soFile.parentFile.name
val destination = moduleFolder.resolve("zygisk/$abiFolder.so")
soFile.copyTo(destination, overwrite = true)
}
}
}

tasks.register<Zip>("zip") {
dependsOn("copyFiles")

archiveFileName.set("PlayIntegrityFix_${project.android.defaultConfig.versionName}.zip")
destinationDirectory.set(project.rootDir.resolve("out"))

from(project.rootDir.resolve("module"))
}

afterEvaluate {
tasks["assembleRelease"].finalizedBy("updateModuleProp", "copyFiles", "zip")
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<manifest />
74 changes: 37 additions & 37 deletions app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
cmake_minimum_required(VERSION 3.30.3)

project("playintegrityfix")

find_package(cxx REQUIRED CONFIG)

link_libraries(cxx::cxx)

if (${ANDROID_ABI} STREQUAL "arm64-v8a")
set(ARCH "arm64")
elseif (${ANDROID_ABI} STREQUAL "armeabi-v7a")
set(ARCH "arm")
endif ()

file(GLOB SHADOWHOOK_SRC
shadowhook/*.c
shadowhook/arch/${ARCH}/*.c
shadowhook/common/*.c
shadowhook/third_party/xdl/*.c
)

add_library(${CMAKE_PROJECT_NAME} SHARED
main.cpp
${SHADOWHOOK_SRC}
)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
shadowhook
shadowhook/arch/${ARCH}
shadowhook/include
shadowhook/common
shadowhook/third_party/bsd
shadowhook/third_party/lss
shadowhook/third_party/xdl
)

target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE log)
cmake_minimum_required(VERSION 3.30.3)

project("playintegrityfix")

find_package(cxx REQUIRED CONFIG)

link_libraries(cxx::cxx)

if (${ANDROID_ABI} STREQUAL "arm64-v8a")
set(ARCH "arm64")
elseif (${ANDROID_ABI} STREQUAL "armeabi-v7a")
set(ARCH "arm")
endif ()

file(GLOB SHADOWHOOK_SRC
shadowhook/*.c
shadowhook/arch/${ARCH}/*.c
shadowhook/common/*.c
shadowhook/third_party/xdl/*.c
)

add_library(${CMAKE_PROJECT_NAME} SHARED
main.cpp
${SHADOWHOOK_SRC}
)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
shadowhook
shadowhook/arch/${ARCH}
shadowhook/include
shadowhook/common
shadowhook/third_party/bsd
shadowhook/third_party/lss
shadowhook/third_party/xdl
)

target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE log)
22 changes: 11 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[versions]
agp = "8.7.0"
cxx = "27.0.12077973"
hiddenapibypass = "4.3"

[libraries]
cxx = { group = "org.lsposed.libcxx", name = "libcxx", version.ref = "cxx" }
hiddenapibypass = { group = "org.lsposed.hiddenapibypass", name = "hiddenapibypass", version.ref = "hiddenapibypass" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
[versions]
agp = "8.7.0"
cxx = "27.0.12077973"
hiddenapibypass = "4.3"

[libraries]
cxx = { group = "org.lsposed.libcxx", name = "libcxx", version.ref = "cxx" }
hiddenapibypass = { group = "org.lsposed.hiddenapibypass", name = "hiddenapibypass", version.ref = "hiddenapibypass" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
12 changes: 6 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Oct 03 16:27:21 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#Thu Oct 03 16:27:21 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 7ed05a4

Please sign in to comment.