Skip to content

Commit

Permalink
XMLの余分な空白を除去と改行コードをLFに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
reindex-ot committed Nov 15, 2024
2 parents 53fb538 + bf88b45 commit 578cecf
Show file tree
Hide file tree
Showing 14 changed files with 166 additions and 67 deletions.
78 changes: 50 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -28,6 +25,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
discussions: write
steps:

- name: Checkout
Expand All @@ -36,15 +34,15 @@ jobs:
- name: Set environments
run: |
{
echo "version=v$(grep versionName app/build.gradle | awk '{print $2}' | tr -d \")"
echo "line_ver_code=$(grep HOOK_TARGET_VERSION app/build.gradle | awk '{print $4}' | tr -d \'\")"
echo "packageId=$(grep namespace app/build.gradle | awk '{print $2}' | tr -d \')"
echo "versionName=v$(grep versionName app/build.gradle | awk '{print $2}' | tr -d \")"
echo "versionCode=$(grep versionCode app/build.gradle | awk '{print $2}')"
echo "LINE_versionName=$(echo '${{ env.line_ver_code }}' | awk '{print substr($0,1,2)"."substr($0,3,2)"."int(substr($0,5,1))}')"
echo "LINE_versionCode=$(grep HOOK_TARGET_VERSION app/build.gradle | awk '{print $4}' | tr -d \'\")"
echo "commit=$(echo ${{ github.sha }} | cut -c-7)"
echo "repo=$(echo ${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/})"
} >> $GITHUB_ENV
- name: Set LINE Original Version Name
run: echo "line_ver=$(echo '${{ env.line_ver_code }}' | awk '{print substr($0,1,2)"."substr($0,3,2)"."int(substr($0,5,1))}')" >> $GITHUB_ENV

- name: Setup Java
uses: actions/setup-java@v4
with:
Expand All @@ -55,7 +53,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:
Expand All @@ -74,22 +72,22 @@ jobs:
echo ""
exit 1
fi
if [ "${{ steps.previous.outputs.tag }}" == "${{ env.version }}" ]; then
if [ "${{ steps.previous.outputs.tag }}" == "${{ env.versionName }}" ]; then
echo -e "\nERROR!\nThe same tag already exists!\n"
echo "Please change versionName in build.gradle"
echo ""
exit 1
fi
- name: Build with Gradle
- name: Build module
run: |
if [ "${{ inputs.release }}" == "true" ]; then
echo "${{ secrets.STORE_FILE }}" | base64 -d > app/release.jks
export STORE_PASSWORD="${{ secrets.STORE_PASSWORD }}"
export KEY_ALIAS="${{ secrets.KEY_ALIAS }}"
export KEY_PASSWORD="${{ secrets.KEY_PASSWORD }}"
./gradlew assembleRelease --no-daemon --stacktrace
cp -f app/build/outputs/apk/release/app-release.apk ${{ env.repo }}-${{ env.version }}.apk
cp -f app/build/outputs/apk/release/app-release.apk ${{ env.repo }}-${{ env.versionName }}.apk
else
./gradlew assembleDebug --no-daemon --stacktrace
fi
Expand All @@ -100,43 +98,67 @@ jobs:
cat << EOF > conf
https://github.com/JingMatrix/LSPatch/releases/latest/download/lspatch.jar
out=lspatch.jar
https://line-android-universal-download.line-scdn.net/line-${{ env.line_ver }}.apk
out=line-${{ env.line_ver }}.apk
https://line-android-universal-download.line-scdn.net/line-${{ env.LINE_versionName }}.apk
out=line-${{ env.LINE_versionName }}.apk
EOF
echo "Downloading APK..."
aria2c --no-conf -x16 -s16 -R -m0 -V --async-dns=false -iconf
echo "Patching LIME..."
java -jar lspatch.jar "line-${{ env.line_ver }}.apk" -m "app/build/outputs/apk/debug/app-debug.apk" -l 2 -v
java -jar lspatch.jar "line-${{ env.LINE_versionName }}.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:
name: ${{ env.repo }}-${{ env.version }}@${{ env.commit }}
name: ${{ env.repo }}-${{ env.versionName }}@${{ env.commit }}
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:
name: LINE-${{ env.line_ver }}@${{ env.commit }}
path: line-${{ env.line_ver }}-*-lspatched.apk
name: LINE-${{ env.LINE_versionName }}@${{ env.commit }}
path: line-${{ env.LINE_versionName }}-*-lspatched.apk
if-no-files-found: error

- name: Release
- name: Release original repository
uses: softprops/action-gh-release@v2
if: github.event.inputs.release == 'true'
with:
tag_name: ${{ env.version }}
tag_name: ${{ env.versionName }}
draft: false
prerelease: false
files: ${{ env.repo }}-${{ env.version }}.apk
make_latest: true
discussion_category_name: Announcements
generate_release_notes: true
files: ${{ env.repo }}-${{ env.versionName }}.apk
fail_on_unmatched_files: true
body: |
# 更新内容
## 対応するLINEのバージョン
${{ env.line_ver }}
${{ env.LINE_versionName }}
### 差分
https://github.com/${{ github.repository }}/compare/${{ steps.previous.outputs.tag }}...${{ env.version }}
https://github.com/${{ github.repository }}/compare/${{ steps.previous.outputs.tag }}...${{ env.versionName }}
- name: Release to Xposed repository
uses: softprops/action-gh-release@v2
if: github.event.inputs.release == 'true'
with:
repository: Xposed-Modules-Repo/${{ env.packageId }}
tag_name: ${{ env.versionCode }}-${{ env.versionName }}
draft: false
prerelease: false
make_latest: true
files: ${{ env.repo }}-${{ env.versionName }}.apk
body: |
## Details
https://github.com/${{ github.repository }}/releases/${{ env.versionName }}
## Supported LINE version
${{ env.LINE_versionName }}
### Diff
https://github.com/${{ github.repository }}/compare/${{ steps.previous.outputs.tag }}...${{ env.versionName }}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# IntelliJ
/.idea/
# Gradle Build
/app/build/
build/
# Android Studio Signing APK
/app/debug/
/app/release/
/app/release/
# VS Code
/.vscode/
4 changes: 3 additions & 1 deletion HOOK_SAMPLE.md
Original file line number Diff line number Diff line change
@@ -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 のみ対応

<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>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="app/src/main/ic_launcher-playstore.png" width="60px"> LIME: Adkiller for LINE
# <img src="app/src/main/ic_launcher-playstore.png" width="60px"> LIME: Ad-killer for LINE

[![Latest Release](https://img.shields.io/github/v/release/Chipppppppppp/LIME?label=latest)](https://github.com/Chipppppppppp/LIME/releases/latest)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
Expand Down
8 changes: 7 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 files('libxposed/api-100.jar')
//noinspection GradleCompatible
implementation 'com.android.support:customtabs:23.0.0'
compileOnly 'de.robv.android.xposed:api:82'
implementation 'org.mozilla:rhino:1.7.15'
}

Expand Down
Binary file added app/libxposed/api-100.jar
Binary file not shown.
29 changes: 28 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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 <init>(...);
public void onPackageLoaded(...);
public void onSystemServerLoaded(...);
}
-keep,allowoptimization,allowobfuscation @io.github.libxposed.api.annotations.* class * {
@io.github.libxposed.api.annotations.BeforeInvocation <methods>;
@io.github.libxposed.api.annotations.AfterInvocation <methods>;
}
-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
57 changes: 40 additions & 17 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:icon="@mipmap/ic_launcher" android:label="@string/app_name">
<activity android:name=".MainActivity" android:clearTaskOnLaunch="true" android:exported="true" android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="de.robv.android.xposed.category.MODULE_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="xposedmodule" android:value="true" />
<meta-data android:name="xposeddescription" android:value="@string/xposed_desc" />
<meta-data android:name="xposedminversion" android:value="53" />
<meta-data android:name="xposedsharedprefs" android:value="true" />
<meta-data android:name="xposedscope" android:value="jp.naver.line.android" />
</application>
</manifest>

<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:description="@string/xposed_desc">

<activity
android:name=".MainActivity"
android:clearTaskOnLaunch="true"
android:exported="true"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />

<category android:name="de.robv.android.xposed.category.MODULE_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="@string/xposed_desc" />
<meta-data
android:name="xposedminversion"
android:value="53" />
<meta-data
android:name="xposedsharedprefs"
android:value="true" />
<meta-data
android:name="xposedscope"
android:value="jp.naver.line.android" />

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,25 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
WebView webView = findWebView(rootView);

if (webView != null) {
String currentUrl = webView.getUrl();

if (currentUrl != null && (
currentUrl.startsWith("https://account-center.lylink.yahoo.co.jp") ||
currentUrl.startsWith("https://access.line.me") ||
currentUrl.startsWith("https://id.lylink.yahoo.co.jp/federation/ly/normal/callback/first") ||
currentUrl.startsWith("https://liff.line.me") ||
currentUrl.startsWith("https://lin.ee") ||
currentUrl.startsWith("https://line.me/R/") ||
currentUrl.startsWith("line://")
)
) {
return;
}

webView.setVisibility(View.GONE);
webView.stopLoading();

Uri uri = Uri.parse(webView.getUrl());
Uri uri = Uri.parse(currentUrl);

if (limeOptions.openInBrowser.checked) {
Intent intent = new Intent(Intent.ACTION_VIEW);
Expand All @@ -48,7 +63,6 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}

activity.finish();

}
}
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/resources/META-INF/xposed/java_init.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.github.chipppppppppp.lime.Main
3 changes: 3 additions & 0 deletions app/src/main/resources/META-INF/xposed/module.prop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minApiVersion=100
targetApiVersion=100
staticScope=true
1 change: 1 addition & 0 deletions app/src/main/resources/META-INF/xposed/scope.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jp.naver.line.android
19 changes: 6 additions & 13 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
android.nonFinalResIds=false
android.enableR8.fullMode=true
android.experimental.enableNewResourceShrinker=true
android.experimental.enableNewResourceShrinker.preciseShrinking=true
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
7 changes: 6 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ pluginManagement {
mavenCentral()
}
plugins {
id 'com.android.application' version '8.6.1' apply false
id 'com.android.application' version '8.7.2' apply false
}
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = "https://api.xposed.info" }
mavenLocal {
content {
includeGroup("io.github.libxposed")
}
}
}
}

Expand Down

0 comments on commit 578cecf

Please sign in to comment.