Skip to content

Commit

Permalink
V1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfusheng committed Feb 20, 2018
1 parent d693562 commit 3686dea
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 10 deletions.
4 changes: 4 additions & 0 deletions FirUpdater/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
abortOnError false
}

buildTypes {
release {
minifyEnabled false
Expand Down
7 changes: 6 additions & 1 deletion FirUpdater/src/main/java/com/sunfusheng/FirDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.widget.Toast;

import java.io.InputStream;
import java.io.RandomAccessFile;
Expand Down Expand Up @@ -82,7 +83,7 @@ public void downLoad() {
threadArr[i].start();
}
} else {
handler.sendEmptyMessage(STATE_ERROR);
handler.sendMessage(handler.obtainMessage(STATE_ERROR, "下载受限啦,明日早来哦^_^"));
}
} catch (Exception e) {
e.printStackTrace();
Expand Down Expand Up @@ -230,6 +231,10 @@ public void handleMessage(Message msg) {
break;
case STATE_ERROR:
onDownLoadListener.onError();
Object obj = msg.obj;
if (obj != null && obj instanceof String) {
Toast.makeText(context, (String) obj, Toast.LENGTH_LONG).show();
}
break;
default:
int progress = msg.what;
Expand Down
5 changes: 1 addition & 4 deletions FirUpdater/src/main/java/com/sunfusheng/FirNotification.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ public void createBuilder(Context context) {
builder.setSmallIcon(android.R.drawable.stat_sys_download);
builder.setAutoCancel(false);
builder.setOngoing(true);
builder.setShowWhen(true);
builder.setProgress(100, 0, false);
builder.setOngoing(true);
builder.setShowWhen(false);
builder.setDefaults(NotificationCompat.DEFAULT_ALL);
builder.setWhen(System.currentTimeMillis());
}

public void setContentTitle(String title) {
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,33 @@ FIR 测试通道下 APK 更新器

<br/>

### 效果图
### 应用截图

<img src="/resources/res.png" >

<br/>

#### Gradle:
### Gradle:

compile 'com.sunfusheng:FirUpdater:<latest-version>'

<br/>

### 使用

一行代码即可

new FirUpdater(context, YOUR_FIR_API_TOKEN, YOUR_FIR_APP_ID).checkVersion();

如果你还想自定义APK名称或者将APK下载到自定义路径下,你可以这样设置:

new FirUpdater(context, YOUR_FIR_API_TOKEN, YOUR_FIR_APP_ID)
.setApkName(YOUR_APK_NAME)
.setApkPath(YOUR_APK_PATH)
.checkVersion();
需要注意的是,你需要自己申请文件读写权限!

### 扫一扫[Fir.im](https://fir.im/FirUpdater)二维码下载APK

<br/>
Expand Down
1 change: 1 addition & 0 deletions Sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ dependencies {
implementation 'com.android.support:design:' + gradle.supportLibraryVersion
implementation 'com.sunfusheng:GroupRecyclerViewAdapter:1.0.2'
implementation project(":FirUpdater")
// implementation'com.sunfusheng:FirUpdater:1.0.3'
}
Binary file modified Sample/outputs/FirUpdater.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion Sample/outputs/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"FirUpdater.apk","properties":{"packageId":"com.sunfusheng.firupdater.sample","split":"","minSdkVersion":"14"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":4},"path":"FirUpdater.apk","properties":{"packageId":"com.sunfusheng.firupdater.sample","split":"","minSdkVersion":"14"}}]
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ buildscript {
repositories {
google()
jcenter()
// maven { url 'https://dl.bintray.com/sfsheng0322/maven' }
}

dependencies {
Expand All @@ -14,6 +15,7 @@ allprojects {
repositories {
google()
jcenter()
// maven { url 'https://dl.bintray.com/sfsheng0322/maven' }
}
}

Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ gradle.ext.supportLibraryVersion = '27.0.2'

gradle.ext.minSdkVersion = 14
gradle.ext.targetSdkVersion = 27
gradle.ext.versionCode = 4
gradle.ext.versionName = "1.0.3"
gradle.ext.versionCode = 5
gradle.ext.versionName = "1.0.4"

0 comments on commit 3686dea

Please sign in to comment.