Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
areteruhiro committed Nov 14, 2024
2 parents 99698ce + 204b7fe commit 6bae1a8
Show file tree
Hide file tree
Showing 14 changed files with 125 additions and 58 deletions.
6 changes: 0 additions & 6 deletions .github/CODEOWNERS

This file was deleted.

80 changes: 52 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ name: Build

on:
push:
paths:
- '.github/workflows/build.yml'
- 'app/**'
- 'gradle/**'
- '*.gradle'
- '*.properties'
paths-ignore:
- '*.md'
- '*.txt'
tags-ignore:
- '*'
pull_request:
workflow_dispatch:
inputs:
Expand All @@ -28,6 +27,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
discussions: write
steps:

- name: Checkout
Expand All @@ -36,15 +36,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 +55,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 +74,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 +100,67 @@ jobs:
cat << EOF > conf
https://github.com/JingMatrix/LSPatch/releases/latest/download/lspatch.jar
out=lspatch.jar
https://d.apkpure.net/b/APK/jp.naver.line.android?versionCode=${{ env.line_ver_code }}&nc=arm64-v8a%2Carmeabi-v7a&sv=28
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>
15 changes: 11 additions & 4 deletions 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 Expand Up @@ -43,13 +43,15 @@ LINEアプリの <kbd>ホーム</kbd> > <kbd>⚙</kbd> から「**設定**」に
- 常にミュートメッセージとして送信
- 送信時「通常メッセージ」を選択すれば通知されます
- トラッキング通信のブロック
- `noop`, `pushRecvReports`, `reportDeviceState`, `reportLocation`, `reportNetworkStatus` がブロックされます
- `noop`, `pushRecvReports`, `reportDeviceState`, `reportLocation`, `reportNetworkStatus` をブロック
- 通信内容をログに出力
- 通信内容を改変
- JavaScript で通信内容を改変できます (後述)

### JavaScript で通信内容を改変する

<details>

設定の「リクエストを改変」、「レスポンスを改変」では、Rhino の JavaScript コードを記述することで自由に通信内容を改変できます。これを利用して新たな機能が実装可能なことを確認済みです (`HOOK_SAMPLE.md`)。

あらかじめ `data` という変数が用意されており、以下のプロパティが含まれます。
Expand All @@ -64,13 +66,17 @@ LINEアプリの <kbd>ホーム</kbd> > <kbd>⚙</kbd> から「**設定**」に
リクエスト・レスポンスともに、JavaScript は他の処理より早く実行され、「通信内容にログを出力」は最後に実行されます。
Rhino の仕様、特に **Java 文字列との比較に `equals` を用いる**必要があることに注意してください。

</details>

## インストール

初めに、以下のサイトの中から、
**LINE 14.16.0****LIME 1.10.1** の APK をダウンロードしてください。
**LINE****LIME** の APK をダウンロードしてください。
バージョンは Releases に書いているものを参照してください。

> [!IMPORTANT]
> 分割 APK は使用しないでください
> 分割 APK は使用しないでください。
> 無理やり結合せず、必ずオリジナルのAPKを使ってください。
LI**N**E
- [APKMirror](https://www.apkmirror.com/uploads/?appcategory=line)
Expand All @@ -96,6 +102,7 @@ LI**M**E
> - Google アカウント (ドライブ) を使用したトーク履歴の復元ができない
> ([この方法](https://github.com/Chipppppppppp/LIME/issues/50#issuecomment-2174842592) でログインすれば可能)
> - 発/着信音が鳴らない
> 疑似着信音の再現機能はあります
> - 着信が入るとクラッシュ
> - コインの購入が不可
> - LINE Pay の一部の機能が使用不可
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
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

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

<activity
android:name=".MainActivity"
Expand All @@ -14,6 +15,7 @@
<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>
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

3 comments on commit 6bae1a8

@areteruhiro
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ、取り消せますか、、

@s1204IT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@areteruhiro
master ブランチの方は取り消しました。

@areteruhiro
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。PRをしようとしたらエラーが発生して色々していたら、マージされてしまって、

Please sign in to comment.