Skip to content

Commit

Permalink
Merge pull request #6 from SukiEva/dev-compose
Browse files Browse the repository at this point in the history
Dev compose
  • Loading branch information
SukiEva authored Oct 8, 2021
2 parents 6b55b42 + a80b823 commit cd79042
Show file tree
Hide file tree
Showing 69 changed files with 1,484 additions and 211 deletions.
5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ android {
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles("proguard-rules.pro")
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
compileOptions {
Expand Down
177 changes: 157 additions & 20 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,21 +1,158 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# Starting with version 2.2 of the Android plugin for Gradle, this file is distributed together with
# the plugin and unpacked at build-time. The files in $ANDROID_HOME are no longer maintained and
# will be ignored by new version of the Android plugin for Gradle.

#-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
# -dontoptimize
-optimizationpasses 5
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable,!class/unboxing/enum
-repackageclasses com.absinthe.libchecker

-dontpreverify

# Preserve some attributes that may be required for reflection.
-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod

-keep class * extends androidx.fragment.app.Fragment{}
-dontnote com.android.vending.licensing.ILicensingService
-dontnote com.google.vending.licensing.ILicensingService
-dontnote com.google.android.vending.licensing.ILicensingService

# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}

# Keep setters in Views so that animations can still work.
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}

# We want to keep methods in Activity that could be used in the XML attribute onClick.
# -keepclassmembers class * extends android.app.Activity {
# public void *(android.view.View);
# }

# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keepclassmembers class * implements android.os.Parcelable {
public static final ** CREATOR;
}

-keepclassmembers class **.R$* {
public static <fields>;
}


#保留annotation, 例如 @JavascriptInterface 等 annotation
-keepattributes *Annotation*
#保留跟 javascript相关的属性
-keepattributes JavascriptInterface
#保留JavascriptInterface中的方法
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
#这个根据自己的project来设置,这个类用来与js交互,所以这个类中的 字段 ,方法, 等尽量保持
-keepclassmembers public class github.sukieva.hhu.ui.activity.config.ConfigViewModel{
<fields>;
<methods>;
public *;
private *;
}
-keepclassmembers public class github.sukieva.hhu.ui.components.InJavaScriptLocalObj{
<fields>;
<methods>;
public *;
private *;
}
# The support libraries contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontnote android.support.**
-dontwarn android.support.**

-dontwarn javax.annotation.**

# Understand the @Keep support annotation.
-keep class androidx.annotation.Keep
-keep @androidx.annotation.Keep class * {*;}

-keepclasseswithmembers class * {
@androidx.annotation.Keep <methods>;
}

-keepclasseswithmembers class * {
@androidx.annotation.Keep <fields>;
}

-keepclasseswithmembers class * {
@androidx.annotation.Keep <init>(...);
}

-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNull(java.lang.Object, java.lang.String);
static void checkNotNullParameter(java.lang.Object, java.lang.String);
}

-dontwarn org.xmlpull.v1.XmlPullParser
-dontwarn org.xmlpull.v1.XmlSerializer
-keep class org.xmlpull.v1.* {*;}

## Android architecture components: Lifecycle
# LifecycleObserver's empty constructor is considered to be unused by proguard
-keepclassmembers class * implements androidx.lifecycle.LifecycleObserver {
<init>(...);
}
# ViewModel's empty constructor is considered to be unused by proguard
-keepclassmembers class * extends androidx.lifecycle.ViewModel {
<init>(...);
}
# keep methods annotated with @OnLifecycleEvent even if they seem to be unused
# (Mostly for LiveData.LifecycleBoundObserver.onStateChange(), but who knows)
-keepclassmembers class * {
@androidx.lifecycle.OnLifecycleEvent *;
}

-keep public class github.sukieva.hhu.* { *; }

# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature,InnerClasses
-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile

-dontwarn java.lang.ClassValue

# OkHttp
-dontwarn org.conscrypt.**
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn okhttp3.internal.platform.ConscryptPlatform

-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider

-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE
Binary file added app/release/app-release.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.github.sukieva.hhuer",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1011,
"versionName": "1.0.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<application
android:name=".MyApp"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher_foreground"
android:icon="@drawable/ic_launcher_square"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@drawable/ic_launcher"
android:supportsRtl="true"
android:theme="@style/Theme.Hhu.NoActionBar"
android:usesCleartextTraffic="true">
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/java/github/sukieva/hhu/data/bean/Course.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package github.sukieva.hhu.data.bean


data class Course(
var courseName: String,
var courseAttributeName: String, // 必修 or 选修
var courseScore: String, // 成绩
var gradePointScore:String, // 成绩绩点
var credit: String, // 学分
var academicYearCode: String, //学年 2019-2020
) {
constructor() : this(
"课程名", "必修",
"100.0", "5.0", "1.0",
"2019-2020"
)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package github.sukieva.hhu.data.entity.bean
package github.sukieva.hhu.data.bean


import java.math.BigInteger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package github.sukieva.hhu.data.entity.bean
package github.sukieva.hhu.data.bean


data class PostData(
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/java/github/sukieva/hhu/data/bean/Rank.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package github.sukieva.hhu.data.bean

data class Rank(
var name: String,
var major: String,
var majorNum: String,
var averageGradePoint: String,
var averageGrade: String,
var averageRank: String,
var gradePoint: String,
var grade: String,
var rank: String
) {
constructor() : this(
"Error", "Error", "999", "5.0", "100.0", "1", "5.0", "100.0", "1"
)
}

11 changes: 0 additions & 11 deletions app/src/main/java/github/sukieva/hhu/data/entity/bean/Course.kt

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/java/github/sukieva/hhu/data/entity/bean/Rank.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ object EasyOkhttp {

val sessionCookieJar = SessionCookieJar()

val okHttpClient = OkHttpClient().newBuilder()
val okHttpClient: OkHttpClient = OkHttpClient().newBuilder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.SECONDS)
.cookieJar(sessionCookieJar)
.build()

fun sendHttpRequest(address: String, body: RequestBody? = null, callback: Callback) {
private fun sendHttpRequest(address: String, body: RequestBody? = null, callback: Callback) {
val request =
if (body != null) Request.Builder().url(address).post(body).build()
else Request.Builder().url(address).build()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package github.sukieva.hhu.data.remote.retrofit

import github.sukieva.hhu.data.entity.bean.LoginData
import github.sukieva.hhu.data.bean.LoginData
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package github.sukieva.hhu.data.remote.retrofit
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import github.sukieva.hhu.data.entity.bean.LoginData
import github.sukieva.hhu.data.bean.LoginData
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
Expand Down
Loading

0 comments on commit cd79042

Please sign in to comment.