Skip to content

Commit

Permalink
Migrate: migrate to new dependencies (#28)
Browse files Browse the repository at this point in the history
* Migrate: migrate to new dependencies

* Chore: bump version

* Fix: fix changelog publishing
  • Loading branch information
Kr328 authored Feb 5, 2023
1 parent 930d9a4 commit c11fef6
Show file tree
Hide file tree
Showing 20 changed files with 205 additions and 175 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto eol=lf
*.bat text eol=crlf
*.jar binary
6 changes: 4 additions & 2 deletions .github/workflows/publish-update-json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ jobs:
mkdir -p "$TEMP_ROOT"
echo "Generate changelog.md"
echo '${{ github.event.release.body }}' > "$PUBLIC_ROOT/changelog.md"
cat << __EOF_OF_CHANGELOGS__ > "$PUBLIC_ROOT/changelog.md"
${{ github.event.release.body }}
__EOF_OF_CHANGELOGS__
echo "Fetching release assets"
Expand Down
6 changes: 4 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import com.android.build.api.artifact.SingleArtifact

plugins {
id("com.android.application")
}

android {
namespace = "com.github.kr328.clipboard"
}

dependencies {
compileOnly(project(":hideapi"))

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.github.kr328.clipboard">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
Expand Down
14 changes: 6 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import com.android.build.gradle.BaseExtension
import java.util.*

plugins {
val agp = "7.1.2"
val zygote = "2.6"
val refine = "3.1.1"
val agp = "7.4.1"
val zygote = "3.0"
val refine = "4.0.0"

id("com.android.application") version agp apply false
id("com.android.library") version agp apply false
Expand All @@ -18,8 +18,6 @@ subprojects {
extensions.configure<BaseExtension> {
val isApp = this is AppExtension

println("Configure $name: isApp = $isApp")

compileSdkVersion(31)

defaultConfig {
Expand All @@ -28,10 +26,10 @@ subprojects {
}

minSdk = 29
targetSdk = 31
targetSdk = 33

versionName = "v23"
versionCode = 23
versionName = "v24"
versionCode = 24

if (!isApp) {
consumerProguardFiles("consumer-rules.pro")
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
181 changes: 92 additions & 89 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,89 +1,92 @@
@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=.
@rem This is normally unused
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% equ 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% equ 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!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
4 changes: 4 additions & 0 deletions hideapi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ plugins {
id("com.android.library")
}

android {
namespace = "com.github.kr328.hideapi"
}

dependencies {
annotationProcessor(libs.refine.processor)

Expand Down
2 changes: 1 addition & 1 deletion hideapi/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"?>
<manifest package="com.github.kr328.hideapi"/>
<manifest />
26 changes: 15 additions & 11 deletions module/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ plugins {
}

android {
namespace = "com.github.kr328.module"

sourceSets {
all {
assets.srcDir(buildDir.resolve("intermediates/manager_apk/$name"))
Expand All @@ -15,32 +17,34 @@ android {
}

zygote {
val moduleId = "clipboard_whitelist"
val moduleId = "clipboard-whitelist"
val moduleName = "Clipboard Whitelist"
val moduleDescription = "Allow apps access clipboard in background."
val moduleAuthor = "Kr328"
val moduleEntrypoint = "com.github.kr328.clipboard.Main"
val versionName = android.defaultConfig.versionName

packages(PACKAGE_SYSTEM_SERVER)

riru {
id = "riru_$moduleId"
id = "riru-$moduleId".replace('-', '_')
name = "Riru - $moduleName"
author = moduleAuthor
description = moduleDescription
entrypoint = moduleEntrypoint
archiveName = "${id.replace('_', '-')}-${android.defaultConfig.versionName}"
updateJson = "https://github.com/Kr328/Riru-ClipboardWhitelist/releases/latest/download/${id.replace('_', '-')}.json"
archiveName = "riru-$moduleId-$versionName"
updateJson = "https://github.com/Kr328/Riru-ClipboardWhitelist/releases/latest/download/riru-$moduleId.json"
}

zygisk {
id = "zygisk_$moduleId"
id = "zygisk-$moduleId".replace('-', '_')
name = "Zygisk - $moduleName"
archiveName = "zygisk-$moduleId-$versionName"
updateJson = "https://github.com/Kr328/Riru-ClipboardWhitelist/releases/latest/download/zygisk-$moduleId.json"
}

all {
author = moduleAuthor
description = moduleDescription
entrypoint = moduleEntrypoint
archiveName = "${id.replace('_', '-')}-${android.defaultConfig.versionName}"
updateJson = "https://github.com/Kr328/Riru-ClipboardWhitelist/releases/latest/download/${id.replace('_', '-')}.json"
isUseBinderInterceptors = true
}
}

Expand Down Expand Up @@ -77,4 +81,4 @@ dependencies {
implementation(libs.magic.library)
}

evaluationDependsOn(":app")
evaluationDependsOn(":app")
2 changes: 1 addition & 1 deletion module/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"?>
<manifest package="com.github.kr328.module"/>
<manifest />
Loading

0 comments on commit c11fef6

Please sign in to comment.