huyuguo преди 4 години
родител
ревизия
5c679057b2
променени са 21 файла, в които са добавени 381 реда и са изтрити 564 реда
  1. BIN
      app/libs/jcore-android-2.3.4.jar
  2. BIN
      app/libs/jcore-android-2.5.5.jar
  3. BIN
      app/libs/jpush-android-3.6.0.jar
  4. BIN
      app/libs/jpush-android-3.8.6.jar
  5. 125 79
      app/src/main/AndroidManifest.xml
  6. 3 3
      app/src/main/java/com/electric/chargingpile/activity/AdinShowActivity.java
  7. 3 3
      app/src/main/java/com/electric/chargingpile/activity/H5Activity.java
  8. 2 3
      app/src/main/java/com/electric/chargingpile/activity/LoginActivity.java
  9. 1 236
      app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java
  10. 3 4
      app/src/main/java/com/electric/chargingpile/activity/MyWebViewActivity.java
  11. 3 0
      app/src/main/java/com/electric/chargingpile/activity/PrivacyAgreementActivity.java
  12. 4 19
      app/src/main/java/com/electric/chargingpile/activity/RegisterActivity.java
  13. 1 0
      app/src/main/java/com/electric/chargingpile/activity/UserCenterActivity.java
  14. 3 3
      app/src/main/java/com/electric/chargingpile/activity/UserCenterMoreActivity.java
  15. 17 32
      app/src/main/java/com/electric/chargingpile/application/MainApplication.java
  16. 206 0
      app/src/main/java/com/electric/chargingpile/jpush/PushMessageReceiver.java
  17. 9 0
      app/src/main/java/com/electric/chargingpile/manager/ProfileManager.java
  18. 0 181
      app/src/main/java/com/electric/chargingpile/view/MyReceiver.java
  19. BIN
      app/src/main/jniLibs/armeabi-v7a/libjcore234.so
  20. BIN
      app/src/main/jniLibs/armeabi/libjcore234.so
  21. 1 1
      app/src/main/res/layout/activity_car_owner_certificate.xml

BIN
app/libs/jcore-android-2.3.4.jar


BIN
app/libs/jcore-android-2.5.5.jar


BIN
app/libs/jpush-android-3.6.0.jar


BIN
app/libs/jpush-android-3.8.6.jar


+ 125 - 79
app/src/main/AndroidManifest.xml

@ -11,14 +11,17 @@
11 11
 If your app targets Android 9 or lower, you can declare
12 12
         ACCESS_COARSE_LOCATION instead.
13 13
    -->
14
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 往SDCard写入数据权限 -->
14
15 15
    <permission
16 16
        android:name="${applicationId}.permission.JPUSH_MESSAGE"
17 17
        android:protectionLevel="signature" />
18 18
19
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 往SDCard写入数据权限 -->
20
19 21
    <uses-feature android:name="android.hardware.camera" />
20 22
    <uses-feature android:name="android.hardware.camera.autofocus" />
21 23
24
    <uses-permission android:name="${applicationId}.permission.JPUSH_MESSAGE" />
22 25
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
23 26
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
24 27
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
@ -44,7 +47,6 @@
44 47
    <uses-permission android:name="android.permission.VIBRATE" />
45 48
    <uses-permission android:name="android.permission.INTERNET" />
46 49
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
47
    <uses-permission android:name="${applicationId}.permission.JPUSH_MESSAGE" />
48 50
    <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
49 51
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
50 52
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 极光 -->
@ -547,22 +549,6 @@
547 549
     App Indexing.  See https://g.co/AppIndexing/AndroidStudio for more information.
548 550
        -->
549 551
        <activity
550
            android:name="cn.jpush.android.ui.PopWinActivity"
551
            android:exported="false"
552
            android:theme="@style/MyDialogStyle" />
553
        <activity
554
            android:name="cn.jpush.android.ui.PushActivity"
555
            android:configChanges="orientation|keyboardHidden"
556
            android:exported="false"
557
            android:theme="@android:style/Theme.NoTitleBar">
558
            <intent-filter>
559
                <action android:name="cn.jpush.android.ui.PushActivity" />
560
561
                <category android:name="android.intent.category.DEFAULT" />
562
                <category android:name="${applicationId}" />
563
            </intent-filter>
564
        </activity>
565
        <activity
566 552
            android:name=".activity.ShowBuildLocationActivity"
567 553
            android:screenOrientation="portrait" />
568 554
        <activity
@ -820,6 +806,118 @@
820 806
            android:launchMode="singleTask"
821 807
            android:screenOrientation="portrait" />
822 808
809
        <!-- Rich push 核心功能 since 2.0.6-->
810
        <activity
811
            android:name="cn.jpush.android.ui.PopWinActivity"
812
            android:theme="@style/MyDialogStyle"
813
            android:exported="false">
814
        </activity>
815
816
        <!-- Required SDK核心功能-->
817
        <activity
818
            android:name="cn.jpush.android.ui.PushActivity"
819
            android:configChanges="orientation|keyboardHidden"
820
            android:theme="@android:style/Theme.NoTitleBar"
821
            android:exported="false">
822
            <intent-filter>
823
                <action android:name="cn.jpush.android.ui.PushActivity" />
824
                <category android:name="android.intent.category.DEFAULT" />
825
                <category android:name="${applicationId}" />
826
            </intent-filter>
827
        </activity>
828
829
        <!-- Required SDK 核心功能-->
830
        <!-- 可配置android:process参数将PushService放在其他进程中 -->
831
        <service
832
            android:name="cn.jpush.android.service.PushService"
833
            android:process=":pushcore">
834
            <intent-filter>
835
                <action android:name="cn.jpush.android.intent.REGISTER" />
836
                <action android:name="cn.jpush.android.intent.REPORT" />
837
                <action android:name="cn.jpush.android.intent.PushService" />
838
                <action android:name="cn.jpush.android.intent.PUSH_TIME" />
839
            </intent-filter>
840
        </service>
841
842
        <!-- since 3.0.9 Required SDK 核心功能-->
843
        <provider
844
            android:authorities="${applicationId}.DataProvider"
845
            android:name="cn.jpush.android.service.DataProvider"
846
            android:process=":pushcore"
847
            android:exported="false"
848
            />
849
850
        <!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
851
        <!-- 若不启用该功能可删除该组件,或把 enabled 设置成 false ;App 不会被其他 App 拉起,但会拉起其他的 App。 -->
852
        <service
853
            android:name="cn.jpush.android.service.DaemonService"
854
            android:enabled="true"
855
            android:exported="true">
856
            <intent-filter>
857
                <action android:name="cn.jpush.android.intent.DaemonService" />
858
                <category android:name="${applicationId}" />
859
            </intent-filter>
860
        </service>
861
862
        <!-- 可选,如果使用静态Activity方式拉起,该组件必须声明 -->
863
        <activity android:name="cn.jpush.android.service.DActivity"
864
            android:enabled="true"
865
            android:exported="true"
866
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
867
            android:taskAffinity="jpush.custom">
868
            <intent-filter>
869
                <action android:name="cn.jpush.android.intent.DActivity"/>
870
                <category android:name="${applicationId}" />
871
            </intent-filter>
872
        </activity>
873
874
        <!--since 3.3.0 Required SDK核心功能-->
875
        <activity
876
            android:name="cn.jpush.android.service.JNotifyActivity"
877
            android:exported="false"
878
            android:taskAffinity="jpush.custom"
879
            android:theme="@android:style/Theme.Translucent.NoTitleBar">
880
            <intent-filter>
881
                <action android:name="cn.jpush.android.intent.JNotifyActivity" />
882
                <category android:name="${applicationId}" />
883
            </intent-filter>
884
        </activity>
885
886
        <!-- since 3.1.0 Required SDK 核心功能-->
887
        <provider
888
            android:authorities="${applicationId}.DownloadProvider"
889
            android:name="cn.jpush.android.service.DownloadProvider"
890
            android:exported="true"
891
            />
892
893
        <!-- Required SDK核心功能-->
894
        <receiver
895
            android:name="cn.jpush.android.service.PushReceiver"
896
            android:enabled="true">
897
            <intent-filter android:priority="1000">
898
                <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" />   <!--Required  显示通知栏 -->
899
                <category android:name="${applicationId}" />
900
            </intent-filter>
901
            <intent-filter>
902
                <action android:name="android.intent.action.USER_PRESENT" />
903
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
904
            </intent-filter>
905
            <!-- Optional -->
906
            <intent-filter>
907
                <action android:name="android.intent.action.PACKAGE_ADDED" />
908
                <action android:name="android.intent.action.PACKAGE_REMOVED" />
909
910
                <data android:scheme="package" />
911
            </intent-filter>
912
        </receiver>
913
914
        <!-- Required SDK核心功能-->
915
        <receiver android:name="cn.jpush.android.service.AlarmReceiver" android:exported="false"/>
916
917
        <!-- 3.5.0新增,用于定时展示功能 -->
918
        <receiver android:name="cn.jpush.android.service.SchedulerReceiver" android:exported="false"/>
919
920
823 921
        <meta-data
824 922
            android:name="com.amap.api.v2.apikey"
825 923
            android:value="fabcfbf869745789b151d0c88e9b4807" />
@ -858,72 +956,20 @@
858 956
                android:resource="@xml/provider_paths" />
859 957
        </provider>
860 958
861
        <receiver
862
            android:name="cn.jpush.android.service.PushReceiver"
863
            android:enabled="true"
864
            android:exported="false">
865
            <intent-filter android:priority="1000">
866
                <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" /> <!-- Required  显示通知栏 -->
867
                <category android:name="${applicationId}" />
868
            </intent-filter>
869
            <intent-filter>
870
                <action android:name="android.intent.action.USER_PRESENT" />
871
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
872
            </intent-filter>
873
            <!-- Optional -->
874
            <intent-filter>
875
                <action android:name="android.intent.action.PACKAGE_ADDED" />
876
                <action android:name="android.intent.action.PACKAGE_REMOVED" />
877
878
                <data android:scheme="package" />
879
            </intent-filter>
880
        </receiver>
881
        <receiver
882
            android:name="cn.jpush.android.service.AlarmReceiver"
883
            android:exported="false" />
884
        <receiver
885
            android:name=".view.MyReceiver"
886
            android:enabled="true"
887
            android:exported="false">
888
            <intent-filter>
889
                <action android:name="cn.jpush.android.intent.REGISTRATION" /> <!-- Required  用户注册SDK的intent -->
890
                <action android:name="cn.jpush.android.intent.UNREGISTRATION" />
891
                <action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" /> <!-- Required  用户接收SDK消息的intent -->
892
                <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" /> <!-- Required  用户接收SDK通知栏信息的intent -->
893
                <action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" /> <!-- Required  用户打开自定义通知栏的intent -->
894
                <action android:name="cn.jpush.android.intent.ACTION_RICHPUSH_CALLBACK" /> <!-- Optional 用户接受Rich Push Javascript 回调函数的intent -->
895
                <action android:name="cn.jpush.android.intent.CONNECTION" /> <!-- 接收网络变化 连接/断开 since 1.6.3 -->
896
                <category android:name="${applicationId}" />
897
            </intent-filter>
898
        </receiver>
899
900 959
        <service android:name="com.amap.api.location.APSService" />
901 960
        <service android:name="com.amap.api.location.APSService" />
902
        <service
903
            android:name="cn.jpush.android.service.DownloadService"
904
            android:enabled="true"
905
            android:exported="false" />
906
        <service
907
            android:name="cn.jpush.android.service.PushService"
908
            android:enabled="true"
909
            android:exported="false">
961
962
        <!-- User defined.  For test only  用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调-->
963
        <!--since 3.3.0 接收JPush相关事件-->
964
        <receiver android:name="com.electric.chargingpile.jpush.PushMessageReceiver">
910 965
            <intent-filter>
911
                <action android:name="cn.jpush.android.intent.REGISTER" />
912
                <action android:name="cn.jpush.android.intent.REPORT" />
913
                <action android:name="cn.jpush.android.intent.PushService" />
914
                <action android:name="cn.jpush.android.intent.PUSH_TIME" />
966
                <action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
967
                <category android:name="${applicationId}"></category>
915 968
            </intent-filter>
916
        </service>
917
        <service
918
            android:name="cn.jpush.android.service.DaemonService"
919
            android:enabled="true"
920
            android:exported="true">
921
            <intent-filter>
922
                <action android:name="cn.jpush.android.intent.DaemonService" />
969
        </receiver>
970
        <!-- since 3.5.6 新增华硕通道  -->
971
        <receiver android:name="cn.jpush.android.asus.AsusPushMessageReceiver"></receiver>
923 972
924
                <category android:name="${applicationId}" />
925
            </intent-filter>
926
        </service>
927 973
    </application>
928 974
929 975
</manifest>

+ 3 - 3
app/src/main/java/com/electric/chargingpile/activity/AdinShowActivity.java

@ -643,10 +643,10 @@ public class AdinShowActivity extends Activity implements View.OnClickListener {
643 643
        long appTime1 = System.currentTimeMillis() / 1000;
644 644
        long updatetime = appTime1 - MainMapActivity.cha - 3;
645 645
        String token = DES3.encode(String.valueOf(updatetime));
646
        final String replace = URLEncoder.encode(token);
646
        final String replace = URLEncoder.encode(token, "UTF-8");
647 647
        String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/login?phone="
648
                + user_name + "&password=" + URLEncoder.encode(password) + "&token=" + replace
649
                + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.push_id;
648
                + user_name + "&password=" + URLEncoder.encode(password, "UTF-8") + "&token=" + replace
649
                + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.getInstance().getPushID();
650 650
        StringCallback stringCallback = new StringCallback() {
651 651
            @Override
652 652
            public void onError(Call call, Exception e) {

+ 3 - 3
app/src/main/java/com/electric/chargingpile/activity/H5Activity.java

@ -580,10 +580,10 @@ public class H5Activity extends Activity implements View.OnClickListener, Platfo
580 580
        long appTime1 = System.currentTimeMillis() / 1000;
581 581
        long updatetime = appTime1 - MainMapActivity.cha - 3;
582 582
        String token = DES3.encode(String.valueOf(updatetime));
583
        final String replace = URLEncoder.encode(token);
583
        final String replace = URLEncoder.encode(token, "UTF-8");
584 584
        String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/login?phone="
585
                + user_name + "&password=" + URLEncoder.encode(password) + "&token=" + replace
586
                + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.push_id;
585
                + user_name + "&password=" + URLEncoder.encode(password, "UTF-8") + "&token=" + replace
586
                + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.getInstance().getPushID();
587 587
        StringCallback stringCallback = new StringCallback() {
588 588
            @Override
589 589
            public void onError(Call call, Exception e) {

+ 2 - 3
app/src/main/java/com/electric/chargingpile/activity/LoginActivity.java

@ -413,12 +413,11 @@ public class LoginActivity extends Activity implements View.OnClickListener {
413 413
            long appTime1 = System.currentTimeMillis() / 1000;
414 414
            long updatetime = appTime1 - MainMapActivity.cha - 3;
415 415
            String token = String.valueOf(updatetime);
416
            final String replace = URLEncoder.encode(DES3.encode(token));
416
            final String replace = URLEncoder.encode(DES3.encode(token), "UTF-8");
417 417
            String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/login?phone="
418 418
                    + phone.getText().toString() + "&password=" + URLEncoder.encode(password.getText().toString())
419 419
                    + "&token=" + replace
420
                    + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.push_id;
421
            LogUtils.e(MainApplication.push_id);
420
                    + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.getInstance().getPushID();
422 421
            OkHttpUtils.get().url(url).build().execute(new StringCallback() {
423 422
                @Override
424 423
                public void onError(Call call, Exception e) {

+ 1 - 236
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

@ -748,195 +748,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
748 748
        registerReceiver(networkChangeReceiver, intentFilter);
749 749
750 750
        EventBusUtil.register(this);
751
        if (!MainApplication.h5_url.equals("") && MainApplication.type.equals("PushWeb")) {
752
            Intent intent = new Intent(getApplicationContext(), MyWebViewActivity.class);
753
            intent.putExtra("url", MainApplication.h5_url);
754
            startActivity(intent);
755
            MainApplication.h5_url = "";
756
            MainApplication.type = "";
757
        }
758
        if (!MainApplication.h5_url.equals("") && MainApplication.type.equals("PushComment")) {
759
            startActivity(new Intent(getApplication(), MyMessageActivity.class));
760
            MainApplication.h5_url = "";
761
            MainApplication.type = "";
762
            MainApplication.mainSkip = "1";
763
            finish();
764
        }
765
        if (MainApplication.type.equals("PushBalance")) {
766
            if (MainApplication.isLogin()) {
767
                startActivity(new Intent(getApplication(), MyBalanceActivity.class));
768
                MainApplication.h5_url = "";
769
                MainApplication.type = "";
770
                MainApplication.mainSkip = "1";
771
                finish();
772
            }
773
774
        }
775
        if (MainApplication.type.equals("PushRanking")) {
776
            if (MainApplication.isLogin()) {
777
                startActivity(new Intent(getApplication(), RankingListActivity.class));
778
                MainApplication.h5_url = "";
779
                MainApplication.type = "";
780
                MainApplication.mainSkip = "1";
781
                finish();
782
            }
783
784
        }
785
        if (MainApplication.type.equals("PushRecharge")) {
786
            if (MainApplication.isLogin()) {
787
                startActivity(new Intent(getApplication(), AccountRechargeActivity.class));
788
                MainApplication.h5_url = "";
789
                MainApplication.type = "";
790
                MainApplication.mainSkip = "1";
791
                finish();
792
            }
793
        }
794
        if (MainApplication.type.equals("PushInvite")) {
795
            if (MainApplication.isLogin()) {
796
                Intent intent4 = new Intent(getApplication(), MyWebViewActivity.class);
797
                intent4.putExtra("url", "https://evcharge.cc/cdz/yqm.html?code=" + UserCenterActivity.getShareNo(Integer.parseInt(MainApplication.userId)) + "&phone=" + MainApplication.userPhone);
798
//                intent4.putExtra("tag", "2");
799
                startActivity(intent4);
800
                MainApplication.h5_url = "";
801
                MainApplication.type = "";
802
                MainApplication.mainSkip = "1";
803
                finish();
804
            }
805
        }
806
        if (MainApplication.type.equals("first") || MainApplication.type.equals("second") || MainApplication.type.equals("three")) {
807
            if (MainApplication.isLogin()) {
808
                long appTime4 = System.currentTimeMillis() / 1000;
809
                long updatetime4 = appTime4 - MainMapActivity.cha - 1;
810
                String token4 = String.valueOf(updatetime4);
811
                Intent intent4 = new Intent(getApplication(), MyWebViewActivity.class);
812
                String web1 = null;
813
                try {
814
                    web1 = MainApplication.url + "/zhannew/basic/web/index.php/discount/redlist?userid=" + MainApplication.userId + "&token=" + URLEncoder.encode(DES3.encode(token4));
815
                } catch (Exception e) {
816
                    e.printStackTrace();
817
                }
818
                intent4.putExtra("url", web1);
819
//                intent4.putExtra("tag", "4");
820
                startActivity(intent4);
821
                MainApplication.h5_url = "";
822
                MainApplication.type = "";
823
                MainApplication.mainSkip = "1";
824
                finish();
825
            }
826
        }
827
828
        if (MainApplication.type.equals("PushCommodity")) {
829
            long appTime11 = System.currentTimeMillis() / 1000;
830
//            Log.e("sfv_url===", getIntent().getStringExtra("shareUrl"));
831
//            Log.i("appTime(long)---", appTime11 + "");
832
            long updatetime1 = appTime11 - MainMapActivity.cha - 5;
833
//            Log.i("updatetime(long)---", updatetime1 + "");
834
//            Log.i("cha---", MainMapActivity.cha + "");
835
            String token1 = String.valueOf(updatetime1);
836
            String encode_token = null;
837
            try {
838
                encode_token = DES3.encode(token1);
839
            } catch (Exception e) {
840
                e.printStackTrace();
841
            }
842
            String replace = URLEncoder.encode(encode_token);
843
//                    startActivity(new Intent(getApplication(), ShopActivity.class));
844
            Intent intent11 = new Intent();
845
            intent11.setClass(getApplicationContext(), CreditActivity.class);
846
            intent11.putExtra("navColor", "#fcfcfc");    //配置导航条的背景颜色,请用#ffffff长格式。
847
            intent11.putExtra("titleColor", "#222222");    //配置导航条标题的颜色,请用#ffffff长格式。
848
            MainApplication.goods_type = "details";
849
//            MainApplication.current_url = getIntent().getStringExtra("shareUrl");
850
//                MainApplication.current_url = "http://www.duiba.com.cn/mobile/appItemDetail?appItemId=453087";
851
            if (!MainApplication.isLogin()) {
852
                intent11.putExtra("url", "http://cdz.evcharge.cc/zhannew/basic/web/index.php/duiba/active?token=" + replace + "&url=" + MainApplication.h5_url);    //配置自动登陆地址,每次需服务端动态生成。
853
            } else {
854
                intent11.putExtra("url", "http://cdz.evcharge.cc/zhannew/basic/web/index.php/duiba/active?user_id=" + MainApplication.userId + "&token=" + replace + "&url=" + MainApplication.h5_url);    //配置自动登陆地址,每次需服务端动态生成。
855
            }
856
            startActivity(intent11);
857
            MainApplication.ad_link = "";
858
859
            overridePendingTransition(0, 0);
860
861
            CreditActivity.creditsListener = new CreditActivity.CreditsListener() {
862
                /**
863
                 * 当点击分享按钮被点击
864
                 * @param shareUrl 分享的地址
865
                 * @param shareThumbnail 分享的缩略图
866
                 * @param shareTitle 分享的标题
867
                 * @param shareSubtitle 分享的副标题
868
                 */
869
                public void onShareClick(WebView webView, String shareUrl, String shareThumbnail, String shareTitle, String shareSubtitle) {
870
                    //当分享按钮被点击时,会调用此处代码。在这里处理分享的业务逻辑。
871
//                            new AlertDialog.Builder(webView.getContext())
872
//                                    .setTitle("分享信息")
873
//                                    .setItems(new String[] {"标题:"+shareTitle,"副标题:"+shareSubtitle,"缩略图地址:"+shareThumbnail,"链接:"+shareUrl}, null)
874
//                                    .setNegativeButton("确定", null)
875
//                                    .show();
876
877
                    ChargingShareBean chargingShareBean = new ChargingShareBean();
878
                    chargingShareBean.setIcon(shareThumbnail);
879
                    chargingShareBean.setTitle(shareTitle);
880
                    chargingShareBean.setUrl(shareUrl);
881
                    chargingShareBean.setText("");
882
                    showSimpleBottomSheetGrid(chargingShareBean);
883
                }
884
885
                /**
886
                 * 当点击“请先登录”按钮唤起登录时,会调用此处代码。
887
                 * 用户登录后,需要将CreditsActivity.IS_WAKEUP_LOGIN变量设置为true。
888
                 * @param webView 用于登录成功后返回到当前的webview刷新登录状态。
889
                 * @param currentUrl 当前页面的url
890
                 */
891
                public void onLoginClick(WebView webView, final String currentUrl) {
892
                    //当未登录的用户点击去登录时,会调用此处代码。
893
                    //用户登录后,需要将CreditsActivity.IS_WAKEUP_LOGIN变量设置为true。
894
                    //为了用户登录后能回到未登录前的页面(currentUrl)。
895
                    //当用户登录成功后,需要重新请求一次服务端,带上currentUrl。
896
                    //用该方法中的webview变量加载请求链接。
897
                    //服务端收到请求后在生成免登录url时,将currentUrl放入redirect参数,通知客户端302跳转到新生成的免登录URL。
898
                    new android.app.AlertDialog.Builder(webView.getContext())
899
                            .setTitle("跳转登录")
900
                            .setMessage("跳转到登录页面?")
901
                            .setPositiveButton("是", new DialogInterface.OnClickListener() {
902
                                @Override
903
                                public void onClick(DialogInterface dialog, int which) {
904
//                                        MainApplication.current_url = currentUrl;
905
                                    MainApplication.h5_url = currentUrl;
906
                                    context.startActivity(new Intent(getApplicationContext(), LoginActivity.class));
907
908
                                }
909
                            })
910
                            .setNegativeButton("否", null)
911
                            .show();
912
                }
913
914
                /**
915
                 * 当点击“复制”按钮时,触发该方法,回调获取到券码code
916
                 * @param webView webview对象。
917
                 * @param code 复制的券码
918
                 */
919
                public void onCopyCode(WebView webView, String code) {
920
                    //当未登录的用户点击去登录时,会调用此处代码。
921
                    new android.app.AlertDialog.Builder(webView.getContext())
922
                            .setTitle("复制券码")
923
                            .setMessage("已复制,券码为:" + code)
924
                            .setPositiveButton("是", null)
925
                            .setNegativeButton("否", null)
926
                            .show();
927
                }
928
929
                /**
930
                 * 积分商城返回首页刷新积分时,触发该方法。
931
                 */
932
                public void onLocalRefresh(WebView mWebView, String credits) {
933
                    //String credits为积分商城返回的最新积分,不保证准确。
934
                    //触发更新本地积分,这里建议用ajax向自己服务器请求积分值,比较准确。
935
//                    Toast.makeText(getApplicationContext(), "触发本地刷新积分:" + credits, Toast.LENGTH_SHORT).show();
936
                }
937
            };
938
        }
939
940 751
941 752
        if (MainApplication.ad_link.equals("1")) {
942 753
            againPoint = "1";
@ -1287,52 +1098,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1287 1098
            }
1288 1099
        });
1289 1100
1290
        // add by hyg 点击跳转到聊聊 隐藏该功能
1291
//        windowChat.setOnClickListener(new View.OnClickListener() {
1292
//            @Override
1293
//            public void onClick(View view) {
1294
//                if (socket != null) {
1295
//                    try {
1296
//                        socket.close();
1297
//                    } catch (IOException e) {
1298
//                        e.printStackTrace();
1299
//                    }
1300
//                }
1301
//                MobclickAgent.onEvent(getApplicationContext(), "1121");
1302
//                Intent i = new Intent(getApplication(), ChatActivity.class);//聊聊页面
1303
//                i.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
1304
//                startActivity(i);
1305
//                overridePendingTransition(0, 0);
1306
//                if (count == 1) {
1307
//
1308
//                    count = 2;
1309
//                }
1310
//                MobclickAgent.onEvent(getApplicationContext(), "0999");
1311
//                windowLayout.setVisibility(View.GONE);
1312
//
1313
//
1314
//                rl_control.setVisibility(View.VISIBLE);
1315
//                if (nMarker != null) {
1316
//                    nMarker.hideInfoWindow();
1317
//                    MarkerOptions markerOptionss = new MarkerOptions();
1318
//                    if (current_chargePoint.getOwn_pay().equals("1")) {
1319
//                        nMarker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.icon_newmarker1));
1320
//                    } else {
1321
//                        if (current_chargePoint.getSuit_car().equals("特斯拉")) {
1322
//                            nMarker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.icon_newmarker3));
1323
//                        } else {
1324
//                            if (WelcomeActivity.canCost.contains(current_chargePoint.getSupplier())) {
1325
//                                nMarker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.icon_newmarker2));
1326
//                            } else {
1327
//                                nMarker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.icon_newmarker3));
1328
//                            }
1329
//                        }
1330
//                    }
1331
//                }
1332
//
1333
//            }
1334
//        });
1335
1336 1101
1337 1102
        tv_sortDistance = (TextView) findViewById(R.id.tv_sortDistance);
1338 1103
        tv_sortDistance.setOnClickListener(this);
@ -1773,7 +1538,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1773 1538
                    String url = "{\"fun\":\"dingwei\",\"poi_jing\":" + "\"" + String.format("%.6f", bd_lon) +
1774 1539
                            "\"" + ",\"poi_wei\":" + "\"" + String.format("%.6f", bd_lat) + "\"" + ",\"imei\":"
1775 1540
                            + "\"" + "android_" + Util.getUdid() + "\"" + ",\"timer\":" + "\"" + Token
1776
                            + "\"" + ",\"registration_id\":" + "\"" + MainApplication.push_id + "\""
1541
                            + "\"" + ",\"registration_id\":" + "\"" + MainApplication.getInstance().getPushID() + "\""
1777 1542
                            + ",\"userid\":" + "\"" + uid + "\"" + "}";
1778 1543
                    eteLocation(url);
1779 1544
                }

+ 3 - 4
app/src/main/java/com/electric/chargingpile/activity/MyWebViewActivity.java

@ -727,10 +727,10 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
727 727
        long appTime1 = System.currentTimeMillis() / 1000;
728 728
        long updatetime = appTime1 - MainMapActivity.cha - 3;
729 729
        String token = DES3.encode(String.valueOf(updatetime));
730
        final String replace = URLEncoder.encode(token);
730
        final String replace = URLEncoder.encode(token, "UTF-8");
731 731
        String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/login?phone="
732
                + user_name + "&password=" + URLEncoder.encode(password) + "&token=" + replace
733
                + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.push_id;
732
                + user_name + "&password=" + URLEncoder.encode(password, "UTF-8") + "&token=" + replace
733
                + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.getInstance().getPushID();
734 734
        StringCallback stringCallback = new StringCallback() {
735 735
            @Override
736 736
            public void onError(Call call, Exception e) {
@ -741,7 +741,6 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
741 741
                        webView.evaluateJavascript("window.myglobal.reuserlogin('" + "no" + "')", new ValueCallback<String>() {
742 742
                            @Override
743 743
                            public void onReceiveValue(String arg0) {
744
745 744
                            }
746 745
                        });
747 746
                    }

+ 3 - 0
app/src/main/java/com/electric/chargingpile/activity/PrivacyAgreementActivity.java

@ -21,9 +21,12 @@ import android.widget.TextView;
21 21
import android.widget.Toast;
22 22
23 23
import com.electric.chargingpile.R;
24
import com.electric.chargingpile.application.MainApplication;
24 25
import com.electric.chargingpile.manager.ProfileManager;
25 26
import com.electric.chargingpile.util.BarColorUtil;
26 27
28
import cn.jpush.android.api.JPushInterface;
29
27 30
public class PrivacyAgreementActivity extends Activity {
28 31
29 32
    private TextView agree_enter_text_view;

+ 4 - 19
app/src/main/java/com/electric/chargingpile/activity/RegisterActivity.java

@ -444,21 +444,6 @@ public class RegisterActivity extends Activity implements OnClickListener {
444 444
        }).start();
445 445
    }
446 446

447
//	private void getTpye() {
448
//		if (!NetUtil.CheckNetwork(this)) {
449
//			Toast.makeText(this, "请检查网络", Toast.LENGTH_SHORT).show();
450
//			return;
451
//		}
452
//
453
//		new Thread(new Runnable() {
454
//			@Override
455
//			public void run() {
456
//				String url="http://www.d1ev.com/public/getSaleCar";
457
//				getType(url);
458
//			}
459
//		}).start();
460
//	}
461

462 447
    private void resetsubmit() {
463 448
        if (!NetUtil.CheckNetwork(this)) {
464 449
            Toast.makeText(this, "请检查网络", Toast.LENGTH_SHORT).show();
@ -467,7 +452,7 @@ public class RegisterActivity extends Activity implements OnClickListener {
467 452
        if (hasCameraPermission()) {
468 453
            String imei = Util.getUdid();
469 454

470
            final String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/add?phone=" + etPhone.getText().toString().trim() + "&sms=" + etCode.getText().toString().trim() + "&password=" + password.getText().toString().trim() + "&yqm=" + et_input_shareno.getText().toString() + "&imei=" + "android_" + imei + "&registration_id=" + MainApplication.push_id;
455
            final String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/add?phone=" + etPhone.getText().toString().trim() + "&sms=" + etCode.getText().toString().trim() + "&password=" + password.getText().toString().trim() + "&yqm=" + et_input_shareno.getText().toString() + "&imei=" + "android_" + imei + "&registration_id=" + MainApplication.getInstance().getPushID();
471 456
            new Thread(new Runnable() {
472 457
                @Override
473 458
                public void run() {
@ -607,10 +592,10 @@ public class RegisterActivity extends Activity implements OnClickListener {
607 592
            long appTime1 = System.currentTimeMillis() / 1000;
608 593
            long updatetime = appTime1 - MainMapActivity.cha - 3;
609 594
            String token = String.valueOf(updatetime);
610
            final String replace = URLEncoder.encode(DES3.encode(token));
595
            final String replace = URLEncoder.encode(DES3.encode(token), "UTF-8");
611 596
            String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/login?phone="
612
                    + etPhone.getText().toString() + "&password=" + URLEncoder.encode(password.getText().toString()) + "&token=" + replace
613
                    + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.push_id;
597
                    + etPhone.getText().toString() + "&password=" + URLEncoder.encode(password.getText().toString(), "UTF-8") + "&token=" + replace
598
                    + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.getInstance().getPushID();
614 599
            OkHttpUtils.get().url(url).build().execute(new StringCallback() {
615 600
                @Override
616 601
                public void onError(Call call, Exception e) {

+ 1 - 0
app/src/main/java/com/electric/chargingpile/activity/UserCenterActivity.java

@ -88,6 +88,7 @@ import java.net.URL;
88 88
import java.net.URLEncoder;
89 89
import java.util.List;
90 90
91
import cn.jpush.android.api.JPushInterface;
91 92
import okhttp3.Call;
92 93
import pub.devrel.easypermissions.AfterPermissionGranted;
93 94
import pub.devrel.easypermissions.AppSettingsDialog;

+ 3 - 3
app/src/main/java/com/electric/chargingpile/activity/UserCenterMoreActivity.java

@ -448,10 +448,10 @@ public class UserCenterMoreActivity extends Activity implements View.OnClickList
448 448
        Log.i("cha---", MainMapActivity.cha + "");
449 449
        String token = String.valueOf(updatetime);
450 450
        String encode_token = DES3.encode(token);
451
        String replace = URLEncoder.encode(encode_token);
451
        String replace = URLEncoder.encode(encode_token, "UTF-8");
452 452
        String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/logout?phone="
453
                + MainApplication.userPhone + "&password=" + URLEncoder.encode(MainApplication.userPassword) + "&token=" + replace
454
                + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.push_id;
453
                + MainApplication.userPhone + "&password=" + URLEncoder.encode(MainApplication.userPassword, "UTF-8") + "&token=" + replace
454
                + "&imei=" + "android_" + MainApplication.imei + "&registration_id=" + MainApplication.getInstance().getPushID();
455 455
        Log.i("token解密:", DES3.decode(encode_token));
456 456
        OkHttpUtils.get()
457 457
                .url(url)

+ 17 - 32
app/src/main/java/com/electric/chargingpile/application/MainApplication.java

@ -9,8 +9,10 @@ import android.os.Build;
9 9
import android.os.Bundle;
10 10
import android.os.Environment;
11 11
import android.os.StrictMode;
12

12 13
import androidx.multidex.MultiDexApplication;
13 14

15
import android.text.TextUtils;
14 16
import android.util.Log;
15 17

16 18
import com.amap.api.maps.model.LatLng;
@ -21,6 +23,7 @@ import com.electric.chargingpile.data.AdDetail;
21 23
import com.electric.chargingpile.data.Zhan;
22 24
import com.electric.chargingpile.gen.DaoMaster;
23 25
import com.electric.chargingpile.gen.DaoSession;
26
import com.electric.chargingpile.manager.PreferenceManager;
24 27
import com.electric.chargingpile.manager.ProfileManager;
25 28
import com.electric.chargingpile.util.SharedPreferencesHelper;
26 29
import com.mob.MobSDK;
@ -79,7 +82,7 @@ public class MainApplication extends MultiDexApplication {
79 82
//    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
80 83
//    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
81 84

82
//    public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
85
    //    public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
83 86
    public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
84 87

85 88

@ -94,7 +97,7 @@ public class MainApplication extends MultiDexApplication {
94 97
    public static String suitcar = "";
95 98
    public static Boolean gestureguide;
96 99
    public static String h5_url = "";
97
    public static String push_id = "";
100
    private String pushID = "";
98 101
    public static String imei = "";
99 102
    public static String current_url = "";
100 103
    public static String goods_type = "";
@ -156,22 +159,6 @@ public class MainApplication extends MultiDexApplication {
156 159
        JPushInterface.setDebugMode(true);
157 160
        JPushInterface.init(this);
158 161

159

160
        String rid = JPushInterface.getRegistrationID(getApplicationContext());
161
        push_id = rid;
162
        Intent intent = new Intent();
163
        if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
164
            Bundle bundle = intent.getExtras();
165
            String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);
166
            try {
167
                JSONObject jsonObject = new JSONObject(extras);
168
                String url = jsonObject.getString("extra");
169
                Log.e("extra==", url);
170
            } catch (JSONException e) {
171
                e.printStackTrace();
172
            }
173
        }
174

175 162
        CrashReport.initCrashReport(getApplicationContext(), "900010422", BuildConfig.DEBUG);
176 163
        initImageLoader(getApplicationContext());
177 164

@ -181,7 +168,6 @@ public class MainApplication extends MultiDexApplication {
181 168
        } catch (IOException e) {
182 169
            e.printStackTrace();
183 170
        }
184
//		SDKInitializer.initialize(getApplicationContext());
185 171

186 172
        mScreenWidth = getResources().getDisplayMetrics().widthPixels;
187 173
        mScreenHeight = getResources().getDisplayMetrics().heightPixels;
@ -201,7 +187,6 @@ public class MainApplication extends MultiDexApplication {
201 187
        msgOne = ProfileManager.getInstance().getMsgOne(getApplicationContext());
202 188
        msgTime = ProfileManager.getInstance().getSystemMsgTime(getApplicationContext());
203 189
        firstOpenTime = ProfileManager.getInstance().getFirstOpenTime(getApplicationContext());
204
//		msgTwo = ProfileManager.getInstance().getMsgTwo(getApplicationContext());
205 190

206 191
        loginRemind();
207 192
        setFestival();
@ -234,23 +219,11 @@ public class MainApplication extends MultiDexApplication {
234 219
                .imageScaleType(ImageScaleType.IN_SAMPLE_INT).resetViewBeforeLoading(false).bitmapConfig(Bitmap.Config.RGB_565).build();
235 220
    }
236 221

237
//	public void showTextToast(String msg) {
238
//		if (toast == null) {
239
//			toast = Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT);
240
//		} else {
241
//			toast.setText(msg);
242
//		}
243
//		toast.show();
244
//	}
245

246

247 222
    public static boolean isLogin() {
248 223
        if ("".equals(userPhone)) {
249 224
            return false;
250 225
        }
251

252 226
        return true;
253

254 227
    }
255 228

256 229
    private void loginRemind() {
@ -296,6 +269,18 @@ public class MainApplication extends MultiDexApplication {
296 269
        return db;
297 270
    }
298 271

272
    public String getPushID() {
273
        if (TextUtils.isEmpty(pushID)) {
274
            return ProfileManager.getInstance().getPushID(getApplicationContext());
275
        } else {
276
            return pushID;
277
        }
278
    }
279

280
    public void setPushID(String pushID) {
281
        this.pushID = pushID;
282
        ProfileManager.getInstance().setPushID(getApplicationContext(), pushID);
283
    }
299 284
}
300 285

301 286


+ 206 - 0
app/src/main/java/com/electric/chargingpile/jpush/PushMessageReceiver.java

@ -0,0 +1,206 @@
1
package com.electric.chargingpile.jpush;
2
3
import android.app.Activity;
4
import android.content.Context;
5
import android.content.DialogInterface;
6
import android.content.Intent;
7
import android.os.Bundle;
8
import android.text.TextUtils;
9
import android.util.Log;
10
import android.webkit.WebView;
11
12
import com.alibaba.fastjson.JSON;
13
import com.electric.chargingpile.activity.AccountRechargeActivity;
14
import com.electric.chargingpile.activity.CarOwnerCertificateListActivity;
15
import com.electric.chargingpile.activity.CreditActivity;
16
import com.electric.chargingpile.activity.LoginActivity;
17
import com.electric.chargingpile.activity.MainMapActivity;
18
import com.electric.chargingpile.activity.MyBalanceActivity;
19
import com.electric.chargingpile.activity.MyMessageActivity;
20
import com.electric.chargingpile.activity.MyWebViewActivity;
21
import com.electric.chargingpile.activity.RankingListActivity;
22
import com.electric.chargingpile.activity.UserCenterActivity;
23
import com.electric.chargingpile.application.MainApplication;
24
import com.electric.chargingpile.data.ChargingShareBean;
25
import com.electric.chargingpile.util.DES3;
26
import com.google.gson.Gson;
27
import com.google.gson.JsonObject;
28
import com.umeng.analytics.MobclickAgent;
29
30
import org.json.JSONException;
31
import org.json.JSONObject;
32
33
import java.net.URLEncoder;
34
35
import cn.jpush.android.api.CmdMessage;
36
import cn.jpush.android.api.CustomMessage;
37
import cn.jpush.android.api.JPushInterface;
38
import cn.jpush.android.api.JPushMessage;
39
import cn.jpush.android.api.NotificationMessage;
40
import cn.jpush.android.service.JPushMessageReceiver;
41
42
public class PushMessageReceiver extends JPushMessageReceiver {
43
    private static final String TAG = "PushMessageReceiver";
44
45
    @Override
46
    public void onMessage(Context context, CustomMessage customMessage) {
47
        Log.e(TAG, "[onMessage] " + customMessage);
48
        processCustomMessage(context, customMessage);
49
    }
50
51
    @Override
52
    public void onNotifyMessageOpened(Context context, NotificationMessage message) {
53
        Log.e(TAG, "[onNotifyMessageOpened] " + message);
54
        try {
55
            String extras = message.notificationExtras;
56
            JSONObject jsonObject = new JSONObject(extras);
57
58
            String type = jsonObject.getString("type");
59
            String url = jsonObject.getString("customUrl");
60
            if (!TextUtils.isEmpty(type)) {
61
                handleNotifyMessage(context, type, url);
62
            }
63
        } catch (Throwable throwable) {
64
            throwable.printStackTrace();
65
        }
66
    }
67
68
    @Override
69
    public void onMultiActionClicked(Context context, Intent intent) {
70
        Log.e(TAG, "[onMultiActionClicked] 用户点击了通知栏按钮");
71
        String nActionExtra = intent.getExtras().getString(JPushInterface.EXTRA_NOTIFICATION_ACTION_EXTRA);
72
73
        //开发者根据不同 Action 携带的 extra 字段来分配不同的动作。
74
        if (nActionExtra == null) {
75
            Log.d(TAG, "ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null");
76
            return;
77
        }
78
        if (nActionExtra.equals("my_extra1")) {
79
            Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮一");
80
        } else if (nActionExtra.equals("my_extra2")) {
81
            Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮二");
82
        } else if (nActionExtra.equals("my_extra3")) {
83
            Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮三");
84
        } else {
85
            Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮未定义");
86
        }
87
    }
88
89
    @Override
90
    public void onNotifyMessageArrived(Context context, NotificationMessage message) {
91
        Log.e(TAG, "[onNotifyMessageArrived] " + message);
92
    }
93
94
    @Override
95
    public void onNotifyMessageDismiss(Context context, NotificationMessage message) {
96
        Log.e(TAG, "[onNotifyMessageDismiss] " + message);
97
    }
98
99
    @Override
100
    public void onRegister(Context context, String registrationId) {
101
        Log.e(TAG, "[onRegister] " + registrationId);
102
        MainApplication.getInstance().setPushID(registrationId);
103
    }
104
105
    @Override
106
    public void onConnected(Context context, boolean isConnected) {
107
        Log.e(TAG, "[onConnected] " + isConnected);
108
    }
109
110
    @Override
111
    public void onCommandResult(Context context, CmdMessage cmdMessage) {
112
        Log.e(TAG, "[onCommandResult] " + cmdMessage);
113
    }
114
115
    @Override
116
    public void onTagOperatorResult(Context context, JPushMessage jPushMessage) {
117
        super.onTagOperatorResult(context, jPushMessage);
118
    }
119
120
    @Override
121
    public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage) {
122
        super.onCheckTagOperatorResult(context, jPushMessage);
123
    }
124
125
    @Override
126
    public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) {
127
        super.onAliasOperatorResult(context, jPushMessage);
128
    }
129
130
    @Override
131
    public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) {
132
        super.onMobileNumberOperatorResult(context, jPushMessage);
133
    }
134
135
    //send msg to MainActivity
136
    private void processCustomMessage(Context context, CustomMessage customMessage) {
137
    }
138
139
    @Override
140
    public void onNotificationSettingsCheck(Context context, boolean isOn, int source) {
141
        super.onNotificationSettingsCheck(context, isOn, source);
142
        Log.e(TAG, "[onNotificationSettingsCheck] isOn:" + isOn + ",source:" + source);
143
    }
144
145
    private void handleNotifyMessage(Context context, String type, String url) {
146
        Intent intent = null;
147
        if ("PushRedBag".equals(type) && MainApplication.isLogin()) {
148
            long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
149
            try {
150
                String token = DES3.encode(String.valueOf(tokenTime));
151
                token = URLEncoder.encode(token, "UTF-8");
152
                intent = new Intent(context, MyWebViewActivity.class);
153
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
154
                String webURL = MainApplication.url + "/zhannew/basic/web/index.php/discount/redlist?userid=" + MainApplication.userId + "&token=" + token;
155
                intent.putExtra("url", webURL);
156
                context.startActivity(intent);
157
                MobclickAgent.onEvent(context, "0808");
158
            } catch (Exception e) {
159
                e.printStackTrace();
160
            }
161
        } else if ("PushWeb".equals(type) && !TextUtils.isEmpty(url)) {
162
            intent = new Intent(context, MyWebViewActivity.class);
163
            intent.putExtra("url", url);
164
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
165
            context.startActivity(intent);
166
        } else if ("PushComment".equals(type)) {
167
            intent = new Intent(context, MyMessageActivity.class);
168
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
169
            context.startActivity(intent);
170
        } else if ("PushBalance".equals(type) && MainApplication.isLogin()) {
171
            intent = new Intent(context, MyBalanceActivity.class);
172
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
173
            context.startActivity(intent);
174
        } else if ("PushRanking".equals(type) && MainApplication.isLogin()) {
175
            intent = new Intent(context, RankingListActivity.class);
176
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
177
            context.startActivity(intent);
178
        } else if ("PushRecharge".equals(type) && MainApplication.isLogin()) {
179
            intent = new Intent(context, AccountRechargeActivity.class);
180
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
181
            context.startActivity(intent);
182
        } else if ("PushInvite".equals(type) && MainApplication.isLogin()) {
183
            intent = new Intent(context, MyWebViewActivity.class);
184
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
185
            intent.putExtra("url", "https://evcharge.cc/cdz/yqm.html?code=" + UserCenterActivity.getShareNo(Integer.parseInt(MainApplication.userId)) + "&phone=" + MainApplication.userPhone);
186
            context.startActivity(intent);
187
        } else if (("first".equals(type) || "second".equals(type) || "three".equals(type)) && MainApplication.isLogin()) {
188
            long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
189
            try {
190
                String token = DES3.encode(String.valueOf(tokenTime));
191
                token = URLEncoder.encode(token, "UTF-8");
192
                intent = new Intent(context, MyWebViewActivity.class);
193
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
194
                String webURL = MainApplication.url + "/zhannew/basic/web/index.php/discount/redlist?userid=" + MainApplication.userId + "&token=" + token;
195
                intent.putExtra("url", webURL);
196
                context.startActivity(intent);
197
            } catch (Exception e) {
198
                e.printStackTrace();
199
            }
200
        } else {
201
            intent = new Intent(context, MainMapActivity.class);
202
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
203
            context.startActivity(intent);
204
        }
205
    }
206
}

+ 9 - 0
app/src/main/java/com/electric/chargingpile/manager/ProfileManager.java

@ -69,6 +69,7 @@ public class ProfileManager {
69 69
    private static final String KEY_CLICKED_USER_PUBLISH_ROLE = "key_clicked_user_publish_role";
70 70
    private static final String KEY_MAKE_SURE_NETWORK_FOR_VIDEO = "key_make_sure_network_for_video";
71 71
    private static final String KEY_DEVICE_ID = "key_device_id";
72
    private static final String KEY_PUSH_ID = "key_push_id";
72 73

73 74
    private static ProfileManager instance;
74 75
    private String deviceId;
@ -643,4 +644,12 @@ public class ProfileManager {
643 644
    public void setMsgChargingStatusNo(Context context, int id) {
644 645
        PreferenceManager.getInstance(context).putInt(KEY_MESSAGE_STATUS_CHARGING_NO, id);
645 646
    }
647

648
    public void setPushID(Context context, String pushID) {
649
        PreferenceManager.getInstance(context).putString(KEY_PUSH_ID, pushID);
650
    }
651

652
    public String getPushID(Context context) {
653
        return PreferenceManager.getInstance(context).getString(KEY_PUSH_ID, "");
654
    }
646 655
}

+ 0 - 181
app/src/main/java/com/electric/chargingpile/view/MyReceiver.java

@ -1,181 +0,0 @@
1
package com.electric.chargingpile.view;
2
3
import android.content.BroadcastReceiver;
4
import android.content.Context;
5
import android.content.Intent;
6
import android.os.Bundle;
7
import android.util.Log;
8
9
import com.electric.chargingpile.activity.MainActicity;
10
import com.electric.chargingpile.activity.MainMapActivity;
11
import com.electric.chargingpile.activity.MyWebViewActivity;
12
import com.electric.chargingpile.activity.WelcomeActivity;
13
import com.electric.chargingpile.application.MainApplication;
14
import com.electric.chargingpile.util.DES3;
15
import com.electric.chargingpile.util.ExampleUtil;
16
import com.umeng.analytics.MobclickAgent;
17
18
import org.json.JSONException;
19
import org.json.JSONObject;
20
21
import java.net.URLEncoder;
22
import java.util.Iterator;
23
24
import cn.jpush.android.api.JPushInterface;
25
26
/**
27
 * 自定义接收器
28
 * <p>
29
 * 如果不定义这个 Receiver,则:
30
 * 1) 默认用户会打开主界面
31
 * 2) 接收不到自定义消息
32
 */
33
public class MyReceiver extends BroadcastReceiver {
34
    private static final String TAG = "JPush";
35
36
    @Override
37
    public void onReceive(Context context, Intent intent) {
38
        Bundle bundle = intent.getExtras();
39
        Log.d(TAG, "[MyReceiver] onReceive - " + intent.getAction() + ", extras: " + printBundle(bundle));
40
41
        if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
42
            String regId = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID);
43
            Log.d(TAG, "[MyReceiver] 接收Registration Id : " + regId);
44
            //send the Registration Id to your server...
45
46
        } else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
47
            Log.d(TAG, "[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE));
48
            processCustomMessage(context, bundle);
49
50
        } else if (JPushInterface.ACTION_NOTIFICATION_RECEIVED.equals(intent.getAction())) {
51
            Log.d(TAG, "[MyReceiver] 接收到推送下来的通知");
52
            int notifactionId = bundle.getInt(JPushInterface.EXTRA_NOTIFICATION_ID);
53
            JPushInterface.reportNotificationOpened(context, bundle.getString(JPushInterface.EXTRA_MSG_ID));
54
            Log.d(TAG, "[MyReceiver] 接收到推送下来的通知的ID: " + notifactionId);
55
            String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);//获取附加字段,是一个json数组
56
            Log.e("extra:", extras);
57
58
        } else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
59
            Log.d(TAG, "[MyReceiver] 用户点击打开了通知");
60
61
//			openNotification(context,bundle);
62
            String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);//获取附加字段,是一个json数组
63
            Log.e("extra:", extras);
64
65
            JSONObject json = null;
66
            try {
67
                json = new JSONObject(extras);
68
            } catch (JSONException e) {
69
                e.printStackTrace();
70
            }
71
            //进行json.getString("Article")操作时,要保证这里的Article与服务器上的Article一模一样,不然回报空指针异常
72
            String articleUrl = "";//获取附加字段Article,对应的值为articleUrl
73
            String type = "";
74
            try {
75
                articleUrl = json.getString("customUrl");
76
                type = json.getString("type");
77
78
//				if (type.equals("PushWeb")){
79
                MainApplication.h5_url = articleUrl;
80
                MainApplication.type = type;
81
//				}else if (type.equals("PushComment")){
82
//					MainApplication.h5_url = "111";
83
//					MainApplication.type = type;
84
//				}
85
86
87
            } catch (JSONException e) {
88
                e.printStackTrace();
89
            }
90
//			Log.e("articleUrl:", articleUrl);
91
            //打开自定义的Activity
92
            if ("PushRedBag".equals(type)) {
93
                long appTime4 = System.currentTimeMillis() / 1000;
94
                long updatetime4 = appTime4 - MainMapActivity.cha - 1;
95
                String token4 = String.valueOf(updatetime4);
96
                Intent intent4 = new Intent(context, MyWebViewActivity.class);
97
                String web1 = null;
98
                try {
99
                    web1 = MainApplication.url + "/zhannew/basic/web/index.php/discount/redlist?userid=" + MainApplication.userId + "&token=" + URLEncoder.encode(DES3.encode(token4));
100
                } catch (Exception e) {
101
                    e.printStackTrace();
102
                }
103
                intent4.putExtra("url", web1);
104
                context.startActivity(intent4);
105
                MobclickAgent.onEvent(context, "0808");
106
            } else {
107
                Intent i = new Intent(context, WelcomeActivity.class);
108
                i.putExtras(bundle);
109
                i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
110
                context.startActivity(i);
111
            }
112
        } else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(intent.getAction())) {
113
            Log.d(TAG, "[MyReceiver] 用户收到到RICH PUSH CALLBACK: " + bundle.getString(JPushInterface.EXTRA_EXTRA));
114
            //在这里根据 JPushInterface.EXTRA_EXTRA 的内容处理代码,比如打开新的Activity, 打开一个网页等..
115
116
        } else if (JPushInterface.ACTION_CONNECTION_CHANGE.equals(intent.getAction())) {
117
            boolean connected = intent.getBooleanExtra(JPushInterface.EXTRA_CONNECTION_CHANGE, false);
118
            Log.w(TAG, "[MyReceiver]" + intent.getAction() + " connected state change to " + connected);
119
        } else {
120
            Log.d(TAG, "[MyReceiver] Unhandled intent - " + intent.getAction());
121
        }
122
    }
123
124
    // 打印所有的 intent extra 数据
125
    private static String printBundle(Bundle bundle) {
126
        StringBuilder sb = new StringBuilder();
127
        if (bundle != null) {
128
            for (String key : bundle.keySet()) {
129
                if (key.equals(JPushInterface.EXTRA_NOTIFICATION_ID)) {
130
                    sb.append("\nkey:" + key + ", value:" + bundle.getInt(key));
131
                } else if (key.equals(JPushInterface.EXTRA_CONNECTION_CHANGE)) {
132
                    sb.append("\nkey:" + key + ", value:" + bundle.getBoolean(key));
133
                } else if (key.equals(JPushInterface.EXTRA_EXTRA)) {
134
                    if (bundle.getString(JPushInterface.EXTRA_EXTRA).isEmpty()) {
135
                        Log.i(TAG, "This message has no Extra data");
136
                        continue;
137
                    }
138
139
                    try {
140
                        JSONObject json = new JSONObject(bundle.getString(JPushInterface.EXTRA_EXTRA));
141
                        Iterator<String> it = json.keys();
142
143
                        while (it.hasNext()) {
144
                            String myKey = it.next().toString();
145
                            sb.append("\nkey:" + key + ", value: [" +
146
                                    myKey + " - " + json.optString(myKey) + "]");
147
                        }
148
                    } catch (JSONException e) {
149
                        Log.e(TAG, "Get message extra JSON error!");
150
                    }
151
152
                } else {
153
                    sb.append("\nkey:" + key + ", value:" + bundle.getString(key));
154
                }
155
            }
156
        }
157
        return sb.toString();
158
    }
159
160
    //send msg to MainActivity
161
    private void processCustomMessage(Context context, Bundle bundle) {
162
        if (MainActicity.isForeground) {
163
            String message = bundle.getString(JPushInterface.EXTRA_MESSAGE);
164
            String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);
165
            Intent msgIntent = new Intent(MainActicity.MESSAGE_RECEIVED_ACTION);
166
            msgIntent.putExtra(MainActicity.KEY_MESSAGE, message);
167
            if (!ExampleUtil.isEmpty(extras)) {
168
                try {
169
                    JSONObject extraJson = new JSONObject(extras);
170
                    if (null != extraJson && extraJson.length() > 0) {
171
                        msgIntent.putExtra(MainActicity.KEY_EXTRAS, extras);
172
                    }
173
                } catch (JSONException e) {
174
175
                }
176
177
            }
178
            context.sendBroadcast(msgIntent);
179
        }
180
    }
181
}

BIN
app/src/main/jniLibs/armeabi-v7a/libjcore234.so


BIN
app/src/main/jniLibs/armeabi/libjcore234.so


+ 1 - 1
app/src/main/res/layout/activity_car_owner_certificate.xml

@ -354,7 +354,7 @@
354 354
                android:layout_height="wrap_content"
355 355
                android:layout_marginTop="10dp"
356 356
                android:layout_marginBottom="30dp"
357
                android:text="认证说明\n\n1.车型信息和行驶证主页为必填项;\n2.最多可认证三款车型;\n3.默认首款认证车型为主车型;\n4.上传行驶证详细页面,并保证所有信息清晰;\n5.认证成功的首个车型可获得50元充电红包。"
357
                android:text="认证说明\n\n1.车型信息和行驶证主页为必填项;\n2.最多可认证三款车型;\n3.默认首款认证车型为主车型;\n4.上传行驶证详细页面,并保证所有信息清晰;\n5.认证成功的首个车型可获得50元充电优惠券。"
358 358
                android:textColor="#0D1120"
359 359
                android:textSize="14sp"
360 360
                app:layout_constraintBottom_toBottomOf="parent"