From da7fd3b3921c33c594e3c0ff4c23ee73b8ff336c Mon Sep 17 00:00:00 2001 From: Syuugo Date: Sat, 9 Nov 2024 18:04:59 +0900 Subject: [PATCH] lspinit: Set up base system --- .github/ISSUE_TEMPLATE/config.yml | 3 ++ .github/workflows/build.yml | 39 ++++++++++++++----- .gitignore | 6 ++- HOOK_SAMPLE.md | 4 +- SOURCE_URL | 1 + SUMMARY | 1 + app/build.gradle | 8 +++- app/proguard-rules.pro | 29 +++++++++++++- app/src/main/AndroidManifest.xml | 3 +- .../resources/META-INF/xposed/java_init.list | 1 + .../resources/META-INF/xposed/module.prop | 3 ++ .../main/resources/META-INF/xposed/scope.list | 1 + gradle.properties | 18 +++------ settings.gradle | 7 +++- 14 files changed, 94 insertions(+), 30 deletions(-) create mode 100644 SOURCE_URL create mode 100644 SUMMARY create mode 100644 app/src/main/resources/META-INF/xposed/java_init.list create mode 100644 app/src/main/resources/META-INF/xposed/module.prop create mode 100644 app/src/main/resources/META-INF/xposed/scope.list diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index dd14156a..622e203a 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -6,3 +6,6 @@ contact_links: - name: Discussions url: https://github.com/Chipppppppppp/LIME/discussions/new?category=q-a about: 質問等はこちらへ + - name: How to fix build error + url: https://github.com/orgs/LSPosed/discussions/2444#discussioncomment-7092338 + about: ビルドに失敗した場合 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e583435..f9896aa0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,12 +2,9 @@ name: Build on: push: - paths: - - '.github/workflows/build.yml' - - 'app/**' - - 'gradle/**' - - '*.gradle' - - '*.properties' + paths-ignore: + - '*.md' + - '*.txt' pull_request: workflow_dispatch: inputs: @@ -55,7 +52,7 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Get previous version name - uses: oprypin/find-latest-tag@v1.1.2 + uses: oprypin/find-latest-tag@v1 if: github.event.inputs.release == 'true' id: previous with: @@ -81,7 +78,29 @@ jobs: exit 1 fi - - name: Build with Gradle + - name: Cache maven + id: maven + uses: actions/cache@v4 + with: + path: ~/.m2/repository/ + key: mvn-${{ hashFiles('.github/workflows/build.yml') }} + restore-keys: mvn- + + - name: Checkout libxposed/api + if: steps.maven.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + repository: libxposed/api + ref: 64e29bd657ef4d2540b34402f5a988778f29e676 + path: libxposed/api + fetch-depth: 0 + + - name: Build dependency + if: steps.maven.outputs.cache-hit != 'true' + working-directory: libxposed/api + run: ./gradlew :api:publishApiPublicationToMavenLocal + + - name: Build module run: | if [ "${{ inputs.release }}" == "true" ]; then echo "${{ secrets.STORE_FILE }}" | base64 -d > app/release.jks @@ -108,7 +127,7 @@ jobs: echo "Patching LIME..." java -jar lspatch.jar "line-${{ env.line_ver }}.apk" -m "app/build/outputs/apk/debug/app-debug.apk" -l 2 -v - - name: Upload Module APK + - name: Upload module uses: actions/upload-artifact@v4 if: github.event.inputs.release != 'true' with: @@ -116,7 +135,7 @@ jobs: path: app/build/outputs/apk/debug/app-debug.apk if-no-files-found: error - - name: Upload Patched LINE APK + - name: Upload patched APK uses: actions/upload-artifact@v4 if: github.event.inputs.lspatch == 'true' with: diff --git a/.gitignore b/.gitignore index 50a90123..149bafb3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,9 @@ # IntelliJ /.idea/ # Gradle Build -/app/build/ +build/ # Android Studio Signing APK /app/debug/ -/app/release/ \ No newline at end of file +/app/release/ +# VS Code +/.vscode/ diff --git a/HOOK_SAMPLE.md b/HOOK_SAMPLE.md index 0769056e..01c1eab2 100644 --- a/HOOK_SAMPLE.md +++ b/HOOK_SAMPLE.md @@ -1 +1,3 @@ -https://telegra.ph/%E9%80%9A%E4%BF%A1%E3%81%AE%E6%94%B9%E5%A4%89%E3%81%AE%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AB-06-09 +v1.9.2 のみ対応 + + diff --git a/SOURCE_URL b/SOURCE_URL new file mode 100644 index 00000000..dc76f168 --- /dev/null +++ b/SOURCE_URL @@ -0,0 +1 @@ +https://github.com/Chipppppppppp/LIME diff --git a/SUMMARY b/SUMMARY new file mode 100644 index 00000000..810eeb9f --- /dev/null +++ b/SUMMARY @@ -0,0 +1 @@ +Adkiller for LINE diff --git a/app/build.gradle b/app/build.gradle index ba759591..282a04c9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -59,12 +59,18 @@ android { aaptOptions { additionalParameters '--allow-reserved-package-id', '--package-id', '0x64' } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 + } } dependencies { + compileOnly 'de.robv.android.xposed:api:82' + compileOnly 'io.github.libxposed:api:100' //noinspection GradleCompatible implementation 'com.android.support:customtabs:23.0.0' - compileOnly 'de.robv.android.xposed:api:82' implementation 'org.mozilla:rhino:1.7.15' } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index ab401ede..c25c22ac 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,2 +1,29 @@ -keep class io.github.chipppppppppp.lime.Main --ignorewarnings + +# Xposed +-adaptresourcefilecontents META-INF/xposed/java_init.list +-keepattributes RuntimeVisibleAnnotations + +-keep,allowobfuscation,allowoptimization public class * extends io.github.libxposed.api.XposedModule { + public (...); + public void onPackageLoaded(...); + public void onSystemServerLoaded(...); +} +-keep,allowoptimization,allowobfuscation @io.github.libxposed.api.annotations.* class * { + @io.github.libxposed.api.annotations.BeforeInvocation ; + @io.github.libxposed.api.annotations.AfterInvocation ; +} +-keep,allowshrinking,allowoptimization,allowobfuscation class ** implements io.github.libxposed.api.XposedInterface$Hooker +-keepclassmembers,allowoptimization class ** implements io.github.libxposed.api.XposedInterface$Hooker { + public *** before(***); + public *** after(***); + public static *** before(); + public static *** before(io.github.libxposed.api.XposedInterface$BeforeHookCallback); + public static void after(); + public static void after(io.github.libxposed.api.XposedInterface$AfterHookCallback); + public static void after(io.github.libxposed.api.XposedInterface$AfterHookCallback, ***); +} + +# Obfuscation +-repackageclasses +-allowaccessmodification diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c6ba8f22..5d0067bb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -3,7 +3,8 @@ + android:label="@string/app_name" + android:description="@string/xposed_desc">