Skip to content

Commit d340e1e

Browse files
author
Ttt
committed
1.修改 build version 并兼容 Android P
Former-commit-id: bbcc665
1 parent 79bb6b1 commit d340e1e

File tree

12 files changed

+153
-18
lines changed

12 files changed

+153
-18
lines changed

.idea/codeStyles/Project.xml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown-exported-files.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown-navigator.xml

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown-navigator/profiles_settings.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DevLibUtils/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ apply plugin: 'com.android.library'
33
def dev_utils_version = "1.0.0";
44

55
android {
6-
compileSdkVersion 27
7-
buildToolsVersion "27.0.3"
6+
compileSdkVersion 28
7+
buildToolsVersion "28.0.3"
88

99
defaultConfig {
1010
minSdkVersion 14
11-
targetSdkVersion 27
11+
targetSdkVersion 28
1212
versionCode 1
1313
versionName dev_utils_version
1414

@@ -39,9 +39,9 @@ android {
3939
}
4040

4141
dependencies {
42-
compile fileTree(include: ['*.jar'], dir: 'libs')
43-
implementation 'com.android.support:appcompat-v7:27.1.1'
44-
implementation 'com.android.support:support-v4:27.1.1'
42+
implementation fileTree(include: ['*.jar'], dir: 'libs')
43+
implementation 'com.android.support:appcompat-v7:28.0.0'
44+
implementation 'com.android.support:support-v4:28.0.0'
4545
}
4646

4747
// == 打包, 包含注释 ==

DevLibUtils/src/main/java/dev/utils/app/PhoneUtils.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.utils.app;
22

3+
import android.Manifest;
34
import android.annotation.SuppressLint;
45
import android.app.Activity;
56
import android.app.PendingIntent;
@@ -8,9 +9,11 @@
89
import android.content.Intent;
910
import android.database.Cursor;
1011
import android.net.Uri;
12+
import android.os.Build;
1113
import android.os.SystemClock;
1214
import android.provider.ContactsContract;
1315
import android.provider.Settings;
16+
import android.support.annotation.RequiresPermission;
1417
import android.telephony.SmsManager;
1518
import android.telephony.TelephonyManager;
1619
import android.text.TextUtils;
@@ -300,7 +303,15 @@ public static String getDeviceId(){
300303
* @return
301304
*/
302305
public static String getSerialNumber(){
303-
return android.os.Build.SERIAL;
306+
try {
307+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P){
308+
return Build.getSerial();
309+
}
310+
return android.os.Build.SERIAL;
311+
} catch (Exception e){
312+
LogPrintUtils.eTag(TAG, e, "getSerialNumber");
313+
}
314+
return null;
304315
}
305316

306317
/**

DevLibUtils/src/main/java/dev/utils/app/image/BitmapExtendUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public static Bitmap createWatermarkBitmap(Bitmap src, Bitmap watermark) {
493493
// draw watermark into
494494
cv.drawBitmap(watermark, w - ww + 5, h - wh + 5, null);// 在src的右下角画入水印
495495
// save all clip
496-
cv.save(Canvas.ALL_SAVE_FLAG);// 保存
496+
cv.save();// 保存
497497
// store
498498
cv.restore();// 存储
499499
return newb;

app/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
22

33
android {
44

5-
compileSdkVersion 27
6-
buildToolsVersion "27.0.3"
5+
compileSdkVersion 28
6+
buildToolsVersion "28.0.3"
77

88
defaultConfig {
99
applicationId "com.dev"
1010
minSdkVersion 14
11-
targetSdkVersion 27
11+
targetSdkVersion 28
1212
versionCode 1
1313
versionName "1.0.0"
1414
}
@@ -22,9 +22,8 @@ android {
2222

2323
dependencies {
2424
implementation fileTree(dir: 'libs', include: ['*.jar'])
25-
implementation 'com.android.support:appcompat-v7:27.1.1'
26-
implementation 'com.android.support:support-v4:27.1.1'
27-
compile 'com.android.support.constraint:constraint-layout:1.0.2'
25+
implementation 'com.android.support:appcompat-v7:28.0.0'
26+
implementation 'com.android.support:support-v4:28.0.0'
2827

29-
compile project(path: ':DevLibUtils')
28+
implementation project(path: ':DevLibUtils')
3029
}

0 commit comments

Comments
 (0)