diff --git a/.travis.yml b/.travis.yml
index 7cd038e..615a4d5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,8 +11,9 @@ before_install:
- curl https://gist.githubusercontent.com/noamtamim/b04ef67239d2b43638aa5a9a024a1937/raw/56f1a38dd88a3774b71a063822444f3961d61873/android-sdk-license.sh | sh
script:
- - ./gradlew assembleDebug
- - cp ./app/build/outputs/apk/debug/app-debug.apk ./IRbaby.apk
+ - ./gradlew assembleRelease
+ - cp ./app/build/outputs/apk/release/app-release.apk ./IRbaby.apk
+
deploy:
provider: releases
api_key: "$TOKEN"
diff --git a/app/build.gradle b/app/build.gradle
index aa7d199..d0f9339 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -12,13 +12,20 @@ android {
versionName "0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
+
+ signingConfigs {
+ release {
+ storeFile file("release-key/irbaby.jks")
+ keyAlias ("key0")
+ keyPassword ("as13348848836")
+ storePassword ("as13348848836")
+ }
+ }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- debuggable = true
- jniDebuggable = true
- renderscriptDebuggable = true
+ signingConfig signingConfigs.release
}
debug {
diff --git a/app/release-key/irbaby.jks b/app/release-key/irbaby.jks
new file mode 100644
index 0000000..f63eacd
Binary files /dev/null and b/app/release-key/irbaby.jks differ
diff --git a/app/release/app-release.apk b/app/release/app-release.apk
new file mode 100644
index 0000000..b2b342f
Binary files /dev/null and b/app/release/app-release.apk differ
diff --git a/app/release/output.json b/app/release/output.json
new file mode 100644
index 0000000..128bf41
--- /dev/null
+++ b/app/release/output.json
@@ -0,0 +1 @@
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":2,"versionName":"0.2","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 182c37d..2430b52 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -12,8 +12,9 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
+ android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
-
+
@@ -31,10 +32,10 @@
+ android:value="26a7303fc1ee622d751b51ea2a1aaee9" />
+ android:value="0140b26151901859539c794289543a12" />
\ No newline at end of file
diff --git a/app/src/main/java/top/caffreyfans/irbaby/IRApplication.java b/app/src/main/java/top/caffreyfans/irbaby/IRApplication.java
index 87d7c2e..b9ae592 100644
--- a/app/src/main/java/top/caffreyfans/irbaby/IRApplication.java
+++ b/app/src/main/java/top/caffreyfans/irbaby/IRApplication.java
@@ -1,7 +1,10 @@
package top.caffreyfans.irbaby;
+import android.util.Log;
+
import com.activeandroid.ActiveAndroid;
import net.irext.webapi.WebAPIs;
+import net.irext.webapi.utils.PackageUtils;
import org.litepal.LitePal;
@@ -33,6 +36,8 @@ public void run() {
}.start();
new UdpReceiveThread().start();
+
+ Log.d(TAG, "onCreate: " + PackageUtils.getCertificateSHA1Fingerprint(this));
}
}
diff --git a/app/src/main/java/top/caffreyfans/irbaby/ui/appliances/ApplianceSelectActivity.java b/app/src/main/java/top/caffreyfans/irbaby/ui/appliances/ApplianceSelectActivity.java
index b665d5c..4e7fa19 100644
--- a/app/src/main/java/top/caffreyfans/irbaby/ui/appliances/ApplianceSelectActivity.java
+++ b/app/src/main/java/top/caffreyfans/irbaby/ui/appliances/ApplianceSelectActivity.java
@@ -72,11 +72,15 @@ protected void onCreate(Bundle savedInstanceState) {
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
new FetchData().execute();
}
-
private class FetchData extends AsyncTask> {
private List mCategoryList;
@@ -117,10 +121,10 @@ protected void onPostExecute(List stringList) {
super.onPostExecute(stringList);
mProgressBar.setVisibility(View.INVISIBLE);
mListView.setVisibility(View.VISIBLE);
-
AppliancesSelectAdapter appliancesSelectAdapter = new AppliancesSelectAdapter(mContext, stringList);
mListView.setAdapter(appliancesSelectAdapter);
+ Log.d(TAG, "onPostExecute: " + stringList.toString());
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
diff --git a/web-api/src/main/java/net/irext/webapi/WebAPIs.java b/web-api/src/main/java/net/irext/webapi/WebAPIs.java
index 08af24d..d16ec4b 100644
--- a/web-api/src/main/java/net/irext/webapi/WebAPIs.java
+++ b/web-api/src/main/java/net/irext/webapi/WebAPIs.java
@@ -176,7 +176,6 @@ public List listCategories() {
listCategoriesRequest.setCount(mCount);
String bodyJson = listCategoriesRequest.toJson();
- Log.d(TAG, "listCategories: " + bodyJson);
try {
String response = postToServer(listCategoriesURL, bodyJson);
@@ -311,7 +310,6 @@ public List listRemoteIndexes(int categoryId,
try {
String response = postToServer(listIndexesURL, bodyJson);
- Log.d(TAG, "listRemoteIndexes: " + response);
IndexesResponse indexesResponse = new Gson().fromJson(response, IndexesResponse.class);
if (indexesResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) {