Skip to content

Commit

Permalink
发布v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jenly1314 committed Dec 31, 2023
1 parent 7eb0543 commit 0947342
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 126 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,24 @@ ZXingLite for Android 是ZXing的精简极速版,基于ZXing库优化扫码和
repositories {
//...
mavenCentral()
maven { url 'https://jitpack.io' }
}
```

2. 在Module的 **build.gradle** 里面添加引入依赖项

```gradle
// AndroidX 版本
implementation 'com.github.jenly1314:zxing-lite:3.0.1'
implementation 'com.github.jenly1314:zxing-lite:3.1.0'
```

### 温馨提示

#### 关于ZXingLite版本与编译的SDK版本要求

> 使用 **v3.x** 以上版本时,要求 **compileSdkVersion >= 33**
> 使用 **v3.1.x** 以上版本时,要求 **compileSdkVersion >= 34**
> 使用 **v3.0.x** 以上版本时,要求 **compileSdkVersion >= 33**
> 如果 **compileSdkVersion < 33** 请使用 [**v2.x版本**](https://github.com/jenly1314/ZXingLite/tree/2.x/)
Expand Down Expand Up @@ -167,7 +168,7 @@ public class QRCodeScanActivity extends BarcodeCameraScanActivity {

> **BarcodeCameraScanFragment** 的使用方式与之类似。
更多使用详情,请查看[app](app)中的源码使用示例或直接查看[API帮助文档](https://jenly1314.github.io/projects/ZXingLite/doc/)
更多使用详情,请查看[app](app)中的源码使用示例或直接查看[API帮助文档](https://jitpack.io/com/github/jenly1314/ZXingLite/latest/javadoc/)

### 其他

Expand All @@ -188,7 +189,7 @@ compileOptions {

```gradle
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.3'
}
```

Expand All @@ -201,6 +202,12 @@ dependencies {

## 版本记录

#### v3.1.0:2023-12-31
* 更新CameraScan至v1.1.0
* 更新zxing至v3.5.2
* 更新compileSdkVersion至34
* 更新Gradle至v8.0

#### v3.0.1:2023-9-13
* 更新CameraScan至v1.0.1
* 更新ViewfinderView至v1.1.0
Expand Down
11 changes: 6 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}

compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
lintOptions {
abortOnError false
}
}

dependencies {
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 39,
"versionName": "3.0.1",
"versionCode": 40,
"versionName": "3.1.0",
"outputFile": "app-release.apk"
}
],
Expand Down
23 changes: 15 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.king.zxing.app">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />

<application
android:allowBackup="true"
Expand Down
11 changes: 7 additions & 4 deletions app/src/main/java/com/king/zxing/app/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import android.Manifest;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.ImageDecoder;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import android.os.Bundle;
import android.view.View;
Expand All @@ -29,6 +32,7 @@
import com.king.camera.scan.util.PermissionUtils;
import com.king.zxing.util.CodeUtils;

import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -78,11 +82,10 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}

private void showToast(String text) {
if (toast == null) {
toast = Toast.makeText(this, text, Toast.LENGTH_SHORT);
}else {
toast.setText(text);
if(toast != null) {
toast.cancel();
}
toast = Toast.makeText(this, text, Toast.LENGTH_SHORT);
toast.show();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import com.king.zxing.analyze.MultiFormatAnalyzer
*/
class MultiFormatScanActivity : BarcodeCameraScanActivity() {

var toast: Toast? = null
private var toast: Toast? = null

override fun initCameraScan(cameraScan: CameraScan<Result>) {
super.initCameraScan(cameraScan)
Expand Down Expand Up @@ -54,11 +54,8 @@ class MultiFormatScanActivity : BarcodeCameraScanActivity() {
}

private fun showToast(text: String) {
if(toast == null) {
toast = Toast.makeText(this, text, Toast.LENGTH_SHORT)
} else {
toast?.setText(text)
}
toast?.cancel()
toast = Toast.makeText(this, text, Toast.LENGTH_SHORT)
toast?.show()
}
}
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
buildscript {
apply from: 'versions.gradle'
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
// id 'org.jetbrains.dokka' version '1.7.0' apply false
id 'com.vanniktech.maven.publish' version '0.22.0' apply false
id 'com.android.application' version '8.1.2' apply false
id 'com.android.library' version '8.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'com.vanniktech.maven.publish' version '0.25.3' apply false
}
6 changes: 6 additions & 0 deletions change_log.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 版本记录

#### v3.1.0:2023-12-31
* 更新CameraScan至v1.1.0
* 更新zxing至v3.5.2
* 更新compileSdkVersion至34
* 更新Gradle至v8.0

#### v3.0.1:2023-9-13
* 更新CameraScan至v1.0.1
* 更新ViewfinderView至v1.1.0
Expand Down
2 changes: 0 additions & 2 deletions gitpack.yml

This file was deleted.

9 changes: 7 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ org.gradle.jvmargs = -Xmx1536m
android.useAndroidX=true
android.enableJetifier=true

VERSION_NAME=3.0.1
VERSION_CODE=39
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

VERSION_NAME=3.1.0
VERSION_CODE=40
GROUP=com.github.jenly1314

POM_DESCRIPTION=ZXingLite for Android
Expand Down Expand Up @@ -47,3 +51,4 @@ RELEASE_SIGNING_ENABLED=false




2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk17
43 changes: 18 additions & 25 deletions versions.gradle
Original file line number Diff line number Diff line change
@@ -1,52 +1,43 @@
//App
// App
def app_version = [:]
app_version.versionCode = 39
app_version.versionName = "3.0.1"
app_version.versionCode = 40
app_version.versionName = "3.1.0"
ext.app_version = app_version

//build version
// build version
def build_versions = [:]
build_versions.minSdk = 21
build_versions.targetSdk = 33
build_versions.compileSdk = 33
build_versions.buildTools = "33.0.0"
build_versions.targetSdk = 34
build_versions.compileSdk = 34
build_versions.buildTools = "34.0.0"
ext.build_versions = build_versions

ext.deps = [:]

// App dependencies
def versions = [:]
//AndroidX
// AndroidX
versions.material = "1.2.0"
versions.appcompat = "1.1.0"
versions.constraintLayout = "2.0.4"

//test
// test
versions.junit = "4.13.2"
versions.androidExtJunit = "1.1.3"
versions.test = "1.2.0"
versions.runner = "1.2.0"
versions.espresso = "3.4.0"

versions.bintray_release = "0.9.2"
versions.mavenPublish = '0.22.0'
versions.gralde = "7.4.2"

//zxing
versions.zxing = "3.5.1"
versions.desugar_jdk_libs = "1.2.2"


ext.versions = versions

//androidx
// androidx
def androidx = [:]
androidx.design = "com.google.android.material:material:$versions.material"
androidx.appcompat = "androidx.appcompat:appcompat:$versions.appcompat"
androidx.constraintlayout = "androidx.constraintlayout:constraintlayout:$versions.constraintLayout"
deps.androidx = androidx

//test
// test
def test = [:]
test.junit = "junit:junit:$versions.junit"
test.android_ext_junit = "androidx.test.ext:junit:$versions.androidExtJunit"
Expand All @@ -55,14 +46,16 @@ test.runner = "androidx.test:runner:$versions.runner"
test.espresso = "androidx.test.espresso:espresso-core:$versions.espresso"
deps.test = test

//zxing
deps.zxing = "com.google.zxing:core:$versions.zxing"
// zxing
deps.zxing = "com.google.zxing:core:3.5.2"

deps.camera_scan = "com.github.jenly1314:camera-scan:1.0.1"
// CameraScan
deps.camera_scan = "com.github.jenly1314:camera-scan:1.1.0"
// ViewfinderView
deps.viewfinderview = "com.github.jenly1314:viewfinderview:1.1.0"

//desugar_jdk
deps.desugar_jdk = "com.android.tools:desugar_jdk_libs:$versions.desugar_jdk_libs"
// desugar_jdk
deps.desugar_jdk = "com.android.tools:desugar_jdk_libs:1.2.3"

ext.deps = deps

3 changes: 1 addition & 2 deletions zxing-lite/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.king.zxing">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Loading

0 comments on commit 0947342

Please sign in to comment.