Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

基于Kotlin重构Android插件代码并支持多Flutter engine和更精准的result回调管理 #282

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ rootProject.allprojects {
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
Expand All @@ -32,9 +33,13 @@ android {
lintOptions {
disable 'InvalidPackage'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}

dependencies {
implementation 'cn.jiguang.sdk:jpush:4.0.9'
implementation 'cn.jiguang.sdk:jcore:2.8.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
17 changes: 2 additions & 15 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jiguang.jpush">
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE"/>
<application>
<receiver
android:name="com.jiguang.jpush.JPushPlugin$JPushReceiver"
<receiver android:name="com.jiguang.jpush.JPushEventReceiver"
android:enabled="true"
android:exported="false">
Comment on lines +5 to 7
Copy link
Author

@techwn techwn Jun 28, 2021

Choose a reason for hiding this comment

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

这里的修改是基于官方文档,添加enabled和exported属性以消除警告

<intent-filter>
<action android:name="cn.jpush.android.intent.REGISTRATION" />
<action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" />
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" />
<action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" />
<action android:name="cn.jpush.android.intent.NOTIFICATION_CLICK_ACTION" />
<action android:name="cn.jpush.android.intent.CONNECTION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>

<receiver android:name="com.jiguang.jpush.JPushEventReceiver">
<intent-filter>
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
<category android:name="${applicationId}" />
Expand All @@ -34,5 +22,4 @@
</intent-filter>
</service>
</application>
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE"/>
</manifest>

This file was deleted.

144 changes: 0 additions & 144 deletions android/src/main/java/com/jiguang/jpush/JPushEventReceiver.java

This file was deleted.

Loading