Skip to content

Commit c0dd366

Browse files
committed
see 08/08 log
1 parent 632a5a9 commit c0dd366

File tree

41 files changed

+535
-273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+535
-273
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
* `19/08/08` [add] BusUtils#post tag support one-to-many. Publish v1.25.6.
2+
* `19/08/04` [add] ThreadUtils#Task support timeout.
3+
* `19/08/01` [upd] EncryptUtils#rsa.
14
* `19/07/31` [add] DeviceUtils#getUniqueDeviceId, DeviceUtils#isSameDevice. Publish v1.25.5.
25
* `19/07/30` [fix] ThreadUtils's task can only be executed once. PhoneUtils#getIMEI wrong.
36
* `19/07/29` [fix] BusUtils post father class useless. KeyboardUtils#hideSoft bug. Publish v1.25.4.

README-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
[frame]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/auc_frame.png
4747

48-
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.25.5-brightgreen.svg
48+
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.25.6-brightgreen.svg
4949
[auc]: https://github.com/Blankj/AndroidUtilCode
5050

5151
[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ If this project helps you a lot and you want to support the project's developmen
4545

4646
[frame]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/auc_frame.png
4747

48-
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.25.5-brightgreen.svg
48+
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.25.6-brightgreen.svg
4949
[auc]: https://github.com/Blankj/AndroidUtilCode
5050

5151
[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg

buildApp.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ android {
2929
debug {
3030
minifyEnabled false
3131
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
32+
applicationIdSuffix ".debug"
3233
}
3334
release {
3435
minifyEnabled true

buildSrc/src/main/groovy/Config.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class Config {
1414
static compileSdkVersion = 28
1515
static minSdkVersion = 14
1616
static targetSdkVersion = 28
17-
static versionCode = 1_025_005
18-
static versionName = '1.25.5'// E.g. 1.9.72 => 1,009,072
17+
static versionCode = 1_025_006
18+
static versionName = '1.25.6'// E.g. 1.9.72 => 1,009,072
1919

2020
// lib version
2121
static kotlin_version = '1.3.10'
@@ -29,17 +29,17 @@ class Config {
2929

3030
static depConfig = [
3131
plugin : [
32-
gradle : new DepConfig("com.android.tools.build:gradle:3.3.0"),
32+
gradle : new DepConfig("com.android.tools.build:gradle:3.4.0"),
3333
kotlin : new DepConfig("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"),
3434
maven : new DepConfig("com.github.dcendents:android-maven-gradle-plugin:2.1"),// 上传到 maven
3535
bintray: new DepConfig("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"),// 上传到 bintray
3636
traute : new DepConfig("tech.harmonysoft:traute-gradle:1.1.10"),// 注解转非空判断
3737

3838
// 本地第一次上传插件新的版本需设置 useLocal = true, isApply = false
3939
// 本地上传成功之后 isApply = true 即可应用插件来调试,后续版本更新无需设置 isApply = false
40-
// 发布版本的话把 useLocal = false, isApply = false,发布成功后 isApply = true 即可使用远程库版本
40+
// 发布版本的话把 useLocal = false, isApply = false,更新版本号,发布成功后 isApply = true 即可使用远程库版本
4141
api : new DepConfig(false/*是否本地调试*/, "com.blankj:api-gradle-plugin:1.0", true/*是否使用插件*/),
42-
bus : new DepConfig(false/*是否本地调试*/, "com.blankj:bus-gradle-plugin:2.0", true/*是否使用插件*/),
42+
bus : new DepConfig(false/*是否本地调试*/, "com.blankj:bus-gradle-plugin:2.1", true/*是否使用插件*/),
4343
],
4444

4545
api_gradle_plugin: new DepConfig(":plugin:api-gradle-plugin", false),

feature/subutil/pkg/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
77
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
88
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
9+
<uses-permission android:name="android.permission.SEND_SMS" />
910

1011
<uses-permission android:name="android.permission.INSTALL_PACKAGES" /><!--installAppSilent-->
1112
<uses-permission android:name="android.permission.DELETE_PACKAGES" /><!--uninstallAppSilent-->

feature/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/dangerous/DangerousActivity.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DangerousActivity : CommonTitleActivity() {
2424

2525
companion object {
2626
fun start(context: Context) {
27-
PermissionHelper.requestStorage(object : PermissionHelper.OnPermissionGrantedListener {
27+
PermissionHelper.requestStorageAndSms(object : PermissionHelper.OnPermissionGrantedListener {
2828
override fun onPermissionGranted() {
2929
val starter = Intent(context, DangerousActivity::class.java)
3030
context.startActivity(starter)
@@ -64,7 +64,8 @@ class DangerousActivity : CommonTitleActivity() {
6464
dangerousShutdownBtn,
6565
dangerousRebootBtn,
6666
dangerousReboot2RecoveryBtn,
67-
dangerousReboot2BootloaderBtn
67+
dangerousReboot2BootloaderBtn,
68+
dangerousSendSmsSilentBtn
6869
)
6970

7071
if (AppUtils.isAppSystem()) {
@@ -111,6 +112,8 @@ class DangerousActivity : CommonTitleActivity() {
111112
R.id.dangerousRebootBtn -> DangerousUtils.reboot()
112113
R.id.dangerousReboot2RecoveryBtn -> DangerousUtils.reboot2Recovery()
113114
R.id.dangerousReboot2BootloaderBtn -> DangerousUtils.reboot2Bootloader()
115+
R.id.dangerousReboot2BootloaderBtn -> DangerousUtils.reboot2Bootloader()
116+
R.id.dangerousSendSmsSilentBtn -> DangerousUtils.sendSmsSilent("10000", "sendSmsSilent")
114117
}
115118
}
116119
}

feature/subutil/pkg/src/main/java/com/blankj/subutil/pkg/helper/PermissionHelper.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import com.blankj.utilcode.util.PermissionUtils
1414
*/
1515
object PermissionHelper {
1616

17-
fun requestStorage(listener: OnPermissionGrantedListener,
18-
deniedListener: OnPermissionDeniedListener) {
19-
request(listener, deniedListener, PermissionConstants.STORAGE)
17+
fun requestStorageAndSms(listener: OnPermissionGrantedListener,
18+
deniedListener: OnPermissionDeniedListener) {
19+
request(listener, deniedListener, PermissionConstants.STORAGE, PermissionConstants.SMS)
2020
}
2121

2222
fun requestLocation(listener: OnPermissionGrantedListener,

feature/subutil/pkg/src/main/res/layout/activity_dangerous.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,18 @@
5555
android:layout_height="wrap_content"
5656
android:text="@string/dangerous_reboot_to_bootloader" />
5757

58+
<Button
59+
android:id="@+id/dangerousSendSmsSilentBtn"
60+
style="@style/WideBtnStyle"
61+
android:layout_width="match_parent"
62+
android:layout_height="wrap_content"
63+
android:text="@string/dangerous_reboot_to_bootloader" />
64+
5865
<CheckBox
5966
android:id="@+id/dangerousMobileDataEnabledCb"
6067
style="@style/CbStyle"
6168
android:layout_width="wrap_content"
6269
android:layout_height="wrap_content"
63-
android:text="@string/dangerous_data_enabled" />
70+
android:text="@string/dangerous_send_sms_silent" />
6471

6572
</LinearLayout>

feature/subutil/pkg/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
<string name="dangerous_reboot">Reboot</string>
2222
<string name="dangerous_reboot_to_recovery">Reboot To Recovery</string>
2323
<string name="dangerous_reboot_to_bootloader">Reboot To Bootloader</string>
24+
<string name="dangerous_send_sms_silent">Send SMS Silent</string>
2425
<string name="dangerous_data_enabled">Mobile Data Enabled</string>
2526
</resources>

feature/utilcode/pkg/src/main/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,6 @@
239239
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
240240
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
241241
<uses-permission android:name="android.permission.CALL_PHONE" />
242-
<uses-permission android:name="android.permission.SEND_SMS" />
243-
<uses-permission android:name="android.permission.READ_SMS" />
244242

245243
<!-- process -->
246244
<uses-permission android:name="android.permission.READ_CONTACTS" />

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/bus/BusActivity.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.blankj.utilcode.pkg.feature.bus
22

3+
import android.annotation.SuppressLint
34
import android.content.Context
45
import android.content.Intent
56
import android.os.Bundle
@@ -32,6 +33,14 @@ class BusActivity : CommonTitleActivity() {
3233
busAboutTv.text = param
3334
}
3435

36+
@SuppressLint("SetTextI18n")
37+
@BusUtils.Bus(tag = TAG_BUS, priority = 1)
38+
fun testSameTag(param: String) {
39+
if (busAboutTv.text.toString().equals(TAG_BUS)) {
40+
busAboutTv.text = "${busAboutTv.text} * 2"
41+
}
42+
}
43+
3544
@BusUtils.Bus(tag = TAG_STICKY_BUS, sticky = true)
3645
fun testSticky(callback: Callback?) {
3746
busAboutTv.text = callback?.call()

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/keyboard/KeyboardActivity.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ package com.blankj.utilcode.pkg.feature.keyboard
33
import android.content.Context
44
import android.content.Intent
55
import android.os.Bundle
6+
import android.view.MotionEvent
67
import android.view.View
8+
import android.view.inputmethod.InputMethodManager
9+
import android.widget.EditText
710
import com.blankj.common.CommonTitleActivity
811
import com.blankj.utilcode.pkg.R
912
import com.blankj.utilcode.pkg.helper.DialogHelper
@@ -82,9 +85,7 @@ class KeyboardActivity : CommonTitleActivity() {
8285
// if (ev.action == MotionEvent.ACTION_DOWN) {
8386
// val v = currentFocus
8487
// if (isShouldHideKeyboard(v, ev)) {
85-
// val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
86-
// ?: return super.dispatchTouchEvent(ev)
87-
// imm.hideSoftInputFromWindow(v.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
88+
// KeyboardUtils.hideSoftInput(this);
8889
// }
8990
// }
9091
// return super.dispatchTouchEvent(ev)

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/phone/PhoneActivity.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PhoneActivity : CommonTitleActivity() {
2323

2424
companion object {
2525
fun start(context: Context) {
26-
PermissionHelper.requestPhoneAndSms(object : PermissionHelper.OnPermissionGrantedListener {
26+
PermissionHelper.requestPhone(object : PermissionHelper.OnPermissionGrantedListener {
2727
override fun onPermissionGranted() {
2828
val starter = Intent(context, PhoneActivity::class.java)
2929
context.startActivity(starter)
@@ -64,8 +64,7 @@ class PhoneActivity : CommonTitleActivity() {
6464
applyDebouncingClickListener(
6565
phoneDialBtn,
6666
phoneCallBtn,
67-
phoneSendSmsBtn,
68-
phoneSendSmsSilentBtn
67+
phoneSendSmsBtn
6968
)
7069
}
7170

@@ -76,7 +75,6 @@ class PhoneActivity : CommonTitleActivity() {
7675
R.id.phoneDialBtn -> PhoneUtils.dial("10000")
7776
R.id.phoneCallBtn -> PhoneUtils.call("10000")
7877
R.id.phoneSendSmsBtn -> PhoneUtils.sendSms("10000", "sendSms")
79-
R.id.phoneSendSmsSilentBtn -> PhoneUtils.sendSmsSilent("10000", "sendSmsSilent")
8078
}
8179
}
8280
}

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/helper/PermissionHelper.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ object PermissionHelper {
2424
request(listener, deniedListener, PermissionConstants.STORAGE)
2525
}
2626

27-
fun requestPhoneAndSms(listener: OnPermissionGrantedListener,
28-
deniedListener: OnPermissionDeniedListener) {
29-
request(listener, deniedListener, PermissionConstants.PHONE, PermissionConstants.SMS)
27+
fun requestPhone(listener: OnPermissionGrantedListener,
28+
deniedListener: OnPermissionDeniedListener) {
29+
request(listener, deniedListener, PermissionConstants.PHONE)
3030
}
3131

3232
private fun request(grantedListener: OnPermissionGrantedListener,

feature/utilcode/pkg/src/main/res/layout/activity_phone.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,4 @@
3333
android:layout_height="wrap_content"
3434
android:text="@string/phone_send_sms" />
3535

36-
<Button
37-
android:id="@+id/phoneSendSmsSilentBtn"
38-
style="@style/WideBtnStyle"
39-
android:layout_width="match_parent"
40-
android:layout_height="wrap_content"
41-
android:text="@string/phone_send_sms_silent" />
42-
4336
</LinearLayout>

feature/utilcode/pkg/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@
261261
<string name="phone_dial">Dial</string>
262262
<string name="phone_call">Call</string>
263263
<string name="phone_send_sms">Send SMS</string>
264-
<string name="phone_send_sms_silent">Send SMS Silent</string>
265264

266265
<!--Process 相关-->
267266
<string name="process_kill_all_background">Kill All Background Processes</string>

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ org.gradle.daemon=true
1818
#org.gradle.configureondemand=true
1919
#org.gradle.parallel=true
2020

21-
#-Dorg.gradle.debug=true --no-daemon
21+
#-Dorg.gradle.debug=true --no-daemon
22+
23+
gradle.publish.key=MJwR6d1wZZRgwtOpVAKIrwbJwEfOHZeT
24+
gradle.publish.secret=quROE9JGWjAY8UP3wyEOuPZ5qtmwjG2w

lib/common/src/main/java/com/blankj/common/CommonBackActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ private void initSwipeBack() {
3030
final SwipePanel swipeLayout = new SwipePanel(this);
3131
swipeLayout.setLeftDrawable(R.drawable.base_back);
3232
swipeLayout.setLeftEdgeSize(SizeUtils.dp2px(100));
33+
swipeLayout.setLeftSwipeColor(getResources().getColor(R.color.colorPrimary));
3334
swipeLayout.wrapView(findViewById(android.R.id.content));
3435
swipeLayout.setOnFullSwipeListener(new SwipePanel.OnFullSwipeListener() {
3536
@Override

lib/subutil/src/main/java/com/blankj/subutil/util/DangerousUtils.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
package com.blankj.subutil.util;
22

3+
import android.app.PendingIntent;
34
import android.content.Context;
45
import android.content.Intent;
56
import android.os.Build;
67
import android.os.PowerManager;
78
import android.support.annotation.RequiresPermission;
9+
import android.telephony.SmsManager;
810
import android.telephony.TelephonyManager;
11+
import android.text.TextUtils;
912
import android.util.Log;
1013

1114
import com.blankj.utilcode.util.ShellUtils;
1215
import com.blankj.utilcode.util.Utils;
1316

1417
import java.io.File;
1518
import java.lang.reflect.Method;
19+
import java.util.List;
1620

1721
import static android.Manifest.permission.MODIFY_PHONE_STATE;
22+
import static android.Manifest.permission.SEND_SMS;
1823

1924
/**
2025
* <pre>
@@ -300,4 +305,26 @@ public static boolean setMobileDataEnabled(final boolean enabled) {
300305
}
301306
return false;
302307
}
308+
309+
/**
310+
* Send sms silently.
311+
* <p>Must hold {@code <uses-permission android:name="android.permission.SEND_SMS" />}</p>
312+
*
313+
* @param phoneNumber The phone number.
314+
* @param content The content.
315+
*/
316+
@RequiresPermission(SEND_SMS)
317+
public static void sendSmsSilent(final String phoneNumber, final String content) {
318+
if (TextUtils.isEmpty(content)) return;
319+
PendingIntent sentIntent = PendingIntent.getBroadcast(Utils.getApp(), 0, new Intent("send"), 0);
320+
SmsManager smsManager = SmsManager.getDefault();
321+
if (content.length() >= 70) {
322+
List<String> ms = smsManager.divideMessage(content);
323+
for (String str : ms) {
324+
smsManager.sendTextMessage(phoneNumber, null, str, sentIntent, null);
325+
}
326+
} else {
327+
smsManager.sendTextMessage(phoneNumber, null, content, sentIntent, null);
328+
}
329+
}
303330
}

lib/utilcode/README-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
Gradle:
44
```groovy
5-
implementation 'com.blankj:utilcode:1.25.5'
5+
implementation 'com.blankj:utilcode:1.25.6'
66
77
// if u use AndroidX, use the following
8-
implementation 'com.blankj:utilcodex:1.25.5'
8+
implementation 'com.blankj:utilcodex:1.25.6'
99
```
1010

1111

lib/utilcode/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
Gradle:
44
```groovy
5-
implementation 'com.blankj:utilcode:1.25.5'
5+
implementation 'com.blankj:utilcode:1.25.6'
66
77
// if u use AndroidX, use the following
8-
implementation 'com.blankj:utilcodex:1.25.5'
8+
implementation 'com.blankj:utilcodex:1.25.6'
99
```
1010

1111

0 commit comments

Comments
 (0)