├── app
├── .gitignore
├── src
│ └── main
│ │ ├── res
│ │ ├── values
│ │ │ ├── strings.xml
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ └── styles.xml
│ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ │ └── dimens.xml
│ │ └── layout
│ │ │ ├── item.xml
│ │ │ ├── activity_launcher.xml
│ │ │ └── activity_main.xml
│ │ ├── java
│ │ └── com
│ │ │ └── jiang
│ │ │ └── android
│ │ │ └── pushdemo
│ │ │ ├── App.java
│ │ │ ├── LauncherActivity.java
│ │ │ ├── PushService.java
│ │ │ └── MainActivity.java
│ │ └── AndroidManifest.xml
├── proguard-rules.pro
└── build.gradle
├── push
├── .gitignore
├── libs
│ ├── pushsdk_v2.3.4.jar
│ ├── HwPush_SDK_V2705.jar
│ ├── com.coloros.mcssdk.jar
│ └── MiPush_SDK_Client_3_1_2.jar
├── src
│ └── main
│ │ ├── res
│ │ ├── drawable-hdpi
│ │ │ ├── send.png
│ │ │ ├── start.png
│ │ │ ├── upload.png
│ │ │ ├── pushnotify.png
│ │ │ └── ic_launcher.png
│ │ ├── drawable-mdpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-xhdpi
│ │ │ ├── hwpush_ic_cancel.png
│ │ │ ├── hwpush_list_icon.png
│ │ │ ├── hwpush_main_icon.png
│ │ │ ├── hwpush_progress.9.png
│ │ │ ├── hwpush_no_collection.png
│ │ │ ├── hwpush_ab_bottom_emui.9.png
│ │ │ ├── hwpush_background_emui.9.png
│ │ │ ├── hwpush_btn_check_on_emui.png
│ │ │ ├── hwpush_ic_cancel_light.png
│ │ │ ├── hwpush_ic_toolbar_back.png
│ │ │ ├── hwpush_ic_toolbar_delete.png
│ │ │ ├── hwpush_pic_ab_number.9.png
│ │ │ ├── hwpush_btn_check_off_emui.png
│ │ │ ├── hwpush_ic_toolbar_advance.png
│ │ │ ├── hwpush_ic_toolbar_collect.png
│ │ │ ├── hwpush_ic_toolbar_multiple.png
│ │ │ ├── hwpush_ic_toolbar_refresh.png
│ │ │ ├── hwpush_ic_toolbar_multiple1.png
│ │ │ ├── hwpush_list_activated_emui.9.png
│ │ │ ├── hwpush_pic_ab_number_light.9.png
│ │ │ ├── hwpush_btn_check_off_pressed_emui.png
│ │ │ └── hwpush_btn_check_on_pressed_emui.png
│ │ ├── values
│ │ │ ├── hwpush_styles.xml
│ │ │ ├── hwpush_colors.xml
│ │ │ ├── jpush_style.xml
│ │ │ ├── styles.xml
│ │ │ ├── strings.xml
│ │ │ └── hwpush_strings.xml
│ │ ├── layout
│ │ │ ├── hwpush_icons_layout.xml
│ │ │ ├── hwpush_buttons_layout.xml
│ │ │ ├── hwpush_layout8.xml
│ │ │ ├── hwpush_collect_tip_dialog.xml
│ │ │ ├── hwpush_collection_item.xml
│ │ │ ├── hwpush_layout4.xml
│ │ │ ├── hwpush_layout2.xml
│ │ │ ├── hwpush_layout7.xml
│ │ │ ├── hwpush_collection_listview.xml
│ │ │ └── hwpush_msg_show.xml
│ │ └── values-zh-rCN
│ │ │ └── hwpush_strings.xml
│ │ ├── java
│ │ └── com
│ │ │ └── jiang
│ │ │ └── android
│ │ │ └── push
│ │ │ ├── utils
│ │ │ ├── Target.java
│ │ │ ├── L.java
│ │ │ ├── JHandler.java
│ │ │ ├── BuildProperties.java
│ │ │ ├── JsonUtils.java
│ │ │ └── RomUtil.java
│ │ │ ├── IPushManager.java
│ │ │ ├── model
│ │ │ └── TokenModel.java
│ │ │ ├── PushInterface.java
│ │ │ ├── Message.java
│ │ │ ├── vivo
│ │ │ ├── PushMessageReceiverImpl.java
│ │ │ └── ViVOPushManager.java
│ │ │ ├── flyme
│ │ │ ├── FlymePushManager.java
│ │ │ └── FlymeReceiver.java
│ │ │ ├── emui
│ │ │ ├── EMPushManager.java
│ │ │ └── EMHuaweiPushReceiver.java
│ │ │ ├── jpush
│ │ │ ├── JPushManager.java
│ │ │ └── JPushReceiver.java
│ │ │ ├── Const.java
│ │ │ ├── Push.java
│ │ │ ├── oppo
│ │ │ └── OppoPushManager.java
│ │ │ └── miui
│ │ │ ├── MiuiPushManager.java
│ │ │ └── MiuiReceiver.java
│ │ └── AndroidManifest.xml
├── build.gradle
└── proguard-rules.pro
├── settings.gradle
├── code.zip
├── aar
├── gslb-3.0.9.aar
├── common-1.0.10.aar
├── usage-stats-2.5.1.aar
└── push-internal-3.1.160901.aar
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── gradle.properties
├── LICENSE.txt
└── README.md
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/push/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':push'
2 |
--------------------------------------------------------------------------------
/code.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/code.zip
--------------------------------------------------------------------------------
/aar/gslb-3.0.9.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/aar/gslb-3.0.9.aar
--------------------------------------------------------------------------------
/aar/common-1.0.10.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/aar/common-1.0.10.aar
--------------------------------------------------------------------------------
/aar/usage-stats-2.5.1.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/aar/usage-stats-2.5.1.aar
--------------------------------------------------------------------------------
/push/libs/pushsdk_v2.3.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/libs/pushsdk_v2.3.4.jar
--------------------------------------------------------------------------------
/push/libs/HwPush_SDK_V2705.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/libs/HwPush_SDK_V2705.jar
--------------------------------------------------------------------------------
/aar/push-internal-3.1.160901.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/aar/push-internal-3.1.160901.aar
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AndroidPush
3 |
4 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/push/libs/com.coloros.mcssdk.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/libs/com.coloros.mcssdk.jar
--------------------------------------------------------------------------------
/push/libs/MiPush_SDK_Client_3_1_2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/libs/MiPush_SDK_Client_3_1_2.jar
--------------------------------------------------------------------------------
/push/src/main/res/drawable-hdpi/send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-hdpi/send.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-hdpi/start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-hdpi/start.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-hdpi/upload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-hdpi/upload.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-hdpi/pushnotify.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-hdpi/pushnotify.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ic_cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ic_cancel.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_list_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_list_icon.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_main_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_main_icon.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_progress.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_progress.9.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_no_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_no_collection.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ab_bottom_emui.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ab_bottom_emui.9.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_background_emui.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_background_emui.9.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_btn_check_on_emui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_btn_check_on_emui.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ic_cancel_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ic_cancel_light.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_back.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_delete.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_pic_ab_number.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_pic_ab_number.9.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_btn_check_off_emui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_btn_check_off_emui.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_advance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_advance.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_collect.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_multiple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_multiple.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_refresh.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_multiple1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_ic_toolbar_multiple1.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_list_activated_emui.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_list_activated_emui.9.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_pic_ab_number_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_pic_ab_number_light.9.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_btn_check_off_pressed_emui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_btn_check_off_pressed_emui.png
--------------------------------------------------------------------------------
/push/src/main/res/drawable-xhdpi/hwpush_btn_check_on_pressed_emui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiang111/AndroidPush/HEAD/push/src/main/res/drawable-xhdpi/hwpush_btn_check_on_pressed_emui.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 | gradlew
11 | gradlew.bat
12 |
--------------------------------------------------------------------------------
/push/src/main/java/com/jiang/android/push/utils/Target.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.push.utils;
2 |
3 | /**
4 | * Created by jiang on 2016/10/8.
5 | */
6 |
7 | public enum Target {
8 | MIUI, EMUI, FLYME, VIVO, OPPO, JPUSH
9 | }
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Jun 26 18:23:11 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
7 |
--------------------------------------------------------------------------------
/push/src/main/res/values/hwpush_styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
--------------------------------------------------------------------------------
/push/src/main/java/com/jiang/android/push/utils/L.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.push.utils;
2 |
3 | import android.util.Log;
4 |
5 | import com.jiang.android.push.BuildConfig;
6 |
7 | /**
8 | * Created by jiang on 2016/10/11.
9 | */
10 |
11 | public class L {
12 | private static final String TAG = "AndroidPush";
13 |
14 | public static final boolean debug = BuildConfig.DEBUG;
15 |
16 | public static void i(String msg) {
17 | //if (debug) {
18 | Log.i(TAG, msg);
19 | //}
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jiang/android/pushdemo/App.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.pushdemo;
2 |
3 | import android.app.Application;
4 |
5 | import com.jiang.android.push.Const;
6 |
7 | /**
8 | * Created by jiang on 2016/10/8.
9 | */
10 |
11 | public class App extends Application {
12 |
13 | @Override
14 | public void onCreate() {
15 | super.onCreate();
16 | Const.setMiUI_APP("2882303761517516835", "5911751629835");
17 | Const.setFlyme_APP("110029", "9efb4973a717495bbae156ee5b66978b");
18 |
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/push/src/main/java/com/jiang/android/push/utils/JHandler.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.push.utils;
2 |
3 | import android.os.Looper;
4 |
5 | /**
6 | * Created by jiang on 2016/10/10.
7 | */
8 |
9 | public class JHandler {
10 | private static android.os.Handler mHandler = null;
11 |
12 | public static android.os.Handler handler() {
13 | if (mHandler == null) {
14 | synchronized (JHandler.class) {
15 | mHandler = new android.os.Handler(Looper.getMainLooper());
16 | }
17 | }
18 | return mHandler;
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/push/src/main/res/layout/hwpush_icons_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/push/src/main/res/layout/hwpush_buttons_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/push/src/main/java/com/jiang/android/push/IPushManager.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.push;
2 |
3 | import android.content.Context;
4 |
5 | import com.jiang.android.push.model.TokenModel;
6 |
7 | public interface IPushManager {
8 | void register(Context context, boolean debug, final PushInterface pushInterface);
9 |
10 | void unregister(Context context);
11 |
12 | void setPushInterface(PushInterface pushInterface);
13 |
14 | void setAlias(final Context context, String alias);
15 |
16 | TokenModel getToken(Context context);
17 |
18 | void pause(Context context);
19 |
20 | void resume(Context context);
21 | }
--------------------------------------------------------------------------------
/push/src/main/java/com/jiang/android/push/model/TokenModel.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.push.model;
2 |
3 | import com.jiang.android.push.utils.Target;
4 |
5 | /**
6 | * Created by jiang on 2016/10/8.
7 | */
8 |
9 | public class TokenModel {
10 | private String mToken;
11 | private Target mTarget;
12 |
13 | public String getToken() {
14 | return mToken;
15 | }
16 |
17 | public void setToken(String mToken) {
18 | this.mToken = mToken;
19 | }
20 |
21 | public Target getTarget() {
22 | return mTarget;
23 | }
24 |
25 | public void setTarget(Target mTarget) {
26 | this.mTarget = mTarget;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/push/src/main/res/layout/hwpush_layout8.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
17 |
18 |
--------------------------------------------------------------------------------
/push/src/main/res/values/hwpush_colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ffffffff
4 | #ff000000
5 | #FF000000
6 | #80000000
7 | #65000000
8 | #2c9195
9 | #00bcd5
10 | #000000
11 |
12 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jiang/androidsdk/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/push/src/main/res/values/jpush_style.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
--------------------------------------------------------------------------------
/push/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 | android.useDeprecatedNdk=true。
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jiang/android/pushdemo/LauncherActivity.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.pushdemo;
2 |
3 | import android.net.Uri;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.util.Log;
7 |
8 | public class LauncherActivity extends AppCompatActivity {
9 |
10 | private static final String TAG = "LauncherActivity";
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_launcher);
16 |
17 | String scheml = getIntent().getScheme();
18 | if (scheml.equals("custom")) {
19 | Uri uri = getIntent().getData();
20 | Log.i(TAG, "onCreate: " + uri.getQueryParameter("aaa"));
21 | } else {
22 | String aa = getIntent().getExtras().getString("aaa");
23 | Log.i(TAG, "onCreate: " + aa);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/push/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | PushDemo
5 | Settings
6 | Hello world!
7 |
8 |
9 | 姓名:
10 | 年龄:
11 | 位置信息上报周期(min):
12 | 设置标签
13 | 删除标签
14 | 位置上报
15 | 设置周期(秒)
16 | 开启位置定时上报
17 | 关闭位置定时上报
18 |
19 |
20 | 标签1:
21 | 标签2:
22 | 请输入标签名(空则不设置)
23 | 请输入标签值
24 | 请输入待删标签名
25 |
26 | 获取标签
27 |
28 |
--------------------------------------------------------------------------------
/push/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 | group = 'com.github.jiang111'
4 | android {
5 | compileSdkVersion 28
6 |
7 | defaultConfig {
8 | minSdkVersion 15
9 | targetSdkVersion 28
10 | versionCode 5
11 | versionName "1.1.2"
12 | ndk {
13 | abiFilters 'armeabi', 'armeabi-v7a', 'armeabi-v8a'
14 |
15 | }
16 | manifestPlaceholders = [
17 | JPUSH_PKGNAME: "library",
18 | JPUSH_APPKEY : "library",
19 | JPUSH_CHANNEL: "developer",
20 | PNAME : "library"
21 | ]
22 |
23 | }
24 |
25 | }
26 |
27 | dependencies {
28 | /**
29 | * flyme
30 | */
31 | implementation 'com.android.support:support-v4:28.0.0'
32 | implementation 'com.android.volley:volley:1.1.0'
33 | implementation 'com.squareup.okhttp:okhttp:2.1.0'
34 | implementation 'com.meizu.flyme.internet:push-internal-publish:3.3.+@aar'
35 | /**
36 | * jpush
37 | */
38 | implementation fileTree(include: ['*.jar'], dir: 'libs')
39 | implementation 'cn.jiguang:jpush:2.1.8'
40 | implementation files('libs/pushsdk_v2.3.4.jar')
41 | implementation files('libs/com.coloros.mcssdk.jar')
42 | }
43 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | applicationId "com.jiang.android.pushdemo"
7 | minSdkVersion 18
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "1.0"
11 | ndk {
12 | abiFilters 'armeabi', 'armeabi-v7a', 'armeabi-v8a','x86'
13 |
14 | }
15 | manifestPlaceholders = [
16 | JPUSH_PKGNAME : applicationId,
17 | JPUSH_APPKEY : "3df7e06ec9bf5e79abdc4a6a",
18 | JPUSH_CHANNEL : "develop",
19 | PNAME : applicationId
20 | ]
21 |
22 |
23 | }
24 | buildTypes {
25 | release {
26 |
27 | //混淆
28 | minifyEnabled true
29 | //优化zipAlign
30 | zipAlignEnabled true
31 | //移除无用的resource
32 | shrinkResources true
33 |
34 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35 | }
36 | }
37 |
38 |
39 | }
40 |
41 | dependencies {
42 | implementation fileTree(include: ['*.jar'], dir: 'libs')
43 | implementation 'com.android.support:appcompat-v7:28.0.0'
44 | implementation 'com.github.jiang111:RvAdapter:1.0'
45 | implementation project(':push')
46 | }
47 |
--------------------------------------------------------------------------------
/push/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jiang/androidsdk/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | -keep public class * extends android.content.BroadcastReceiver
20 | -keep class com.xiaomi.mipush.sdk.DemoMessageReceiver {*;}
21 | #可以防止一个误报的 warning 导致无法成功编译,如果编译使用的 Android 版本是 23。
22 | -dontwarn com.xiaomi.push.**
23 | # library
24 | -keep class com.jiang.android.push.**{*;}
25 |
26 |
27 | # huawei
28 | -keep class com.huawei.**{*;}
29 | -keep class com.hianalytics.android.**{*;}
30 | -keep class com.baidu.mapapi.**{*;}
31 | -dontwarn com.huawei.**
32 |
33 | # jpush
34 | -dontoptimize
35 | -dontpreverify
36 |
37 | -dontwarn cn.jpush.**
38 | -keep class cn.jpush.** { *; }
39 | #==================gson && protobuf==========================
40 | -dontwarn com.google.**
41 | -keep class com.google.gson.** {*;}
42 | -keep class com.google.protobuf.** {*;}
43 |
--------------------------------------------------------------------------------
/push/src/main/res/values-zh-rCN/hwpush_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | "推送服务"
4 | "后退"
5 | "前进"
6 | "刷新"
7 | "收藏"
8 | "删除通知"
9 | "通知收藏"
10 | 通知收藏
11 |
12 | "删除"
13 | "全选"
14 |
15 | "点击收藏后,将在桌面自动生成一个“通知收藏”的图标,以后可从桌面直接点击查看。"
16 | "知道了"
17 |
18 | "取消"
19 |
20 |
21 | - "是否删除所选通知?"
22 |
23 | "取消全选"
24 | "没有通知收藏"
25 | "富媒体"
26 | "正在加载,请稍候..."
27 | "收藏已达上限"
28 | "已收藏 1000 条通知信息,需要删除部分通知才能继续收藏,是否继续?"
29 | "继续"
30 | 存储消息
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jiang/android/pushdemo/PushService.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.pushdemo;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 |
6 | import com.jiang.android.push.Message;
7 | import com.jiang.android.push.PushInterface;
8 |
9 | /**
10 | * Created by jiang on 2016/10/9.
11 | */
12 |
13 | public class PushService implements PushInterface {
14 |
15 | private static final String TAG = "PushServiceforMyOwn";
16 |
17 | @Override
18 | public void onRegister(Context context, String registerID) {
19 | Log.i(TAG, "onRegister: " + " id: " + registerID);
20 |
21 | }
22 |
23 | @Override
24 | public void onUnRegister(Context context) {
25 | Log.i(TAG, "onUnRegister: ");
26 |
27 | }
28 |
29 | @Override
30 | public void onPaused(Context context) {
31 | Log.i(TAG, "onPaused: ");
32 |
33 | }
34 |
35 | @Override
36 | public void onResume(Context context) {
37 | Log.i(TAG, "onResume: ");
38 |
39 | }
40 |
41 | @Override
42 | public void onMessage(Context context, Message message) {
43 | Log.i(TAG, "onMessage: " + message.toString());
44 |
45 | }
46 |
47 | @Override
48 | public void onMessageClicked(Context context, Message message) {
49 | Log.i(TAG, "onMessageClicked: " + message.toString());
50 |
51 | }
52 |
53 | @Override
54 | public void onCustomMessage(Context context, Message message) {
55 | Log.i(TAG, "onCustomMessage: " + message.toString());
56 |
57 | }
58 |
59 | @Override
60 | public void onAlias(Context context, String alias) {
61 | Log.i(TAG, "onAlias: " + alias);
62 |
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/push/src/main/java/com/jiang/android/push/PushInterface.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.push;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * warning:
7 | * 在flyme的推送中,不会回调onMessage()和onMessageClicked()方法
8 | * 在华为推送中,不会回调onMessage(),onMessageClicked()和onAlias()方法
9 | * 如上两个方法不会回调是因为设计的时候,通知栏的点击事件由后台负责控制,手机端值负责处理透传消息
10 | *
11 | * oppo中不需要自己处理,所以用不到PushInterface
12 | *
13 | * Created by jiang on 2016/10/8.
14 | */
15 |
16 | public interface PushInterface {
17 |
18 | /**
19 | * 注册成功之后回调
20 | *
21 | * @param context
22 | * @param registerID
23 | */
24 | void onRegister(Context context, String registerID);
25 |
26 | /**
27 | * 取消注册成功
28 | *
29 | * @param context
30 | */
31 | void onUnRegister(Context context);
32 |
33 | /**
34 | * 暂停推送
35 | *
36 | * @param context
37 | */
38 | void onPaused(Context context);
39 |
40 | /**
41 | * 开启推送
42 | *
43 | * @param context
44 | */
45 | void onResume(Context context);
46 |
47 | /**
48 | * 通知下来之后
49 | *
50 | * @param context
51 | * @param message
52 | */
53 | void onMessage(Context context, Message message);
54 |
55 | /**
56 | * 通知栏被点击之后
57 | *
58 | * @param context
59 | * @param message
60 | */
61 | void onMessageClicked(Context context, Message message);
62 |
63 | /**
64 | * 透传消息
65 | *
66 | * @param context
67 | * @param message
68 | */
69 | void onCustomMessage(Context context, Message message);
70 |
71 |
72 | /**
73 | * 别名设置成功的回调
74 | *
75 | * @param context
76 | * @param alias
77 | */
78 | void onAlias(Context context, String alias);
79 | }
80 |
--------------------------------------------------------------------------------
/push/src/main/java/com/jiang/android/push/Message.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.push;
2 |
3 | import com.jiang.android.push.utils.Target;
4 |
5 | /**
6 | * 将消息整合成Message model
7 | * Created by jiang on 2016/10/8.
8 | */
9 |
10 | public final class Message {
11 | private int notifyID; //这个字段用于通知的消息类型,在透传中都是默认0
12 | private String messageID;
13 | private String title;
14 | private String message;
15 | private String extra;
16 | private Target target;
17 |
18 | public int getNotifyID() {
19 | return notifyID;
20 | }
21 |
22 | public void setNotifyID(int notifyID) {
23 | this.notifyID = notifyID;
24 | }
25 |
26 | public String getMessageID() {
27 | return messageID;
28 | }
29 |
30 | public void setMessageID(String messageID) {
31 | this.messageID = messageID;
32 | }
33 |
34 | public Target getTarget() {
35 | return target;
36 | }
37 |
38 | public void setTarget(Target target) {
39 | this.target = target;
40 | }
41 |
42 | public String getTitle() {
43 | return title;
44 | }
45 |
46 | public void setTitle(String title) {
47 | this.title = title;
48 | }
49 |
50 | public String getMessage() {
51 | return message;
52 | }
53 |
54 | public void setMessage(String message) {
55 | this.message = message;
56 | }
57 |
58 | public String getExtra() {
59 | return extra;
60 | }
61 |
62 | public void setExtra(String extra) {
63 | this.extra = extra;
64 | }
65 |
66 | @Override
67 | public String toString() {
68 | return "Message{" +
69 | "notifyID=" + notifyID +
70 | ", messageID='" + messageID + '\'' +
71 | ", title='" + title + '\'' +
72 | ", message='" + message + '\'' +
73 | ", extra='" + extra + '\'' +
74 | ", target=" + target +
75 | '}';
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/push/src/main/java/com/jiang/android/push/utils/BuildProperties.java:
--------------------------------------------------------------------------------
1 | package com.jiang.android.push.utils;
2 |
3 | import android.os.Environment;
4 |
5 | import java.io.File;
6 | import java.io.FileInputStream;
7 | import java.io.IOException;
8 | import java.util.Collection;
9 | import java.util.Enumeration;
10 | import java.util.Map.Entry;
11 | import java.util.Properties;
12 | import java.util.Set;
13 |
14 | /**
15 | * Created by jiang on 2016/10/8.
16 | */
17 |
18 | public class BuildProperties {
19 |
20 | private final Properties properties;
21 |
22 | private BuildProperties() throws IOException {
23 | properties = new Properties();
24 | properties.load(new FileInputStream(new File(Environment.getRootDirectory(), "build.prop")));
25 | }
26 |
27 | public boolean containsKey(final Object key) {
28 | return properties.containsKey(key);
29 | }
30 |
31 | public boolean containsValue(final Object value) {
32 | return properties.containsValue(value);
33 | }
34 |
35 | public Set> entrySet() {
36 | return properties.entrySet();
37 | }
38 |
39 | public String getProperty(final String name) {
40 | return properties.getProperty(name);
41 | }
42 |
43 | public String getProperty(final String name, final String defaultValue) {
44 | return properties.getProperty(name, defaultValue);
45 | }
46 |
47 | public boolean isEmpty() {
48 | return properties.isEmpty();
49 | }
50 |
51 | public Enumeration