Skip to content

Modernize build logic#708

Closed
Goooler wants to merge 90 commits intoMetaCubeX:mainfrom
Goooler:modernize
Closed

Modernize build logic#708
Goooler wants to merge 90 commits intoMetaCubeX:mainfrom
Goooler:modernize

Conversation

@Goooler
Copy link
Copy Markdown

@Goooler Goooler commented Apr 15, 2026

Fix tons of build issues, migrate the Golang plugin, and polish dependencies.

Closes #456.

OLD: old.apk (signature: V1, V2)
NEW: new.apk (signature: V2)

          │             compressed             │            uncompressed            
          ├───────────┬───────────┬────────────┼───────────┬───────────┬────────────
 APK      │ old       │ new       │ diff       │ old       │ new       │ diff       
──────────┼───────────┼───────────┼────────────┼───────────┼───────────┼────────────
      dex │   1.6 MiB │   1.5 MiB │  -36.1 KiB │   3.6 MiB │   3.5 MiB │ -131.2 KiB 
     arsc │ 947.8 KiB │ 865.3 KiB │  -82.5 KiB │ 947.7 KiB │ 865.2 KiB │  -82.5 KiB 
 manifest │   5.4 KiB │   5.4 KiB │      +43 B │  25.7 KiB │  25.8 KiB │     +196 B 
      res │ 418.8 KiB │ 335.4 KiB │  -83.4 KiB │ 627.2 KiB │ 493.8 KiB │ -133.5 KiB 
   native │  59.6 MiB │  59.2 MiB │ -499.4 KiB │ 161.6 MiB │ 160.8 MiB │ -860.8 KiB 
    asset │  12.3 MiB │  12.2 MiB │  -90.5 KiB │    25 MiB │  24.9 MiB │ -145.3 KiB 
    other │ 137.6 KiB │  40.9 KiB │  -96.7 KiB │ 224.8 KiB │  84.8 KiB │ -139.9 KiB 
──────────┼───────────┼───────────┼────────────┼───────────┼───────────┼────────────
    total │    75 MiB │  74.1 MiB │ -888.7 KiB │   192 MiB │ 190.6 MiB │   -1.5 MiB 

 DEX     │ old   │ new   │ diff                
─────────┼───────┼───────┼─────────────────────
   files │     1 │     1 │     0               
 strings │ 27569 │ 26988 │  -581 (+2457 -3038) 
   types │  5685 │  5421 │  -264 (+526 -790)   
 classes │  4468 │  4238 │  -230 (+480 -710)   
 methods │ 24454 │ 23023 │ -1431 (+4144 -5575) 
  fields │ 14603 │ 13913 │  -690 (+2139 -2829) 

 ARSC    │ old  │ new  │ diff             
─────────┼──────┼──────┼──────────────────
 configs │  244 │  230 │  -14 (+3 -17)    
 entries │ 3670 │ 3131 │ -539 (+274 -813) 


======================
====   MANIFEST   ====
======================

@@ -1,4 +1,4 @@
 <manifest
-    android:compileSdkVersion="35"
-    android:compileSdkVersionCodename="15"
+    android:compileSdkVersion="36"
+    android:compileSdkVersionCodename="16"
     android:versionCode="211026"
@@ -6,4 +6,4 @@
     package="com.github.metacubex.clash.alpha"
-    platformBuildVersionCode="35"
-    platformBuildVersionName="15"
+    platformBuildVersionCode="36"
+    platformBuildVersionName="16"
     xmlns:android="http://schemas.android.com/apk/res/android"
@@ -11,3 +11,3 @@
   <uses-sdk
+    <service
+        android:directBootAware="true"
+        android:exported="false"
+        android:name="androidx.room.MultiInstanceInvalidationService"
+        />
     <activity
@@ -504,2 +509,6 @@
       <meta-data
+          android:name="okhttp3.internal.platform.PlatformInitializer"
+          android:value="androidx.startup"
+          />
+      <meta-data
           android:name="androidx.profileinstaller.ProfileInstallerInitializer"
@@ -537,8 +546,3 @@
     <service
-        android:directBootAware="true"
         android:exported="false"
-        android:name="androidx.room.MultiInstanceInvalidationService"
-        />
-    <service
-        android:exported="false"
         android:name="com.google.android.datatransport.runtime.backends.TransportBackendDiscovery"

Goooler and others added 30 commits February 10, 2026 10:12
It should fix some stack issues.
Added labels to Renovate configuration.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Copilot AI and others added 26 commits March 6, 2026 03:35
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
# Conflicts:
#	.github/workflows/build-debug.yaml
#	.github/workflows/build-pre-release.yaml
#	.github/workflows/release.yml
#	.github/workflows/update-go-dependencies.yml
#	build.gradle.kts
#51)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Fixes

```FATAL EXCEPTION: main
Process: com.github.metacubex.clash.meta, PID: 11066
java.lang.RuntimeException: Unable to create application com.github.kr328.clash.MainApplication
  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:8144)
  at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2690)
  at android.os.Handler.dispatchMessage(Handler.java:132)
  at android.os.Looper.dispatchMessage(Looper.java:333)
  at android.os.Looper.loopOnce(Looper.java:263)
  at android.os.Looper.loop(Looper.java:367)
  at android.app.ActivityThread.main(ActivityThread.java:9287)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
Caused by: java.lang.IllegalStateException: Launcher activity not found for package com.github.metacubex.clash.meta
  at android.os.Parcel.createExceptionOrNull(Parcel.java:3381)
  at android.os.Parcel.createException(Parcel.java:3357)
  at android.os.Parcel.readException(Parcel.java:3340)
  at android.os.Parcel.readException(Parcel.java:3282)
  at android.content.pm.IShortcutService$Stub$Proxy.setDynamicShortcuts(IShortcutService.java:599)
  at android.content.pm.ShortcutManager.setDynamicShortcuts(ShortcutManager.java:152)
  at androidx.core.content.pm.ShortcutManagerCompat.setDynamicShortcuts(ShortcutManagerCompat.java:473)
  at com.github.kr328.clash.MainApplication.setupShortcuts(MainApplication.kt:87)
  at com.github.kr328.clash.MainApplication.onCreate(MainApplication.kt:39)
  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1396)
  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:8139)
  ... 10 more
```
… v1.11.0 (#57)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
|
[org.jetbrains.kotlinx:kotlinx-serialization-json](https://redirect.github.com/Kotlin/kotlinx.serialization)
| `1.10.0` → `1.11.0` |
![age](https://developer.mend.io/api/mc/badges/age/maven/org.jetbrains.kotlinx:kotlinx-serialization-json/1.11.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.jetbrains.kotlinx:kotlinx-serialization-json/1.10.0/1.11.0?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/4) for more information.

---

### Release Notes

<details>
<summary>Kotlin/kotlinx.serialization
(org.jetbrains.kotlinx:kotlinx-serialization-json)</summary>

###
[`v1.11.0`](https://redirect.github.com/Kotlin/kotlinx.serialization/blob/HEAD/CHANGELOG.md#1110--2026-04-10)

\==================

This release is based on Kotlin 2.3.20 and provides new Json exceptions
API and some bugfixes and improvements.

#### Expose Json exceptions structure

To make working with exceptions easier and providing proper error codes
in e.g., REST APIs,
classes `JsonException`, `JsonDecodingException`, and
`JsonEncodingException` are now public.
They have relevant public properties, such as `shortMessage`, `path`,
`offset`, and others.
This API is currently experimental, and we're going to improve it
further in the subsequent releases.
See the linked issues for the details:
[#&#8203;1930](https://redirect.github.com/Kotlin/kotlinx.serialization/issues/1930),
[#&#8203;1877](https://redirect.github.com/Kotlin/kotlinx.serialization/issues/1877).

#### Ability to hide user input from exception messages for
security/privacy reasons.

Historically, exception messages in kotlinx.serialization often included
the input Json itself for debuggability reason.
Such behavior may pose additional challenges for logging, analytics, and
other systems, since
a system is not always allowed to store user data due to
privacy/security reasons, which imposes additional sanitation logic.
To address this issue, a new property `exceptionsWithDebugInfo` is added
to `JsonConfiguration`.
Disable it to hide user input from exception messages.
IMPORTANT: This behavior will be enabled by default when this property
becomes stable.
See
[#&#8203;2590](https://redirect.github.com/Kotlin/kotlinx.serialization/issues/2590)
for more details.

#### Bugfixes and improvements

- CBOR: Relax value range check when decoding numbers
([#&#8203;3167](https://redirect.github.com/Kotlin/kotlinx.serialization/issues/3167))
- Use a specialized writeDecimalLong method for IO stream integrations
in Json
([#&#8203;3152](https://redirect.github.com/Kotlin/kotlinx.serialization/issues/3152))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/Goooler/ClashMetaForAndroid).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMTAuMiIsInVwZGF0ZWRJblZlciI6IjQzLjExMC4yIiwidGFyZ2V0QnJhbmNoIjoidHJ1bmsiLCJsYWJlbHMiOlsiVXBkYXRlIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
# Conflicts:
#	.github/workflows/build-debug.yaml
#	.github/workflows/build-pre-release.yaml
#	.github/workflows/release.yml
#	.github/workflows/update-go-dependencies.yml
#	app/src/main/java/com/github/kr328/clash/MainApplication.kt
#	build.gradle.kts
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [com.android.library](https://developer.android.com/studio/build)
([source](https://android.googlesource.com/platform/tools/base)) |
`9.1.0` → `9.1.1` |
![age](https://developer.mend.io/api/mc/badges/age/maven/com.android.library:com.android.library.gradle.plugin/9.1.1?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.android.library:com.android.library.gradle.plugin/9.1.0/9.1.1?slim=true)
|
| [com.android.application](https://developer.android.com/studio/build)
([source](https://android.googlesource.com/platform/tools/base)) |
`9.1.0` → `9.1.1` |
![age](https://developer.mend.io/api/mc/badges/age/maven/com.android.application:com.android.application.gradle.plugin/9.1.1?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.android.application:com.android.application.gradle.plugin/9.1.0/9.1.1?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/4) for more information.

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/Goooler/ClashMetaForAndroid).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMTAuMiIsInVwZGF0ZWRJblZlciI6IjQzLjExMC4yIiwidGFyZ2V0QnJhbmNoIjoidHJ1bmsiLCJsYWJlbHMiOlsiVXBkYXRlIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@wwqgtxx
Copy link
Copy Markdown

wwqgtxx commented Apr 15, 2026

As we've stated before, we won't accept increasing minSdkVersion without a sufficiently compelling reason, and based on your comparison, this slight reduction in size isn't enough to justify it.

On another note, we welcome your improvements to the Golang plugin, given that the original golang-gradle-plugin component stopped being updated years ago. However, we'd prefer it to be integrated directly into this codebase, rather than as an uncontrollable external dependency.

@wwqgtxx wwqgtxx closed this Apr 15, 2026
@Goooler Goooler deleted the modernize branch April 15, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants