Skip to content

Commit

Permalink
修复已知的Bug。
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyangyoulin committed May 14, 2018
1 parent 8919f42 commit addbe6f
Show file tree
Hide file tree
Showing 34 changed files with 55 additions and 346 deletions.
46 changes: 24 additions & 22 deletions app/build.gradle
Expand Up @@ -5,44 +5,46 @@ android {
defaultConfig {
applicationId "com.mnnyang.gzuclassschedule"
minSdkVersion 21
targetSdkVersion 25
versionCode 9
versionName "1.3.0"
targetSdkVersion 27
versionCode 10
versionName "1.3.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
//
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
testImplementation 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'


compile 'org.jsoup:jsoup:1.10.3'
compile 'io.reactivex:rxjava:1.1.3'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.zhy:okhttputils:2.6.2'
implementation 'org.jsoup:jsoup:1.10.3'
implementation 'io.reactivex:rxjava:1.1.3'
implementation 'io.reactivex:rxandroid:1.0.1'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.zhy:okhttputils:2.6.2'

}



//版本不够 弃用
//compile 'com.zhihu.android:matisse:0.4.3' //https://github.com/zhihu/Matisse

//implementation 'com.github.bumptech.glide:glide:4.6.1'
//annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'

}
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":9},"path":"app-release.apk","properties":{"packageId":"com.mnnyang.gzuclassschedule","split":"","minSdkVersion":"21"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":10,"versionName":"1.3.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
4 changes: 0 additions & 4 deletions app/src/main/java/com/mnnyang/gzuclassschedule/app/Url.java
Expand Up @@ -18,10 +18,6 @@ public class Url {
public static final String xskbcx = "xskbcx.aspx";
public static final String default2 = "default2.aspx";

// public static final String URL_CHECK_CODE = URL_GZU_HOST + CheckCode;
// public static final String URL_LOAD_COURSE = URL_GZU_HOST + xskbcx;
// public static final String URL_LOGIN_PAGE = URL_GZU_HOST + default2;

public static final String PARAM_XH = "xh";
public static final String PARAM_XND = "xnd";
public static final String PARAM_XQD = "xqd";
Expand Down
30 changes: 16 additions & 14 deletions app/src/main/java/com/mnnyang/gzuclassschedule/http/HttpUtils.java
Expand Up @@ -54,7 +54,8 @@ public void onResponse(String response, int id) {
}

public void loadCaptcha(final File dir, final String schoolUrl, final HttpCallback<Bitmap> callback) {
OkHttpUtils.post().url(schoolUrl+"/"+Url.default2)
OkHttpUtils.post().url(schoolUrl + "/" +
(schoolUrl.contains(Url.default2) ? "" : Url.default2))
.build().execute(new StringCallback() {
@Override
public void onError(Call call, Exception e, int id) {
Expand All @@ -65,13 +66,13 @@ public void onError(Call call, Exception e, int id) {
public void onResponse(String response, int id) {
Url.VIEWSTATE_LOGIN_CODE = ParseCourse.parseViewStateCode(response);
LogUtil.d(this, "login_code:" + Url.VIEWSTATE_LOGIN_CODE);
toLoadCaptcha(dir, schoolUrl,callback);
toLoadCaptcha(dir, schoolUrl, callback);
}
});
}

private void toLoadCaptcha(final File dir,String schoolUrl, final HttpCallback<Bitmap> callback) {
OkHttpUtils.get().url(schoolUrl+"/"+Url.CheckCode).build().execute(
private void toLoadCaptcha(final File dir, String schoolUrl, final HttpCallback<Bitmap> callback) {
OkHttpUtils.get().url(schoolUrl + "/" + Url.CheckCode).build().execute(
new FileCallBack(dir.getAbsolutePath(), "loadCaptcha.jpg") {
@Override
public void onError(Call call, Exception e, int id) {
Expand All @@ -88,10 +89,11 @@ public void onResponse(File response, int id) {
});
}

public void login(final String schoolUrl,final String xh, String passwd, String catpcha,
public void login(final String schoolUrl, final String xh, String passwd, String catpcha,
final String courseTime, final String term,
final HttpCallback<String> callback) {
OkHttpUtils.post().url(schoolUrl+"/"+Url.default2)
OkHttpUtils.post().url(schoolUrl + "/" +
(schoolUrl.contains(Url.default2) ? "" : Url.default2))
.addParams("__VIEWSTATE", Url.VIEWSTATE_LOGIN_CODE)
.addParams("txtUserName", xh)
.addParams("Textbox1", "")
Expand Down Expand Up @@ -119,10 +121,10 @@ public void onResponse(String response, int id) {
callback.onFail(app.mContext.getString(R.string.pwd_err));
} else {
if (TextUtils.isEmpty(courseTime) || TextUtils.isEmpty(term)) {
toImpt(xh, schoolUrl,callback);
toImpt(xh, schoolUrl, callback);
return;
}
toImpt(xh,schoolUrl, courseTime, term, callback);
toImpt(xh, schoolUrl, courseTime, term, callback);
}
}
});
Expand All @@ -134,10 +136,10 @@ public void onResponse(String response, int id) {
* @param xh
* @param callback
*/
public void toImpt(String xh, String schoolUrl,final HttpCallback<String> callback) {
public void toImpt(String xh, String schoolUrl, final HttpCallback<String> callback) {
LogUtil.d(this, "get normal+" + xh);
OkHttpUtils.get().url(schoolUrl+"/"+Url.xskbcx)
.addHeader("Referer", schoolUrl+"/"+Url.xskbcx + "?xh=" + xh)
OkHttpUtils.get().url(schoolUrl + "/" + Url.xskbcx)
.addHeader("Referer", schoolUrl + "/" + Url.xskbcx + "?xh=" + xh)
.addParams(Url.PARAM_XH, xh)
.build()
.execute(new StringCallback() {
Expand All @@ -162,11 +164,11 @@ public void onResponse(String response, int id) {
* @param term 学期num
* @param callback
*/
public void toImpt(String schoolUrl,String xh, String courseTime, String term,
public void toImpt(String schoolUrl, String xh, String courseTime, String term,
final HttpCallback<String> callback) {
LogUtil.d("toImpt", "xh" + xh + "c" + courseTime + "t" + term);
OkHttpUtils.post().url(schoolUrl+"/"+Url.xskbcx + "?xh=" + xh + "&xm=%D1%EE%D3%D1%C1%D6&gnmkdm=N121603")
.addHeader("Referer", schoolUrl+"/"+Url.xskbcx + "?xh=" + xh + "&xm=%D1%EE%D3%D1%C1%D6&gnmkdm=N121603")
OkHttpUtils.post().url(schoolUrl + "/" + Url.xskbcx + "?xh=" + xh + "&xm=%D1%EE%D3%D1%C1%D6&gnmkdm=N121603")
.addHeader("Referer", schoolUrl + "/" + Url.xskbcx + "?xh=" + xh + "&xm=%D1%EE%D3%D1%C1%D6&gnmkdm=N121603")
.addHeader("Connection", "keep-alive")

// .addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
Expand Down
Expand Up @@ -57,7 +57,7 @@ private String initSchoolUrl() {
if (TextUtils.isEmpty(schoolUrl)) {
schoolUrl = Url.URL_GZU_HOST;
}

schoolUrl = schoolUrl.replace(Url.default2,"");
return schoolUrl;
}

Expand Down
Expand Up @@ -25,8 +25,6 @@

public class SchoolActivity extends BaseActivity implements SchoolContract.View, View.OnClickListener {

private TextView mTvOtherSchool;
private TextView mTvGzu;
private SchoolContract.Presenter mPresenter;
private DialogHelper mDialogHelper;
private DialogHelper mTestingDialog;
Expand All @@ -44,10 +42,10 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
}

private void initView() {
mTvGzu = findViewById(R.id.tv_gzu);
mTvOtherSchool = findViewById(R.id.tv_other);
mTvOtherSchool.setOnClickListener(this);
mTvGzu.setOnClickListener(this);
TextView tvGzu = findViewById(R.id.tv_gzu);
TextView tvOtherSchool = findViewById(R.id.tv_other);
tvOtherSchool.setOnClickListener(this);
tvGzu.setOnClickListener(this);
}

@Override
Expand Down
15 changes: 0 additions & 15 deletions app/src/main/res/anim/fragment_in.xml

This file was deleted.

15 changes: 0 additions & 15 deletions app/src/main/res/anim/fragment_out.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/color/selector_btn_popup.xml

This file was deleted.

Binary file removed app/src/main/res/drawable/default_bg_image.png
Binary file not shown.
9 changes: 0 additions & 9 deletions app/src/main/res/drawable/ic_edit_black_24dp.xml

This file was deleted.

9 changes: 0 additions & 9 deletions app/src/main/res/drawable/ic_svg_arrow_back_black_24dp.xml

This file was deleted.

32 changes: 0 additions & 32 deletions app/src/main/res/drawable/ic_svg_captcha.xml

This file was deleted.

12 changes: 0 additions & 12 deletions app/src/main/res/drawable/ic_svg_done.xml

This file was deleted.

23 changes: 0 additions & 23 deletions app/src/main/res/drawable/ic_svg_menu.xml

This file was deleted.

12 changes: 0 additions & 12 deletions app/src/main/res/drawable/ic_svg_ok_gary.xml

This file was deleted.

9 changes: 0 additions & 9 deletions app/src/main/res/drawable/ic_svg_school.xml

This file was deleted.

Binary file removed app/src/main/res/drawable/logo_web.png
Binary file not shown.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_about.xml
Expand Up @@ -22,7 +22,7 @@
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/logo_web"/>
android:src="@mipmap/ic_launcher"/>

<TextView
android:layout_width="wrap_content"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/activity_impt.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
Expand Down

0 comments on commit addbe6f

Please sign in to comment.