├── settings.gradle ├── github ├── logo.png ├── screenshot_01.jpg ├── screenshot_02.jpg └── screenshot_03.jpg ├── app ├── src │ └── main │ │ ├── res │ │ ├── xml │ │ │ ├── filepaths.xml │ │ │ └── network_security_config.xml │ │ ├── drawable │ │ │ ├── into.png │ │ │ ├── logo.png │ │ │ ├── aliyun_qrcode.png │ │ │ ├── side_nav_bar.jpg │ │ │ ├── default_avatar.png │ │ │ ├── info_small_icon.png │ │ │ ├── ic_book_black_24dp.png │ │ │ ├── ic_card_black_24dp.png │ │ │ ├── ic_cet_black_24dp.png │ │ │ ├── ic_home_black_24dp.png │ │ │ ├── ic_lost_black_24dp.png │ │ │ ├── fragment_index_card.png │ │ │ ├── fragment_index_image.jpg │ │ │ ├── gdeiassistant_qrcode.jpg │ │ │ ├── ic_about_black_24dp.png │ │ │ ├── ic_charge_black_24dp.png │ │ │ ├── ic_class_black_24dp.png │ │ │ ├── ic_grade_black_24dp.png │ │ │ ├── ic_refresh_white_24dp.png │ │ │ ├── tencentcloud_qrcode.jpeg │ │ │ ├── checkcode_not_available.png │ │ │ ├── fragment_index_schedule.png │ │ │ ├── ic_evaluate_black_24dp.png │ │ │ ├── ic_credit_card_black_24dp.png │ │ │ ├── ic_exit_to_app_black_24dp.png │ │ │ ├── ic_system_update_black_24dp.png │ │ │ ├── ic_arrow_drop_down_white_24dp.png │ │ │ ├── pressable_white_normal.xml │ │ │ ├── pressable_white_pressed.xml │ │ │ └── pressable_white_background.xml │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── menu │ │ │ ├── options_menu.xml │ │ │ ├── menu_toolbar.xml │ │ │ └── activity_main_drawer.xml │ │ ├── layout │ │ │ ├── item_listview_number.xml │ │ │ ├── item_gridview_date.xml │ │ │ ├── progressdialog.xml │ │ │ ├── activity_guide.xml │ │ │ ├── content_main.xml │ │ │ ├── activity_main.xml │ │ │ ├── app_bar_main.xml │ │ │ ├── activity_webview.xml │ │ │ ├── nav_header_main.xml │ │ │ ├── grade_item.xml │ │ │ ├── todayschedule_item.xml │ │ │ ├── book_item.xml │ │ │ ├── card_item.xml │ │ │ ├── activity_lost.xml │ │ │ ├── activity_evaluate.xml │ │ │ ├── fragment_schedule.xml │ │ │ └── activity_book.xml │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── values-v21 │ │ │ └── styles.xml │ │ ├── java │ │ └── cn │ │ │ └── gdeiassistant │ │ │ ├── Constant │ │ │ ├── CetTagConstant.java │ │ │ ├── IndexTagConstant.java │ │ │ ├── EvaluateTagConstant.java │ │ │ ├── ChangeAvatarOptionConstant.java │ │ │ ├── NotificationIDConstant.java │ │ │ ├── ChargeTagConstant.java │ │ │ ├── PermissionRequestCodeConstant.java │ │ │ ├── MainTagConstant.java │ │ │ ├── ActivityRequestCodeConstant.java │ │ │ ├── MainItemTagConstant.java │ │ │ ├── RequestConstant.java │ │ │ ├── NetWorkTimeoutConstant.java │ │ │ └── ResultConstant.java │ │ │ ├── Exception │ │ │ └── ResponseStatusCodeException.java │ │ │ ├── Pojo │ │ │ ├── Entity │ │ │ │ ├── EncryptedData.java │ │ │ │ ├── Charge.java │ │ │ │ ├── Profile.java │ │ │ │ ├── Token.java │ │ │ │ ├── Cookie.java │ │ │ │ ├── Card.java │ │ │ │ ├── CardInfo.java │ │ │ │ ├── Book.java │ │ │ │ ├── Cet.java │ │ │ │ ├── Access.java │ │ │ │ └── Grade.java │ │ │ ├── Login │ │ │ │ └── UserLoginResult.java │ │ │ ├── Token │ │ │ │ └── TokenRefreshResult.java │ │ │ ├── JsonResult │ │ │ │ ├── DataJsonResult.java │ │ │ │ └── JsonResult.java │ │ │ ├── CardQuery │ │ │ │ └── CardQueryResult.java │ │ │ ├── ScheduleQuery │ │ │ │ └── ScheduleQueryResult.java │ │ │ ├── Upgrade │ │ │ │ └── CheckUpgradeResult.java │ │ │ ├── OssFederationToken │ │ │ │ └── OssFederationTokenResult.java │ │ │ └── GradeQuery │ │ │ │ └── GradeQueryResult.java │ │ │ ├── Tools │ │ │ ├── NetWorkUtils.java │ │ │ ├── OkHttpUtils.java │ │ │ ├── TimeUtils.java │ │ │ ├── StringUtils.java │ │ │ ├── TokenUtils.java │ │ │ └── AESUtils.java │ │ │ ├── Presenter │ │ │ ├── WebViewPresenter.java │ │ │ ├── BookDetailPresenter.java │ │ │ ├── EvaluatePresenter.java │ │ │ ├── LostPresenter.java │ │ │ ├── BookPresenter.java │ │ │ └── SchedulePresenter.java │ │ │ ├── View │ │ │ ├── ListView │ │ │ │ └── ListViewForScrollView.java │ │ │ ├── Dialog │ │ │ │ └── ProgressDialogCreator.java │ │ │ └── Adapter │ │ │ │ ├── ListViewNumberAdapter.java │ │ │ │ ├── GridViewDateAdapter.java │ │ │ │ ├── GradeListViewAdapter.java │ │ │ │ ├── BookListViewAdapter.java │ │ │ │ └── TodayScheduleListViewAdapter.java │ │ │ ├── NetWork │ │ │ ├── EncryptionNetWork.java │ │ │ ├── CheckUpgradeNetWork.java │ │ │ ├── OSSNetWork.java │ │ │ ├── LostNetWork.java │ │ │ ├── EvaluateNetWork.java │ │ │ ├── ProfileNetWork.java │ │ │ ├── AccessNetWork.java │ │ │ ├── TokenNetWork.java │ │ │ ├── ScheduleQueryNetWork.java │ │ │ ├── GradeQueryNetWork.java │ │ │ ├── LoginNetWork.java │ │ │ ├── ChargeNetWork.java │ │ │ ├── CetQueryNetWork.java │ │ │ ├── BookNetWork.java │ │ │ └── CardQueryNetWork.java │ │ │ ├── Activity │ │ │ ├── AboutSoftWareActivity.java │ │ │ ├── WebViewActivity.java │ │ │ ├── GradeDetailActivity.java │ │ │ ├── LostActivity.java │ │ │ └── EvaluateActivity.java │ │ │ └── Model │ │ │ ├── LostModel.java │ │ │ ├── BitmapFileModel.java │ │ │ ├── EvaluateModel.java │ │ │ ├── GuideModel.java │ │ │ ├── GradeQueryModel.java │ │ │ ├── ScheduleQueryModel.java │ │ │ ├── LoginModel.java │ │ │ └── CardQueryModel.java │ │ └── AndroidManifest.xml ├── libs │ └── aliyun-oss-sdk-android-2.4.3.jar ├── build.gradle └── proguard-rules.pro ├── README.md ├── gradlew.bat └── LICENSE.md /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /github/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/github/logo.png -------------------------------------------------------------------------------- /github/screenshot_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/github/screenshot_01.jpg -------------------------------------------------------------------------------- /github/screenshot_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/github/screenshot_02.jpg -------------------------------------------------------------------------------- /github/screenshot_03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/github/screenshot_03.jpg -------------------------------------------------------------------------------- /app/src/main/res/xml/filepaths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/into.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/into.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/logo.png -------------------------------------------------------------------------------- /app/libs/aliyun-oss-sdk-android-2.4.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/libs/aliyun-oss-sdk-android-2.4.3.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/aliyun_qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/aliyun_qrcode.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/side_nav_bar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/side_nav_bar.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/default_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/default_avatar.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/info_small_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/info_small_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_book_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_book_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_card_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_card_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_cet_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_cet_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_home_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_home_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_lost_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_lost_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/fragment_index_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/fragment_index_card.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/fragment_index_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/fragment_index_image.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/gdeiassistant_qrcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/gdeiassistant_qrcode.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_about_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_about_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_charge_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_charge_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_class_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_class_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_grade_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_grade_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_refresh_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_refresh_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/tencentcloud_qrcode.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/tencentcloud_qrcode.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/checkcode_not_available.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/checkcode_not_available.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/fragment_index_schedule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/fragment_index_schedule.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_evaluate_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_evaluate_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_credit_card_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_credit_card_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_exit_to_app_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_exit_to_app_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_system_update_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_system_update_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_drop_down_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdeiAssistant/GdeiAssistant-Android/HEAD/app/src/main/res/drawable/ic_arrow_drop_down_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/CetTagConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class CetTagConstant { 4 | 5 | public static final int CHECK_CODE = 0; 6 | 7 | public static final int CET_QUERY = 1; 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/IndexTagConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class IndexTagConstant { 4 | 5 | public static final int SCHEDULE_QUERY = 0; 6 | 7 | public static final int CARD_QUERY = 1; 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/menu/options_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/EvaluateTagConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class EvaluateTagConstant { 4 | 5 | public static final int NORMAL_SUBMIT = 0; 6 | 7 | public static final int DIRECTLY_SUBMIT = 1; 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/ChangeAvatarOptionConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class ChangeAvatarOptionConstant { 4 | 5 | public static final int GET_PHOTO_FROM_ALBUM = 0; 6 | 7 | public static final int GET_PHOTO_FROM_CAMERA = 1; 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/NotificationIDConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class NotificationIDConstant { 4 | 5 | public static final int PATCH_NOTIFICATION_ID = 2008; 6 | 7 | public static final int UPGRADE_NOTIFICATION_ID = 2018; 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/pressable_white_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/pressable_white_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/ChargeTagConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class ChargeTagConstant { 4 | 5 | //获取校园卡基本信息 6 | public static final int GET_CARD_INFO = 0; 7 | 8 | //提交充值请求 9 | public static final int SUBMIT_CHARGE = 1; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/PermissionRequestCodeConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class PermissionRequestCodeConstant { 4 | 5 | public static final int PERMISSION_ALBUM = 0; 6 | 7 | public static final int PERMISSION_CAMERA = 1; 8 | 9 | public static final int LOAD_AVATAR = 2; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/pressable_white_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_listview_number.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/MainTagConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class MainTagConstant { 4 | 5 | public static final int DOWNLOAD_AVATAR = 0; 6 | 7 | public static final int UPLOAD_AVATAR = 1; 8 | 9 | public static final int GET_USER_PROFILE = 2; 10 | 11 | public static final int GET_USER_ACCESS = 3; 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_gridview_date.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 160dp 7 | 16dp 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Exception/ResponseStatusCodeException.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Exception; 2 | 3 | /** 4 | * 访问API接口时,返回的HTTP状态码不是200时,抛出该异常 5 | */ 6 | public class ResponseStatusCodeException extends Exception { 7 | 8 | public ResponseStatusCodeException() { 9 | 10 | } 11 | 12 | public ResponseStatusCodeException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/ActivityRequestCodeConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class ActivityRequestCodeConstant { 4 | 5 | public static final int RESULT_PHOTO_FROM_ALBUM = 0; 6 | 7 | public static final int RESULT_PHOTO_FROM_CAMERA = 1; 8 | 9 | public static final int RESULT_SAVE_PHOTO_TO_VIEW = 2; 10 | 11 | public static final int BROWSER_UPDATE_REQUEST_CODE = 3; 12 | 13 | public static final int RESULT_BOOK_RENEW = 4; 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 广东二师助手 4 | 5 | Open navigation drawer 6 | Close navigation drawer 7 | 8 | 9 | 7UnEVKNng3XV/eBcsL1/lRIANRfXcoPT 10 | 11 | 12 | https://gdeiassistant.azurewebsites.net/ 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/MainItemTagConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class MainItemTagConstant { 4 | 5 | public static final int TAG_INDEX = 0; 6 | 7 | public static final int TAG_GRADE = 1; 8 | 9 | public static final int TAG_SCHEDULE = 2; 10 | 11 | public static final int TAG_CET = 3; 12 | 13 | public static final int TAG_EVALUATE = 4; 14 | 15 | public static final int TAG_CARD = 5; 16 | 17 | public static final int TAG_CHARGE = 6; 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/RequestConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class RequestConstant { 4 | 5 | public static final int REQUEST_TIMEOUT = 0; 6 | 7 | public static final int REQUEST_SUCCESS = 1; 8 | 9 | public static final int REQUEST_FAILURE = 2; 10 | 11 | public static final int CLIENT_ERROR = 3; 12 | 13 | public static final int SERVER_ERROR = 4; 14 | 15 | public static final int UNKNOWN_ERROR = 5; 16 | 17 | public static final int EMPTY_RESULT = 6; 18 | 19 | public static final int SHOW_PROGRESS = 7; 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/progressdialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_guide.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/Entity/EncryptedData.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.Entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public class EncryptedData { 7 | 8 | private String data; 9 | 10 | private String signature; 11 | 12 | public String getData() { 13 | return data; 14 | } 15 | 16 | public void setData(String data) { 17 | this.data = data; 18 | } 19 | 20 | public String getSignature() { 21 | return signature; 22 | } 23 | 24 | public void setSignature(String signature) { 25 | this.signature = signature; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Tools/NetWorkUtils.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Tools; 2 | 3 | import android.content.Context; 4 | import android.net.ConnectivityManager; 5 | import android.net.NetworkInfo; 6 | 7 | public class NetWorkUtils { 8 | 9 | /** 10 | * 检测现在手机是否使用WIFI 11 | * 12 | * @param context 13 | * @return 14 | */ 15 | public static boolean IsUsingWifi(Context context) { 16 | ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 17 | NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo(); 18 | return activeNetInfo != null && activeNetInfo.getType() == ConnectivityManager.TYPE_WIFI; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Tools/OkHttpUtils.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Tools; 2 | 3 | import android.content.Context; 4 | 5 | import java.util.concurrent.TimeUnit; 6 | 7 | import cn.gdeiassistant.Application.GdeiAssistantApplication; 8 | import okhttp3.OkHttpClient; 9 | 10 | public class OkHttpUtils { 11 | 12 | /** 13 | * 获取OkHttpClient对象 14 | * 15 | * @param timeout 超时时间,单位为秒 16 | * @param context 17 | * @return 18 | */ 19 | public static OkHttpClient GetOkHttpClient(int timeout, Context context) { 20 | return new OkHttpClient.Builder() 21 | .connectTimeout(timeout, TimeUnit.SECONDS).readTimeout(timeout, TimeUnit.SECONDS) 22 | .writeTimeout(timeout, TimeUnit.SECONDS).cookieJar(((GdeiAssistantApplication) context).getCookieJar()) 23 | .build(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Presenter/WebViewPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Presenter; 2 | 3 | import android.content.Intent; 4 | 5 | import cn.gdeiassistant.Activity.WebViewActivity; 6 | 7 | public class WebViewPresenter { 8 | 9 | private WebViewActivity webViewActivity; 10 | 11 | public WebViewPresenter(WebViewActivity webViewActivity) { 12 | this.webViewActivity = webViewActivity; 13 | Init(); 14 | } 15 | 16 | private void Init() { 17 | Intent intent = webViewActivity.getIntent(); 18 | String title = intent.getStringExtra("title"); 19 | String url = intent.getStringExtra("url"); 20 | if (title != null) { 21 | webViewActivity.SetTitleName(title); 22 | } 23 | if (url != null) { 24 | webViewActivity.LoadWeb(url); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/Login/UserLoginResult.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.Login; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.io.Serializable; 6 | 7 | import cn.gdeiassistant.Pojo.Entity.Token; 8 | 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class UserLoginResult implements Serializable { 11 | 12 | private Token accessToken; 13 | 14 | private Token refreshToken; 15 | 16 | public Token getAccessToken() { 17 | return accessToken; 18 | } 19 | 20 | public void setAccessToken(Token accessToken) { 21 | this.accessToken = accessToken; 22 | } 23 | 24 | public Token getRefreshToken() { 25 | return refreshToken; 26 | } 27 | 28 | public void setRefreshToken(Token refreshToken) { 29 | this.refreshToken = refreshToken; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/Token/TokenRefreshResult.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.Token; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.io.Serializable; 6 | 7 | import cn.gdeiassistant.Pojo.Entity.Token; 8 | 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class TokenRefreshResult implements Serializable { 11 | 12 | private Token accessToken; 13 | 14 | private Token refreshToken; 15 | 16 | public Token getAccessToken() { 17 | return accessToken; 18 | } 19 | 20 | public void setAccessToken(Token accessToken) { 21 | this.accessToken = accessToken; 22 | } 23 | 24 | public Token getRefreshToken() { 25 | return refreshToken; 26 | } 27 | 28 | public void setRefreshToken(Token refreshToken) { 29 | this.refreshToken = refreshToken; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/JsonResult/DataJsonResult.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.JsonResult; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public class DataJsonResult extends JsonResult { 7 | 8 | private T data; 9 | 10 | public T getData() { 11 | return data; 12 | } 13 | 14 | public void setData(T data) { 15 | this.data = data; 16 | } 17 | 18 | public DataJsonResult() { 19 | 20 | } 21 | 22 | public DataJsonResult(Boolean success, T data) { 23 | super(success); 24 | this.data = data; 25 | } 26 | 27 | public DataJsonResult(Boolean success, String message) { 28 | super(success, message); 29 | } 30 | 31 | public DataJsonResult(Boolean success, Integer code, String message) { 32 | super(success, code, message); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/CardQuery/CardQueryResult.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.CardQuery; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | import cn.gdeiassistant.Pojo.Entity.Card; 9 | import cn.gdeiassistant.Pojo.Entity.CardInfo; 10 | 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class CardQueryResult implements Serializable { 13 | 14 | private CardInfo cardInfo; 15 | 16 | private List cardList; 17 | 18 | public List getCardList() { 19 | return cardList; 20 | } 21 | 22 | public void setCardList(List cardList) { 23 | this.cardList = cardList; 24 | } 25 | 26 | public CardInfo getCardInfo() { 27 | return cardInfo; 28 | } 29 | 30 | public void setCardInfo(CardInfo cardInfo) { 31 | this.cardInfo = cardInfo; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/Entity/Charge.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.Entity; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class Charge implements Serializable { 11 | 12 | @JSONField(ordinal = 1) 13 | private String alipayURL; 14 | 15 | @JSONField(ordinal = 2) 16 | private List cookieList; 17 | 18 | public List getCookieList() { 19 | return cookieList; 20 | } 21 | 22 | public void setCookieList(List cookieList) { 23 | this.cookieList = cookieList; 24 | } 25 | 26 | public String getAlipayURL() { 27 | return alipayURL; 28 | } 29 | 30 | public void setAlipayURL(String alipayURL) { 31 | this.alipayURL = alipayURL; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/Entity/Profile.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.Entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.io.Serializable; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class Profile implements Serializable { 9 | 10 | private String avatarURL; 11 | 12 | private String username; 13 | 14 | private String nickname; 15 | 16 | public String getNickname() { 17 | return nickname; 18 | } 19 | 20 | public void setNickname(String nickname) { 21 | this.nickname = nickname; 22 | } 23 | 24 | public String getAvatarURL() { 25 | return avatarURL; 26 | } 27 | 28 | public void setAvatarURL(String avatarURL) { 29 | this.avatarURL = avatarURL; 30 | } 31 | 32 | public String getUsername() { 33 | return username; 34 | } 35 | 36 | public void setUsername(String username) { 37 | this.username = username; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/View/ListView/ListViewForScrollView.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.View.ListView; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.ListView; 6 | 7 | public class ListViewForScrollView extends ListView { 8 | 9 | public ListViewForScrollView(Context context) { 10 | super(context); 11 | } 12 | 13 | public ListViewForScrollView(Context context, AttributeSet attrs) { 14 | super(context, attrs); 15 | } 16 | 17 | public ListViewForScrollView(Context context, AttributeSet attrs, int defStyle) { 18 | super(context, attrs, defStyle); 19 | } 20 | 21 | /** 22 | * 重写该方法,达到使ListView适应ScrollView的效果 23 | */ 24 | @Override 25 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 26 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); 27 | super.onMeasure(widthMeasureSpec, expandSpec); 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Constant/NetWorkTimeoutConstant.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Constant; 2 | 3 | public class NetWorkTimeoutConstant { 4 | 5 | public static final int CARD_QUERY_NETWORK_TIMEOUT = 15; 6 | 7 | public static final int CET_QUERY_NETWORK_TIMEOUT = 5; 8 | 9 | public static final int CHARGE_NETWORK_TIMEOUT = 15; 10 | 11 | public static final int CHECK_UPGRADE_NETWORK_TIMEOUT = 3; 12 | 13 | public static final int ENCRYPT_NETWORK_TIMEOUT = 3; 14 | 15 | public static final int EVALUATE_NETWORK_TIMEOUT = 15; 16 | 17 | public static final int BOOK_QUERY_NETWORK_TIMEOUT = 15; 18 | 19 | public static final int GRADE_QUERY_NETWORK_TIMEOUT = 15; 20 | 21 | public static final int LOGIN_NETWORK_TIMEOUT = 15; 22 | 23 | public static final int CARD_LOST_NETWORK_TIMEOUT = 15; 24 | 25 | public static final int OSS_NETWORK_TIMEOUT = 3; 26 | 27 | public static final int PROFILE_NETWORK_TIMEOUT = 3; 28 | 29 | public static final int SCHEDULE_QUERY_NETWORK_TIMEOUT = 15; 30 | 31 | public static final int TOKEN_NETWORK_TIMEOUT = 3; 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/ScheduleQuery/ScheduleQueryResult.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.ScheduleQuery; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | import cn.gdeiassistant.Pojo.Entity.Schedule; 9 | 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class ScheduleQueryResult implements Serializable { 12 | 13 | private List scheduleList; 14 | 15 | private Integer week; 16 | 17 | public List getScheduleList() { 18 | return scheduleList; 19 | } 20 | 21 | public void setScheduleList(List scheduleList) { 22 | this.scheduleList = scheduleList; 23 | } 24 | 25 | public Integer getWeek() { 26 | return week; 27 | } 28 | 29 | public void setWeek(Integer week) { 30 | this.week = week; 31 | } 32 | 33 | public ScheduleQueryResult() { 34 | } 35 | 36 | public ScheduleQueryResult(List scheduleList, int week) { 37 | this.scheduleList = scheduleList; 38 | this.week = week; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/Entity/Token.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.Entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.io.Serializable; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class Token implements Serializable { 9 | 10 | /** 11 | * 令牌签名 12 | */ 13 | private String signature; 14 | 15 | /** 16 | * 创建时间戳 17 | */ 18 | private Long createTime; 19 | 20 | /** 21 | * 过期时间戳 22 | */ 23 | private Long expireTime; 24 | 25 | public Long getCreateTime() { 26 | return createTime; 27 | } 28 | 29 | public void setCreateTime(Long createTime) { 30 | this.createTime = createTime; 31 | } 32 | 33 | public String getSignature() { 34 | return signature; 35 | } 36 | 37 | public void setSignature(String signature) { 38 | this.signature = signature; 39 | } 40 | 41 | public Long getExpireTime() { 42 | return expireTime; 43 | } 44 | 45 | public void setExpireTime(Long expireTime) { 46 | this.expireTime = expireTime; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/Entity/Cookie.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.Entity; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * Created by linguancheng on 2017/9/7. 10 | */ 11 | 12 | @JsonIgnoreProperties(ignoreUnknown = true) 13 | public class Cookie implements Serializable { 14 | 15 | @JSONField(ordinal = 1) 16 | private String name; 17 | 18 | @JSONField(ordinal = 2) 19 | private String value; 20 | 21 | @JSONField(ordinal = 3) 22 | private String domain; 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public void setName(String name) { 29 | this.name = name; 30 | } 31 | 32 | public String getValue() { 33 | return value; 34 | } 35 | 36 | public void setValue(String value) { 37 | this.value = value; 38 | } 39 | 40 | public String getDomain() { 41 | return domain; 42 | } 43 | 44 | public void setDomain(String domain) { 45 | this.domain = domain; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/res/layout/app_bar_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 21 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/View/Dialog/ProgressDialogCreator.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.View.Dialog; 2 | 3 | import android.app.Activity; 4 | import android.app.Dialog; 5 | import android.content.Context; 6 | import android.graphics.Point; 7 | import android.support.v7.app.AlertDialog; 8 | import android.view.Display; 9 | import android.view.ViewGroup; 10 | import android.view.WindowManager; 11 | 12 | public class ProgressDialogCreator { 13 | 14 | /** 15 | * 创建ProgressDialog 16 | * 17 | * @param activity 18 | * @return 19 | */ 20 | public Dialog GetProgressDialogCreator(Activity activity) { 21 | AlertDialog.Builder builder = new AlertDialog.Builder(activity); 22 | builder.setView(activity.getLayoutInflater().inflate(cn.gdeiassistant.R.layout.progressdialog, (ViewGroup) activity.findViewById(cn.gdeiassistant.R.id.progressDialog))); 23 | builder.setCancelable(false); 24 | AlertDialog dialog = builder.create(); 25 | dialog.show(); 26 | Display display = ((WindowManager) activity.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); 27 | Point point = new Point(); 28 | display.getSize(point); 29 | dialog.getWindow().setLayout(point.x / 2, point.y / 5); 30 | return dialog; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Tools/TimeUtils.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Tools; 2 | 3 | import java.util.Date; 4 | 5 | public class TimeUtils { 6 | 7 | public enum TimeUnit { 8 | 9 | SECOND(0), MINUTES(1), HOUR(2), DAY(3); 10 | 11 | TimeUnit(Integer unit) { 12 | this.unit = unit; 13 | } 14 | 15 | private Integer unit; 16 | 17 | public Integer getUnit() { 18 | return unit; 19 | } 20 | } 21 | 22 | /** 23 | * 两个时间间的时间戳计算函数 24 | * 25 | * @param beginDate 26 | * @param endDate 27 | * @param timeUnit 28 | * @return 29 | */ 30 | public static long GetTimestampDifference(Date beginDate, Date endDate, TimeUnit timeUnit) { 31 | if (beginDate == null || endDate == null) { 32 | return 0; 33 | } 34 | long millisecond = endDate.getTime() - beginDate.getTime(); 35 | switch (timeUnit.unit) { 36 | case 0: 37 | return (millisecond / 1000); 38 | case 1: 39 | return (millisecond / (1000 * 60)); 40 | case 2: 41 | return (millisecond / (1000 * 60 * 60)); 42 | case 3: 43 | return (millisecond / (1000 * 60 * 60 * 24)); 44 | } 45 | return 0; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_webview.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/JsonResult/JsonResult.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.JsonResult; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.io.Serializable; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class JsonResult implements Serializable { 9 | 10 | private Boolean success; 11 | 12 | private Integer code; 13 | 14 | private String message; 15 | 16 | public Boolean isSuccess() { 17 | return success; 18 | } 19 | 20 | public void setSuccess(Boolean success) { 21 | this.success = success; 22 | } 23 | 24 | public Integer getCode() { 25 | return code; 26 | } 27 | 28 | public void setCode(Integer code) { 29 | this.code = code; 30 | } 31 | 32 | public String getMessage() { 33 | return message; 34 | } 35 | 36 | public void setMessage(String message) { 37 | this.message = message; 38 | } 39 | 40 | public JsonResult() { 41 | 42 | } 43 | 44 | public JsonResult(Boolean success) { 45 | this.success = success; 46 | } 47 | 48 | public JsonResult(Boolean success, String message) { 49 | this.success = success; 50 | this.message = message; 51 | } 52 | 53 | public JsonResult(Boolean success, Integer code, String message) { 54 | this.success = success; 55 | this.code = code; 56 | this.message = message; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/NetWork/EncryptionNetWork.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.NetWork; 2 | 3 | import android.content.Context; 4 | 5 | import com.google.gson.Gson; 6 | import com.google.gson.reflect.TypeToken; 7 | 8 | import cn.gdeiassistant.Constant.NetWorkTimeoutConstant; 9 | import cn.gdeiassistant.Exception.ResponseStatusCodeException; 10 | import cn.gdeiassistant.Pojo.JsonResult.DataJsonResult; 11 | import cn.gdeiassistant.R; 12 | import cn.gdeiassistant.Tools.OkHttpUtils; 13 | import okhttp3.OkHttpClient; 14 | import okhttp3.Request; 15 | import okhttp3.Response; 16 | 17 | public class EncryptionNetWork { 18 | 19 | /** 20 | * 获取服务端RSA公钥 21 | * 22 | * @param context 23 | * @return 24 | * @throws Exception 25 | */ 26 | public DataJsonResult GetServerPublicKey(Context context) throws Exception { 27 | OkHttpClient okHttpClient = OkHttpUtils.GetOkHttpClient(NetWorkTimeoutConstant.ENCRYPT_NETWORK_TIMEOUT, context); 28 | Request request = new Request.Builder().url(context.getString(R.string.resource_domain) + "rest/encryption/rsa/publickey").build(); 29 | Response response = okHttpClient.newCall(request).execute(); 30 | if (response.isSuccessful()) { 31 | return new Gson().fromJson(response.body().string() 32 | , new TypeToken>() { 33 | }.getType()); 34 | } 35 | throw new ResponseStatusCodeException("服务暂不可用"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/nav_header_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 20 | 21 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/NetWork/CheckUpgradeNetWork.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.NetWork; 2 | 3 | import android.content.Context; 4 | 5 | import com.google.gson.Gson; 6 | import com.google.gson.reflect.TypeToken; 7 | 8 | import cn.gdeiassistant.Constant.NetWorkTimeoutConstant; 9 | import cn.gdeiassistant.Exception.ResponseStatusCodeException; 10 | import cn.gdeiassistant.Pojo.JsonResult.DataJsonResult; 11 | import cn.gdeiassistant.Pojo.Upgrade.CheckUpgradeResult; 12 | import cn.gdeiassistant.R; 13 | import cn.gdeiassistant.Tools.OkHttpUtils; 14 | import okhttp3.OkHttpClient; 15 | import okhttp3.Request; 16 | import okhttp3.Response; 17 | 18 | public class CheckUpgradeNetWork { 19 | 20 | /** 21 | * 检查更新网络请求 22 | * 23 | * @return 24 | */ 25 | public DataJsonResult GetUpgradeInformation(Context context) throws Exception { 26 | OkHttpClient okHttpClient = OkHttpUtils.GetOkHttpClient(NetWorkTimeoutConstant.CHECK_UPGRADE_NETWORK_TIMEOUT, context); 27 | Request request = new Request.Builder().url(context.getString(R.string.resource_domain) + "rest/update/android").build(); 28 | Response response = okHttpClient.newCall(request).execute(); 29 | if (response.isSuccessful()) { 30 | return new Gson().fromJson(response.body().string() 31 | , new TypeToken>() { 32 | }.getType()); 33 | } 34 | throw new ResponseStatusCodeException("服务暂不可用"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/NetWork/OSSNetWork.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.NetWork; 2 | 3 | import android.content.Context; 4 | 5 | import com.google.gson.Gson; 6 | import com.google.gson.reflect.TypeToken; 7 | 8 | import cn.gdeiassistant.Constant.NetWorkTimeoutConstant; 9 | import cn.gdeiassistant.Exception.ResponseStatusCodeException; 10 | import cn.gdeiassistant.Pojo.JsonResult.DataJsonResult; 11 | import cn.gdeiassistant.Pojo.OssFederationToken.OssFederationTokenResult; 12 | import cn.gdeiassistant.R; 13 | import cn.gdeiassistant.Tools.OkHttpUtils; 14 | import okhttp3.OkHttpClient; 15 | import okhttp3.Request; 16 | import okhttp3.Response; 17 | 18 | public class OSSNetWork { 19 | 20 | /** 21 | * 获取临时访问令牌 22 | * 23 | * @param context 24 | * @return 25 | * @throws Exception 26 | */ 27 | public DataJsonResult GetOSSFederationToken(Context context) throws Exception { 28 | OkHttpClient okHttpClient = OkHttpUtils.GetOkHttpClient(NetWorkTimeoutConstant.OSS_NETWORK_TIMEOUT, context); 29 | Request request = new Request.Builder().url(context.getString(R.string.resource_domain) + "rest/osstoken").build(); 30 | Response response = okHttpClient.newCall(request).execute(); 31 | if (response.isSuccessful()) { 32 | return new Gson().fromJson(response.body().string() 33 | , new TypeToken>() { 34 | }.getType()); 35 | } 36 | throw new ResponseStatusCodeException("服务暂不可用"); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/Upgrade/CheckUpgradeResult.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.Upgrade; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.io.Serializable; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class CheckUpgradeResult implements Serializable { 9 | 10 | private String downloadURL; 11 | 12 | private String versionInfo; 13 | 14 | private String versionCodeName; 15 | 16 | private String fileSize; 17 | 18 | private Integer versionCode; 19 | 20 | public String getDownloadURL() { 21 | return downloadURL; 22 | } 23 | 24 | public void setDownloadURL(String downloadURL) { 25 | this.downloadURL = downloadURL; 26 | } 27 | 28 | public String getVersionInfo() { 29 | return versionInfo; 30 | } 31 | 32 | public void setVersionInfo(String versionInfo) { 33 | this.versionInfo = versionInfo; 34 | } 35 | 36 | public String getVersionCodeName() { 37 | return versionCodeName; 38 | } 39 | 40 | public void setVersionCodeName(String versionCodeName) { 41 | this.versionCodeName = versionCodeName; 42 | } 43 | 44 | public int getVersionCode() { 45 | return versionCode; 46 | } 47 | 48 | public void setVersionCode(Integer versionCode) { 49 | this.versionCode = versionCode; 50 | } 51 | 52 | public String getFileSize() { 53 | return fileSize; 54 | } 55 | 56 | public void setFileSize(String fileSize) { 57 | this.fileSize = fileSize; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/Pojo/Entity/Card.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.Pojo.Entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.io.Serializable; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class Card implements Serializable { 9 | 10 | //交易时间 11 | private String tradeTime; 12 | 13 | //商户名称 14 | private String merchantName; 15 | 16 | //交易名称 17 | private String tradeName; 18 | 19 | //交易金额 20 | private String tradePrice; 21 | 22 | //账户余额 23 | private String accountBalance; 24 | 25 | public String getAccountBalance() { 26 | return accountBalance; 27 | } 28 | 29 | public void setAccountBalance(String accountBalance) { 30 | this.accountBalance = accountBalance; 31 | } 32 | 33 | public String getTradePrice() { 34 | return tradePrice; 35 | } 36 | 37 | public void setTradePrice(String tradePrice) { 38 | this.tradePrice = tradePrice; 39 | } 40 | 41 | public String getTradeName() { 42 | return tradeName; 43 | } 44 | 45 | public void setTradeName(String tradeName) { 46 | this.tradeName = tradeName; 47 | } 48 | 49 | public String getMerchantName() { 50 | return merchantName; 51 | } 52 | 53 | public void setMerchantName(String merchantName) { 54 | this.merchantName = merchantName; 55 | } 56 | 57 | public String getTradeTime() { 58 | return tradeTime; 59 | } 60 | 61 | public void setTradeTime(String tradeTime) { 62 | this.tradeTime = tradeTime; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/NetWork/LostNetWork.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.NetWork; 2 | 3 | import android.content.Context; 4 | 5 | import com.google.gson.Gson; 6 | 7 | import cn.gdeiassistant.Application.GdeiAssistantApplication; 8 | import cn.gdeiassistant.Constant.NetWorkTimeoutConstant; 9 | import cn.gdeiassistant.Exception.ResponseStatusCodeException; 10 | import cn.gdeiassistant.Pojo.JsonResult.JsonResult; 11 | import cn.gdeiassistant.R; 12 | import cn.gdeiassistant.Tools.OkHttpUtils; 13 | import okhttp3.FormBody; 14 | import okhttp3.OkHttpClient; 15 | import okhttp3.Request; 16 | import okhttp3.RequestBody; 17 | import okhttp3.Response; 18 | 19 | public class LostNetWork { 20 | 21 | /** 22 | * 校园卡挂失 23 | * 24 | * @param cardPassword 25 | * @param context 26 | */ 27 | public JsonResult CardLost(String cardPassword, Context context) throws Exception { 28 | GdeiAssistantApplication application = (GdeiAssistantApplication) context; 29 | OkHttpClient okHttpClient = OkHttpUtils.GetOkHttpClient(NetWorkTimeoutConstant.CARD_LOST_NETWORK_TIMEOUT, context); 30 | RequestBody requestBody = new FormBody.Builder().add("token", application.getToken()) 31 | .add("cardPassword", cardPassword).build(); 32 | Request request = new Request.Builder().url(context.getString(R.string.resource_domain) + "rest/cardlost").post(requestBody).build(); 33 | Response response = okHttpClient.newCall(request).execute(); 34 | if (response.isSuccessful()) { 35 | return new Gson().fromJson(response.body().string(), JsonResult.class); 36 | } 37 | throw new ResponseStatusCodeException("服务暂不可用"); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/cn/gdeiassistant/NetWork/EvaluateNetWork.java: -------------------------------------------------------------------------------- 1 | package cn.gdeiassistant.NetWork; 2 | 3 | import android.content.Context; 4 | 5 | import com.google.gson.Gson; 6 | 7 | import cn.gdeiassistant.Application.GdeiAssistantApplication; 8 | import cn.gdeiassistant.Constant.NetWorkTimeoutConstant; 9 | import cn.gdeiassistant.Exception.ResponseStatusCodeException; 10 | import cn.gdeiassistant.Pojo.JsonResult.JsonResult; 11 | import cn.gdeiassistant.R; 12 | import cn.gdeiassistant.Tools.OkHttpUtils; 13 | import okhttp3.FormBody; 14 | import okhttp3.OkHttpClient; 15 | import okhttp3.Request; 16 | import okhttp3.RequestBody; 17 | import okhttp3.Response; 18 | 19 | public class EvaluateNetWork { 20 | 21 | /** 22 | * 提交教学评价请求 23 | * 24 | * @param directlySubmit 25 | * @param context 26 | * @return 27 | */ 28 | public JsonResult SubmitEvaluateRequest(boolean directlySubmit, Context context) throws Exception { 29 | GdeiAssistantApplication application = (GdeiAssistantApplication) context; 30 | OkHttpClient okHttpClient = OkHttpUtils.GetOkHttpClient(NetWorkTimeoutConstant.EVALUATE_NETWORK_TIMEOUT, context); 31 | RequestBody requestBody = new FormBody.Builder().add("directlySubmit", String.valueOf(directlySubmit)) 32 | .add("token", application.getToken()).build(); 33 | Request request = new Request.Builder().url(context.getString(R.string.resource_domain) + "rest/evaluate").post(requestBody).build(); 34 | Response response = okHttpClient.newCall(request).execute(); 35 | if (response.isSuccessful()) { 36 | return new Gson().fromJson(response.body().string(), JsonResult.class); 37 | } 38 | throw new ResponseStatusCodeException("服务暂不可用"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/grade_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 23 | 24 | 32 | 33 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 18 | 19 | 24 | 25 | 29 | 30 | 34 | 35 |