Skip to content

Commit

Permalink
fix irext sdk bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Caffreyfans committed Apr 15, 2020
1 parent 65455a5 commit 351be3b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 10 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Binary file added app/release-key/irbaby.jks
Binary file not shown.
Binary file added app/release/app-release.apk
Binary file not shown.
1 change: 1 addition & 0 deletions app/release/output.json
Original file line number Diff line number Diff line change
@@ -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":{}}]
7 changes: 4 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<activity android:name=".ui.appliances.ExportActivity"></activity>
<activity android:name=".ui.appliances.ExportActivity" />
<activity android:name=".ui.devices.DeviceSettingsActivity" />
<activity android:name=".ui.appliances.ApplianceSelectActivity" />
<activity android:name=".ui.appliances.ACControlActivity" />
Expand All @@ -31,10 +32,10 @@

<meta-data
android:name="irext_app_key"
android:value="d49811846c8ec6404a0bfedffe35100c" />
android:value="26a7303fc1ee622d751b51ea2a1aaee9" />
<meta-data
android:name="irext_app_secret"
android:value="42853beac09b0d40b2b0f702011f23e6" />
android:value="0140b26151901859539c794289543a12" />
</application>

</manifest>
5 changes: 5 additions & 0 deletions app/src/main/java/top/caffreyfans/irbaby/IRApplication.java
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -33,6 +36,8 @@ public void run() {
}.start();

new UdpReceiveThread().start();

Log.d(TAG, "onCreate: " + PackageUtils.getCertificateSHA1Fingerprint(this));
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -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<Void, Void, List<String>> {

private List<Category> mCategoryList;
Expand Down Expand Up @@ -117,10 +121,10 @@ protected void onPostExecute(List<String> 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
Expand Down
2 changes: 0 additions & 2 deletions web-api/src/main/java/net/irext/webapi/WebAPIs.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ public List<Category> listCategories() {
listCategoriesRequest.setCount(mCount);
String bodyJson = listCategoriesRequest.toJson();

Log.d(TAG, "listCategories: " + bodyJson);

try {
String response = postToServer(listCategoriesURL, bodyJson);
Expand Down Expand Up @@ -311,7 +310,6 @@ public List<RemoteIndex> 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) {
Expand Down

0 comments on commit 351be3b

Please sign in to comment.