From 7ed05a41d7f3bf4aaee93c6e240f24e6f22ff579 Mon Sep 17 00:00:00 2001 From: chiteroman Date: Tue, 22 Oct 2024 12:15:16 +0200 Subject: [PATCH] Convert to Linux line endings (LF) find . -type f -exec dos2unix {} \; --- app/build.gradle.kts | 272 +++++++++++------------ app/src/main/AndroidManifest.xml | 2 +- app/src/main/cpp/CMakeLists.txt | 74 +++--- gradle/libs.versions.toml | 22 +- gradle/wrapper/gradle-wrapper.properties | 12 +- gradlew.bat | 178 +++++++-------- 6 files changed, 280 insertions(+), 280 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7e75a0335..2f9697871 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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") { - 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") { + 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") +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3307882a7..568741e54 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + \ No newline at end of file diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index d0a86eb54..684c4052e 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -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) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 69961c039..7f2bb60ad 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d773081f..a53991cbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/gradlew.bat b/gradlew.bat index ac1b06f93..107acd32c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega