Skip to content

Commit

Permalink
Update APK for SagerNet derivatives (#667)
Browse files Browse the repository at this point in the history
Co-authored-by: dyhkwong <50692134+dyhkwong@users.noreply.github.com>
  • Loading branch information
klzgrad and dyhkwong committed Sep 11, 2024
1 parent 9b7d603 commit 23efc88
Show file tree
Hide file tree
Showing 11 changed files with 300 additions and 135 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ jobs:
BUNDLE: naiveproxy-plugin-${{ github.event.release.tag_name || 'v1' }}-${{ matrix.abi }}.apk
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Cache toolchains (Linux, OpenWrt, Android)
uses: actions/cache@v4
with:
Expand Down
1 change: 1 addition & 0 deletions apk/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.gradle/
app/build/
app/libs/
28 changes: 13 additions & 15 deletions apk/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

android {
namespace = "moe.matsuri.exe.naive"
namespace = "io.nekohasekai.sagernet.plugin.naive"

signingConfigs {
create("release") {
Expand All @@ -17,22 +17,20 @@ android {

buildTypes {
getByName("release") {
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
file("proguard-rules.pro")
)
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("release")
}
}

compileSdk = 33
buildToolsVersion = "35.0.0"

compileSdk = 35

defaultConfig {
minSdk = 21
targetSdk = 33
minSdk = 24
targetSdk = 35

applicationId = "moe.matsuri.exe.naive"
applicationId = "io.nekohasekai.sagernet.plugin.naive"
versionCode = System.getenv("APK_VERSION_NAME").removePrefix("v").split(".")[0].toInt()
versionName = System.getenv("APK_VERSION_NAME").removePrefix("v")
splits.abi {
Expand All @@ -44,12 +42,8 @@ android {
}

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

kotlinOptions {
jvmTarget = "1.8"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

lint {
Expand All @@ -59,6 +53,10 @@ android {
warningsAsErrors = true
}

packaging {
jniLibs.useLegacyPackaging = true
}

applicationVariants.all {
outputs.all {
this as com.android.build.gradle.internal.api.BaseVariantOutputImpl
Expand Down
7 changes: 3 additions & 4 deletions apk/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@

<application
android:allowBackup="false"
android:extractNativeLibs="true"
android:icon="@mipmap/ic_launcher"
android:label="Naïve For NekoBox"
android:label="Naïve Plugin"
android:roundIcon="@mipmap/ic_launcher_round">
<provider
android:name=".BinaryProvider"
android:authorities="moe.matsuri.exe.naive.BinaryProvider"
android:authorities="io.nekohasekai.sagernet.plugin.naive.BinaryProvider"
android:directBootAware="true"
android:exported="true"
tools:ignore="ExportedContentProvider">
Expand All @@ -29,7 +28,7 @@
<intent-filter>
<action android:name="io.nekohasekai.sagernet.plugin.ACTION_NATIVE_PLUGIN" />
<data
android:host="moe.matsuri.lite"
android:host="io.nekohasekai.sagernet"
android:path="/naive-plugin"
android:scheme="plugin" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* *
******************************************************************************/

package moe.matsuri.exe.naive
package io.nekohasekai.sagernet.plugin.naive

import android.net.Uri
import android.os.ParcelFileDescriptor
Expand Down
4 changes: 2 additions & 2 deletions apk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
classpath 'com.android.tools.build:gradle:8.6.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.20'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Binary file modified apk/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions apk/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Thu Jan 27 22:42:44 HKT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 23efc88

Please sign in to comment.