Skip to content

Commit c11fef6

Browse files
authored
Migrate: migrate to new dependencies (#28)
* Migrate: migrate to new dependencies * Chore: bump version * Fix: fix changelog publishing
1 parent 930d9a4 commit c11fef6

20 files changed

+205
-175
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.bat text eol=crlf
3+
*.jar binary

.github/workflows/publish-update-json.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ jobs:
3737
mkdir -p "$TEMP_ROOT"
3838
3939
echo "Generate changelog.md"
40-
41-
echo '${{ github.event.release.body }}' > "$PUBLIC_ROOT/changelog.md"
40+
41+
cat << __EOF_OF_CHANGELOGS__ > "$PUBLIC_ROOT/changelog.md"
42+
${{ github.event.release.body }}
43+
__EOF_OF_CHANGELOGS__
4244
4345
echo "Fetching release assets"
4446

app/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import com.android.build.api.artifact.SingleArtifact
2-
31
plugins {
42
id("com.android.application")
53
}
64

5+
android {
6+
namespace = "com.github.kr328.clipboard"
7+
}
8+
79
dependencies {
810
compileOnly(project(":hideapi"))
911

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.github.kr328.clipboard">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission
76
android:name="android.permission.QUERY_ALL_PACKAGES"

build.gradle.kts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import com.android.build.gradle.BaseExtension
33
import java.util.*
44

55
plugins {
6-
val agp = "7.1.2"
7-
val zygote = "2.6"
8-
val refine = "3.1.1"
6+
val agp = "7.4.1"
7+
val zygote = "3.0"
8+
val refine = "4.0.0"
99

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

21-
println("Configure $name: isApp = $isApp")
22-
2321
compileSdkVersion(31)
2422

2523
defaultConfig {
@@ -28,10 +26,10 @@ subprojects {
2826
}
2927

3028
minSdk = 29
31-
targetSdk = 31
29+
targetSdk = 33
3230

33-
versionName = "v23"
34-
versionCode = 23
31+
versionName = "v24"
32+
versionCode = 24
3533

3634
if (!isApp) {
3735
consumerProguardFiles("consumer-rules.pro")

gradle/wrapper/gradle-wrapper.jar

1.71 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

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

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac
@@ -205,6 +209,12 @@ set -- \
205209
org.gradle.wrapper.GradleWrapperMain \
206210
"$@"
207211

212+
# Stop when "xargs" is not available.
213+
if ! command -v xargs >/dev/null 2>&1
214+
then
215+
die "xargs is not available"
216+
fi
217+
208218
# Use "xargs" to parse quoted args.
209219
#
210220
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

gradlew.bat

Lines changed: 92 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,92 @@
1-
@rem
2-
@rem Copyright 2015 the original author or authors.
3-
@rem
4-
@rem Licensed under the Apache License, Version 2.0 (the "License");
5-
@rem you may not use this file except in compliance with the License.
6-
@rem You may obtain a copy of the License at
7-
@rem
8-
@rem https://www.apache.org/licenses/LICENSE-2.0
9-
@rem
10-
@rem Unless required by applicable law or agreed to in writing, software
11-
@rem distributed under the License is distributed on an "AS IS" BASIS,
12-
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
@rem See the License for the specific language governing permissions and
14-
@rem limitations under the License.
15-
@rem
16-
17-
@if "%DEBUG%" == "" @echo off
18-
@rem ##########################################################################
19-
@rem
20-
@rem Gradle startup script for Windows
21-
@rem
22-
@rem ##########################################################################
23-
24-
@rem Set local scope for the variables with windows NT shell
25-
if "%OS%"=="Windows_NT" setlocal
26-
27-
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
29-
set APP_BASE_NAME=%~n0
30-
set APP_HOME=%DIRNAME%
31-
32-
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33-
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34-
35-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36-
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37-
38-
@rem Find java.exe
39-
if defined JAVA_HOME goto findJavaFromJavaHome
40-
41-
set JAVA_EXE=java.exe
42-
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
44-
45-
echo.
46-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47-
echo.
48-
echo Please set the JAVA_HOME variable in your environment to match the
49-
echo location of your Java installation.
50-
51-
goto fail
52-
53-
:findJavaFromJavaHome
54-
set JAVA_HOME=%JAVA_HOME:"=%
55-
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56-
57-
if exist "%JAVA_EXE%" goto execute
58-
59-
echo.
60-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61-
echo.
62-
echo Please set the JAVA_HOME variable in your environment to match the
63-
echo location of your Java installation.
64-
65-
goto fail
66-
67-
:execute
68-
@rem Setup the command line
69-
70-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71-
72-
73-
@rem Execute Gradle
74-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75-
76-
:end
77-
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
79-
80-
:fail
81-
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82-
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
85-
86-
:mainEnd
87-
if "%OS%"=="Windows_NT" endlocal
88-
89-
:omega
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
17+
@if "%DEBUG%"=="" @echo off
18+
@rem ##########################################################################
19+
@rem
20+
@rem Gradle startup script for Windows
21+
@rem
22+
@rem ##########################################################################
23+
24+
@rem Set local scope for the variables with windows NT shell
25+
if "%OS%"=="Windows_NT" setlocal
26+
27+
set DIRNAME=%~dp0
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
30+
set APP_BASE_NAME=%~n0
31+
set APP_HOME=%DIRNAME%
32+
33+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
34+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35+
36+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38+
39+
@rem Find java.exe
40+
if defined JAVA_HOME goto findJavaFromJavaHome
41+
42+
set JAVA_EXE=java.exe
43+
%JAVA_EXE% -version >NUL 2>&1
44+
if %ERRORLEVEL% equ 0 goto execute
45+
46+
echo.
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48+
echo.
49+
echo Please set the JAVA_HOME variable in your environment to match the
50+
echo location of your Java installation.
51+
52+
goto fail
53+
54+
:findJavaFromJavaHome
55+
set JAVA_HOME=%JAVA_HOME:"=%
56+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57+
58+
if exist "%JAVA_EXE%" goto execute
59+
60+
echo.
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62+
echo.
63+
echo Please set the JAVA_HOME variable in your environment to match the
64+
echo location of your Java installation.
65+
66+
goto fail
67+
68+
:execute
69+
@rem Setup the command line
70+
71+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72+
73+
74+
@rem Execute Gradle
75+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76+
77+
:end
78+
@rem End local scope for the variables with windows NT shell
79+
if %ERRORLEVEL% equ 0 goto mainEnd
80+
81+
:fail
82+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83+
rem the _cmd.exe /c_ return code!
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
exit /b %EXIT_CODE%
88+
89+
:mainEnd
90+
if "%OS%"=="Windows_NT" endlocal
91+
92+
:omega

hideapi/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ plugins {
22
id("com.android.library")
33
}
44

5+
android {
6+
namespace = "com.github.kr328.hideapi"
7+
}
8+
59
dependencies {
610
annotationProcessor(libs.refine.processor)
711

hideapi/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest package="com.github.kr328.hideapi"/>
2+
<manifest />

module/build.gradle.kts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ plugins {
77
}
88

99
android {
10+
namespace = "com.github.kr328.module"
11+
1012
sourceSets {
1113
all {
1214
assets.srcDir(buildDir.resolve("intermediates/manager_apk/$name"))
@@ -15,32 +17,34 @@ android {
1517
}
1618

1719
zygote {
18-
val moduleId = "clipboard_whitelist"
20+
val moduleId = "clipboard-whitelist"
1921
val moduleName = "Clipboard Whitelist"
2022
val moduleDescription = "Allow apps access clipboard in background."
2123
val moduleAuthor = "Kr328"
2224
val moduleEntrypoint = "com.github.kr328.clipboard.Main"
25+
val versionName = android.defaultConfig.versionName
2326

2427
packages(PACKAGE_SYSTEM_SERVER)
2528

2629
riru {
27-
id = "riru_$moduleId"
30+
id = "riru-$moduleId".replace('-', '_')
2831
name = "Riru - $moduleName"
29-
author = moduleAuthor
30-
description = moduleDescription
31-
entrypoint = moduleEntrypoint
32-
archiveName = "${id.replace('_', '-')}-${android.defaultConfig.versionName}"
33-
updateJson = "https://github.com/Kr328/Riru-ClipboardWhitelist/releases/latest/download/${id.replace('_', '-')}.json"
32+
archiveName = "riru-$moduleId-$versionName"
33+
updateJson = "https://github.com/Kr328/Riru-ClipboardWhitelist/releases/latest/download/riru-$moduleId.json"
3434
}
3535

3636
zygisk {
37-
id = "zygisk_$moduleId"
37+
id = "zygisk-$moduleId".replace('-', '_')
3838
name = "Zygisk - $moduleName"
39+
archiveName = "zygisk-$moduleId-$versionName"
40+
updateJson = "https://github.com/Kr328/Riru-ClipboardWhitelist/releases/latest/download/zygisk-$moduleId.json"
41+
}
42+
43+
all {
3944
author = moduleAuthor
4045
description = moduleDescription
4146
entrypoint = moduleEntrypoint
42-
archiveName = "${id.replace('_', '-')}-${android.defaultConfig.versionName}"
43-
updateJson = "https://github.com/Kr328/Riru-ClipboardWhitelist/releases/latest/download/${id.replace('_', '-')}.json"
47+
isUseBinderInterceptors = true
4448
}
4549
}
4650

@@ -77,4 +81,4 @@ dependencies {
7781
implementation(libs.magic.library)
7882
}
7983

80-
evaluationDependsOn(":app")
84+
evaluationDependsOn(":app")

module/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest package="com.github.kr328.module"/>
2+
<manifest />

0 commit comments

Comments
 (0)