提交 cdcb76ff 编写于 作者: B Blankj

see 09/05 log

上级 6718e068
......@@ -41,7 +41,7 @@
[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.0-brightgreen.svg
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.1-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode
[apisvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
......
......@@ -41,7 +41,7 @@ If this project helps you a lot and you want to support the project's developmen
[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.0-brightgreen.svg
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.1-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode
[apisvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
......
......@@ -12,6 +12,7 @@ import com.blankj.androidutilcode.base.BaseDrawerActivity;
import com.blankj.androidutilcode.feature.core.CoreUtilActivity;
import com.blankj.androidutilcode.feature.sub.SubUtilActivity;
import com.blankj.utilcode.util.BarUtils;
import com.blankj.utilcode.util.EncryptUtils;
/**
* <pre>
......
......@@ -31,6 +31,7 @@ public abstract class BaseActivity extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
ScreenUtils.adaptScreen4VerticalSlide(this, 720);
super.onCreate(savedInstanceState);
mActivity = this;
Bundle bundle = getIntent().getExtras();
......
......@@ -9,6 +9,7 @@ import android.widget.TextView;
import com.blankj.androidutilcode.R;
import com.blankj.androidutilcode.base.BaseBackActivity;
import com.blankj.utilcode.util.PathUtils;
import com.blankj.utilcode.util.SpanUtils;
/**
......@@ -42,7 +43,45 @@ public class PathActivity extends BaseBackActivity {
TextView tvAboutMetaData = findViewById(R.id.tv_about_path);
tvAboutMetaData.setText(new SpanUtils()
// .appendLine("getRootPath: " + PathUtils.getRootPath())
.appendLine("getRootPath: " + PathUtils.getRootPath())
.appendLine("getDataPath: " + PathUtils.getDataPath())
.appendLine("getDownloadCachePath: " + PathUtils.getDownloadCachePath())
.appendLine("getInternalAppDataPath: " + PathUtils.getInternalAppDataPath())
.appendLine("getInternalAppCodeCacheDir: " + PathUtils.getInternalAppCodeCacheDir())
.appendLine("getInternalAppCachePath: " + PathUtils.getInternalAppCachePath())
.appendLine("getInternalAppDbsPath: " + PathUtils.getInternalAppDbsPath())
.appendLine("getInternalAppDbPath: " + PathUtils.getInternalAppDbPath("demo"))
.appendLine("getInternalAppFilesPath: " + PathUtils.getInternalAppFilesPath())
.appendLine("getInternalAppSpPath: " + PathUtils.getInternalAppSpPath())
.appendLine("getInternalAppNoBackupFilesPath: " + PathUtils.getInternalAppNoBackupFilesPath())
.appendLine("getExternalStoragePath: " + PathUtils.getExternalStoragePath())
.appendLine("getExternalMusicPath: " + PathUtils.getExternalMusicPath())
.appendLine("getExternalPodcastsPath: " + PathUtils.getExternalPodcastsPath())
.appendLine("getExternalRingtonesPath: " + PathUtils.getExternalRingtonesPath())
.appendLine("getExternalAlarmsPath: " + PathUtils.getExternalAlarmsPath())
.appendLine("getExternalNotificationsPath: " + PathUtils.getExternalNotificationsPath())
.appendLine("getExternalPicturesPath: " + PathUtils.getExternalPicturesPath())
.appendLine("getExternalMoviesPath: " + PathUtils.getExternalMoviesPath())
.appendLine("getExternalDownloadsPath: " + PathUtils.getExternalDownloadsPath())
.appendLine("getExternalDcimPath: " + PathUtils.getExternalDcimPath())
.appendLine("getExternalDocumentsPath: " + PathUtils.getExternalDocumentsPath())
.appendLine("getExternalAppDataPath: " + PathUtils.getExternalAppDataPath())
.appendLine("getExternalAppCachePath: " + PathUtils.getExternalAppCachePath())
.appendLine("getExternalAppFilesPath: " + PathUtils.getExternalAppFilesPath())
.appendLine("getExternalAppMusicPath: " + PathUtils.getExternalAppMusicPath())
.appendLine("getExternalAppPodcastsPath: " + PathUtils.getExternalAppPodcastsPath())
.appendLine("getExternalAppRingtonesPath: " + PathUtils.getExternalAppRingtonesPath())
.appendLine("getExternalAppAlarmsPath: " + PathUtils.getExternalAppAlarmsPath())
.appendLine("getExternalAppNotificationsPath: " + PathUtils.getExternalAppNotificationsPath())
.appendLine("getExternalAppPicturesPath: " + PathUtils.getExternalAppPicturesPath())
.appendLine("getExternalAppMoviesPath: " + PathUtils.getExternalAppMoviesPath())
.appendLine("getExternalAppDownloadPath: " + PathUtils.getExternalAppDownloadPath())
.appendLine("getExternalAppDcimPath: " + PathUtils.getExternalAppDcimPath())
.appendLine("getExternalAppDocumentsPath: " + PathUtils.getExternalAppDocumentsPath())
.appendLine("getExternalAppObbPath: " + PathUtils.getExternalAppObbPath())
.append("")
.create());
}
......
......@@ -56,6 +56,7 @@ public class PermissionActivity extends BaseBackActivity {
findViewById(R.id.btn_open_app_settings).setOnClickListener(this);
findViewById(R.id.btn_request_calendar).setOnClickListener(this);
findViewById(R.id.btn_request_record_audio).setOnClickListener(this);
findViewById(R.id.btn_request_calendar_and_record_audio).setOnClickListener(this);
StringBuilder sb = new StringBuilder();
for (String s : PermissionUtils.getPermissions()) {
......@@ -139,6 +140,32 @@ public class PermissionActivity extends BaseBackActivity {
})
.request();
break;
case R.id.btn_request_calendar_and_record_audio:
PermissionUtils.permission(PermissionConstants.CALENDAR, PermissionConstants.MICROPHONE)
.rationale(new PermissionUtils.OnRationaleListener() {
@Override
public void rationale(final ShouldRequest shouldRequest) {
DialogHelper.showRationaleDialog(shouldRequest);
}
})
.callback(new PermissionUtils.FullCallback() {
@Override
public void onGranted(List<String> permissionsGranted) {
updateAboutPermission();
LogUtils.d(permissionsGranted);
}
@Override
public void onDenied(List<String> permissionsDeniedForever,
List<String> permissionsDenied) {
if (!permissionsDeniedForever.isEmpty()) {
DialogHelper.showOpenAppSettingDialog();
}
LogUtils.d(permissionsDeniedForever, permissionsDenied);
}
})
.request();
break;
}
}
......
......@@ -8,12 +8,14 @@ import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.view.Gravity;
import android.view.View;
import android.widget.Toast;
import com.blankj.androidutilcode.R;
import com.blankj.androidutilcode.base.BaseBackActivity;
import com.blankj.utilcode.util.SizeUtils;
import com.blankj.utilcode.util.SpanUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.blankj.utilcode.util.Utils;
/**
* <pre>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_about_keyboard"
style="@style/TextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/btn_hide_soft_input"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_hide_soft_input" />
<Button
android:id="@+id/btn_show_soft_input"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_show_soft_input" />
<Button
android:id="@+id/btn_toggle_soft_input"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_toggle_soft_input" />
<Button
android:id="@+id/btn_keyboard_in_fragment"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_show_dialog" />
<EditText
android:id="@+id/et_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:inputType="text" />
</LinearLayout>
\ No newline at end of file
......@@ -34,4 +34,11 @@
android:layout_height="wrap_content"
android:text="@string/permission_request_record_audio" />
<Button
android:id="@+id/btn_request_calendar_and_record_audio"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/permission_request_calendar" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
......@@ -92,12 +91,12 @@
android:onClick="networkClick"
android:text="@string/demo_network" />
<!--<Button-->
<!--style="@style/WideBtnStyle"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:onClick="pathClick"-->
<!--android:text="@string/demo_path" />-->
<Button
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="pathClick"
android:text="@string/demo_path" />
<Button
style="@style/WideBtnStyle"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/spacing_16">
android:layout_height="match_parent">
<EditText
android:id="@+id/et_input"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/spacing_16">
<Button
android:id="@+id/btn_hide_soft_input"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_hide_soft_input" />
<Button
android:id="@+id/btn_hide_soft_input"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_hide_soft_input" />
<Button
android:id="@+id/btn_show_soft_input"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_show_soft_input" />
<Button
android:id="@+id/btn_show_soft_input"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_show_soft_input" />
<Button
android:id="@+id/btn_toggle_soft_input"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_toggle_soft_input" />
<Button
android:id="@+id/btn_toggle_soft_input"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_toggle_soft_input" />
<Button
android:id="@+id/btn_close_dialog"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_close_dialog" />
<Button
android:id="@+id/btn_close_dialog"
style="@style/WideBtnStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/keyboard_close_dialog" />
<EditText
android:id="@+id/et_input"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:inputType="text" />
<EditText
android:id="@+id/et_input4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input6"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input7"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input8"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input9"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input10"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input11"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input12"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
<EditText
android:id="@+id/et_input13"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
</LinearLayout>
</LinearLayout>
</ScrollView>
\ No newline at end of file
......@@ -205,6 +205,7 @@
<string name="permission_open_app_settings">Open App Settings</string>
<string name="permission_request_calendar">Request Calendar</string>
<string name="permission_request_record_audio">Request Record Audio</string>
<string name="permission_request_calendar_and_record_audio">Request Calendar And Record Audio</string>
<!--Phone 相关-->
......
......@@ -6,8 +6,8 @@ ext {
compileSdkVersion: 27,
minSdkVersion : 14,
targetSdkVersion : 27,
versionCode : 1_020_000,
versionName : '1.20.0'// E.g. 1.9.72 => 1,009,072
versionCode : 1_020_001,
versionName : '1.20.1'// E.g. 1.9.72 => 1,009,072
]
versionConfig = [
......@@ -172,7 +172,7 @@ def configAppDependencies(Project pro) {
// LeakCanary
debugImplementation depConfig.leakcanary.android
releaseImplementation depConfig.leakcanary.android_no_op
// implementation 'com.blankj:utilcode:1.20.0'
// implementation 'com.blankj:utilcode:1.20.1'
}
}
......@@ -201,4 +201,5 @@ def configSubUtilDependencies(Project pro) {
testImplementation depConfig.junit
testImplementation depConfig.robolectric
}
}
\ No newline at end of file
}
//./gradlew bintrayUpload
\ No newline at end of file
include ':app',
':buildSrc',
':subutil',
':utilcode'
\ No newline at end of file
':utilcode'
//getRootPath: /system
//getDataPath: /data
//getInternalDownloadCachePath: /data/cache
//getInternalAppCachePath: /data/user/0/com.blankj.androidutilcode/cache
//getInternalAppFilesPath: /data/user/0/com.blankj.androidutilcode/files
//getInternalAppDbPath: /data/user/0/com.blankj.androidutilcode/databases/demo
//
//
//getExternalStoragePath: /storage/emulated/0
//getExternalAlarmsPath: /storage/emulated/0/Alarms
//getExternalDcimPath: /storage/emulated/0/DCIM
//getExternalDocumentsPath: /storage/emulated/0/Documents
//getExternalDownloadsPath: /storage/emulated/0/Download
//getExternalMoviesPath: /storage/emulated/0/Movies
//getExternalMusicPath: /storage/emulated/0/Music
//getExternalNotificationsPath: /storage/emulated/0/Notifications
//getExternalPicturesPath: /storage/emulated/0/Pictures
//getExternalPodcastsPath: /storage/emulated/0/Podcasts
//getExternalRingtonesPath: /storage/emulated/0/Ringtones
//getExternalAppCachePath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/cache
//getExternalAppFilePath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files
//getExternalAppAlarmsPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/Alarms
//getExternalAppDcimPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/DCIM
//getExternalAppDocumentsPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/Documents
//getExternalAppDownloadPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/Download
//getExternalAppMoviesPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/Movies
//getExternalAppMusicPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/Music
//getExternalAppNotificationsPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/Notifications
//getExternalAppPicturesPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/Pictures
//getExternalAppPodcastsPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/Podcasts
//getExternalAppRingtonesPath: /storage/emulated/0/Android/data/com.blankj.androidutilcode/files/Ringtones
//getObbPath: /storage/emulated/0/Android/obb/com.blankj.androidutilcode
\ No newline at end of file
* `18/09/06` 新增 PathUtils,发布 1.20.1
* `18/09/05` 新增 KeyboardUtils#showSoftInputUsingToggle 和 KeyboardUtils#hideSoftInputUsingToggle
* `18/09/04` 修复 SHA 算法名
* `18/09/03` 新增 MetaDataUtils,发布 1.20.0
* `18/08/30` 修复 PermissionUtils$PermissionActivity 的 window 背景为黑色的问题,发布 1.19.4
* `18/08/28` 新增 RegexUtils#isIDCard18Exact
......
......@@ -2,7 +2,7 @@
Gradle:
```groovy
implementation 'com.blankj:utilcode:1.20.0'
implementation 'com.blankj:utilcode:1.20.1'
```
......@@ -440,6 +440,46 @@ getOrDefault : 获取非空或默认对象
hashCode : 获取对象哈希值
```
* ### 路径相关 -> [PathUtils.java][path.java] -> [Demo][path.demo]
```
getRootPath : 获取根路径
getDataPath : 获取数据路径
getDownloadCachePath : 获取下载缓存路径
getInternalAppDataPath : 获取内存应用数据路径
getInternalAppCodeCacheDir : 获取内存应用代码缓存路径
getInternalAppCachePath : 获取内存应用缓存路径
getInternalAppDbsPath : 获取内存应用数据库路径
getInternalAppDbPath : 获取内存应用数据库路径
getInternalAppFilesPath : 获取内存应用文件路径
getInternalAppSpPath : 获取内存应用 SP 路径
getInternalAppNoBackupFilesPath: 获取内存应用未备份文件路径
getExternalStoragePath : 获取外存路径
getExternalMusicPath : 获取外存音乐路径
getExternalPodcastsPath : 获取外存播客路径
getExternalRingtonesPath : 获取外存铃声路径
getExternalAlarmsPath : 获取外存闹铃路径
getExternalNotificationsPath : 获取外存通知路径
getExternalPicturesPath : 获取外存图片路径
getExternalMoviesPath : 获取外存影片路径
getExternalDownloadsPath : 获取外存下载路径
getExternalDcimPath : 获取外存数码相机图片路径
getExternalDocumentsPath : 获取外存文档路径
getExternalAppDataPath : 获取外存应用数据路径
getExternalAppCachePath : 获取外存应用缓存路径
getExternalAppFilesPath : 获取外存应用文件路径
getExternalAppMusicPath : 获取外存应用音乐路径
getExternalAppPodcastsPath : 获取外存应用播客路径
getExternalAppRingtonesPath : 获取外存应用铃声路径
getExternalAppAlarmsPath : 获取外存应用闹铃路径
getExternalAppNotificationsPath: 获取外存应用通知路径
getExternalAppPicturesPath : 获取外存应用图片路径
getExternalAppMoviesPath : 获取外存应用影片路径
getExternalAppDownloadPath : 获取外存应用下载路径
getExternalAppDcimPath : 获取外存应用数码相机图片路径
getExternalAppDocumentsPath : 获取外存应用文档路径
getExternalAppObbPath : 获取外存应用 OBB 路径
```
* ### 权限相关 -> [PermissionUtils.java][permission.java] -> [Demo][permission.demo]
```
getPermissions : 获取应用权限
......@@ -827,6 +867,9 @@ getComments : 获取压缩文件中的注释链表
[object.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utilcode/util/ObjectUtils.java
[object.test]: https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/test/java/com/blankj/utilcode/util/ObjectUtilsTest.java
[path.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utilcode/util/PathUtils.java
[path.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/app/src/main/java/com/blankj/androidutilcode/feature/core/path/PathActivity.java
[permission.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utilcode/util/PermissionUtils.java
[permission.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/app/src/main/java/com/blankj/androidutilcode/feature/core/permission/PermissionActivity.java
......
......@@ -2,7 +2,7 @@
Gradle:
```groovy
implementation 'com.blankj:utilcode:1.20.0'
implementation 'com.blankj:utilcode:1.20.1'
```
......@@ -440,6 +440,46 @@ getOrDefault
hashCode
```
* ### About Path -> [PathUtils.java][path.java] -> [Demo][path.demo]
```
getRootPath
getDataPath
getDownloadCachePath
getInternalAppDataPath
getInternalAppCodeCacheDir
getInternalAppCachePath
getInternalAppDbsPath
getInternalAppDbPath
getInternalAppFilesPath
getInternalAppSpPath
getInternalAppNoBackupFilesPath
getExternalStoragePath
getExternalMusicPath
getExternalPodcastsPath
getExternalRingtonesPath
getExternalAlarmsPath
getExternalNotificationsPath
getExternalPicturesPath
getExternalMoviesPath
getExternalDownloadsPath
getExternalDcimPath
getExternalDocumentsPath
getExternalAppDataPath
getExternalAppCachePath
getExternalAppFilesPath
getExternalAppMusicPath
getExternalAppPodcastsPath
getExternalAppRingtonesPath
getExternalAppAlarmsPath
getExternalAppNotificationsPath
getExternalAppPicturesPath
getExternalAppMoviesPath
getExternalAppDownloadPath
getExternalAppDcimPath
getExternalAppDocumentsPath
getExternalAppObbPath
```
* ### About Permission -> [PermissionUtils.java][permission.java] -> [Demo][permission.demo]
```
getPermissions
......@@ -827,6 +867,9 @@ getComments
[object.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utilcode/util/ObjectUtils.java
[object.test]: https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/test/java/com/blankj/utilcode/util/ObjectUtilsTest.java
[path.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utilcode/util/PathUtils.java
[path.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/app/src/main/java/com/blankj/androidutilcode/feature/core/path/PathActivity.java
[permission.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utilcode/util/PermissionUtils.java
[permission.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/app/src/main/java/com/blankj/androidutilcode/feature/core/permission/PermissionActivity.java
......
......@@ -10,5 +10,4 @@ configUtilCodeDependencies project
apply {
from('readme.gradle')
from("../bintrayUpload.gradle")
}
//./gradlew bintrayUpload
\ No newline at end of file
}
\ No newline at end of file
......@@ -229,7 +229,7 @@ public final class EncryptUtils {
* @return the bytes of SHA1 encryption
*/
public static byte[] encryptSHA1(final byte[] data) {
return hashTemplate(data, "SHA1");
return hashTemplate(data, "SHA-1");
}
/**
......@@ -291,7 +291,7 @@ public final class EncryptUtils {
* @return the bytes of SHA256 encryption
*/
public static byte[] encryptSHA256(final byte[] data) {
return hashTemplate(data, "SHA256");
return hashTemplate(data, "SHA-256");
}
/**
......@@ -322,7 +322,7 @@ public final class EncryptUtils {
* @return the bytes of SHA384 encryption
*/
public static byte[] encryptSHA384(final byte[] data) {
return hashTemplate(data, "SHA384");
return hashTemplate(data, "SHA-384");
}
/**
......@@ -353,7 +353,7 @@ public final class EncryptUtils {
* @return the bytes of SHA512 encryption
*/
public static byte[] encryptSHA512(final byte[] data) {
return hashTemplate(data, "SHA512");
return hashTemplate(data, "SHA-512");
}
/**
......
//package com.blankj.utilcode.util;
//
//import android.os.Build;
//import android.os.Environment;
//import android.support.annotation.RequiresApi;
//
///**
// * <pre>
// * author: Blankj
// * blog : http://blankj.com
// * time : 2018/04/15
// * desc : utils about path
// * </pre>
// */
//public class PathUtils {
//
// private PathUtils() {
// throw new UnsupportedOperationException("u can't instantiate me...");
// }
//
// /**
// * Return the path of /system.
// *
// * @return the path of /system
// */
// public static String getRootPath() {
// return Environment.getRootDirectory().getAbsolutePath();
// }
//
// /**
// * Return the path of /data.
// *
// * @return the path of /data
// */
// public static String getDataPath() {
// return Environment.getDataDirectory().getAbsolutePath();
// }
//
// /**
// * Return the path of download/cache.
// *
// * @return the path of download/cache
// */
// public static String getInternalDownloadCachePath() {
// return Environment.getDownloadCacheDirectory().getAbsolutePath();
// }
//
// /**
// * Return the path of /data/data/package/cache.
// *
// * @return the path of /data/data/package/cache
// */
// public static String getInternalAppCachePath() {
// return Utils.getApp().getCacheDir().getAbsolutePath();
// }
//
// /**
// * Return the path of /data/data/package/files.
// *
// * @return the path of /data/data/package/files
// */
// public static String getInternalAppFilesPath() {
// return Utils.getApp().getFilesDir().getAbsolutePath();
// }
//
// /**
// * Return the path of /data/data/package/databases/name.
// *
// * @param name The name of database.
// * @return the path of /data/data/package/databases/name
// */
// public static String getInternalAppDbPath(String name) {
// return Utils.getApp().getDatabasePath(name).getAbsolutePath();
// }
//
// /**
// * Return the path of /storage/emulated/0.
// *
// * @return the path of /storage/emulated/0
// */
// public static String getExternalStoragePath() {
// return Environment.getExternalStorageDirectory().getAbsolutePath();
// }
//
// /**
// * Return the path of /storage/emulated/0/Alarms.
// *
// * @return the path of /storage/emulated/0/Alarms
// */
// public static String getExternalAlarmsPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_ALARMS)
// .getAbsolutePath();
// }
//
// /**
// * Return the path of /storage/emulated/0/DCIM.
// *
// * @return the path of /storage/emulated/0/DCIM
// */
// public static String getExternalDcimPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
// .getAbsolutePath();
// }
//
// /**
// * Return the path of /storage/emulated/0/Documents.
// *
// * @return the path of /storage/emulated/0/Documents
// */
// @RequiresApi(api = Build.VERSION_CODES.KITKAT)
// public static String getExternalDocumentsPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)
// .getAbsolutePath();
// }
//
// /**
// * Return the path of /storage/emulated/0/Download.
// *
// * @return the path of /storage/emulated/0/Download
// */
// public static String getExtDownloadsPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
// .getAbsolutePath();
// }
//
// /**
// * 获取视频目录
// * <pre>path: /storage/emulated/0/Movies</pre>
// *
// * @return 视频目录
// */
// public static String getExtMoviesPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES)
// .getAbsolutePath();
// }
//
// /**
// * 获取音乐目录
// * <pre>path: /storage/emulated/0/Music</pre>
// *
// * @return 音乐目录
// */
// public static String getExtMusicPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC)
// .getAbsolutePath();
// }
//
// /**
// * 获取提示音目录
// * <pre>path: /storage/emulated/0/Notifications</pre>
// *
// * @return 提示音目录
// */
// public static String getExtNotificationsPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_NOTIFICATIONS)
// .getAbsolutePath();
// }
//
// /**
// * 获取图片目录
// * <pre>path: /storage/emulated/0/Pictures</pre>
// *
// * @return 图片目录
// */
// public static String getExtPicturesPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)
// .getAbsolutePath();
// }
//
// /**
// * 获取 Podcasts 目录
// * <pre>path: /storage/emulated/0/Podcasts</pre>
// *
// * @return Podcasts 目录
// */
// public static String getExtPodcastsPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_PODCASTS)
// .getAbsolutePath();
// }
//
// /**
// * 获取铃声目录
// * <pre>path: /storage/emulated/0/Ringtones</pre>
// *
// * @return 下载目录
// */
// public static String getExtRingtonesPath() {
// return Environment
// .getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的缓存目录
// * <pre>path: /storage/emulated/0/Android/data/package/cache</pre>
// *
// * @return 此应用在外置储存中的缓存目录
// */
// public static String getAppExtCachePath() {
// return Utils.getApp().getExternalCacheDir().getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的文件目录
// * <pre>path: /storage/emulated/0/Android/data/package/files</pre>
// *
// * @return 此应用在外置储存中的文件目录
// */
// public static String getAppExtFilePath() {
// return Utils.getApp().getExternalFilesDir(null).getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的闹钟铃声目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/Alarms</pre>
// *
// * @return 此应用在外置储存中的闹钟铃声目录
// */
// public static String getAppExtAlarmsPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_ALARMS)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的相机目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/DCIM</pre>
// *
// * @return 此应用在外置储存中的相机目录
// */
// public static String getAppExtDcimPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_DCIM)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的文档目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/Documents</pre>
// *
// * @return 此应用在外置储存中的文档目录
// */
// @RequiresApi(api = Build.VERSION_CODES.KITKAT)
// public static String getAppExtDocumentsPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的闹钟目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/Download</pre>
// *
// * @return 此应用在外置储存中的闹钟目录
// */
// public static String getAppExtDownloadPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的视频目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/Movies</pre>
// *
// * @return 此应用在外置储存中的视频目录
// */
// public static String getAppExtMoviesPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_MOVIES)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的音乐目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/Music</pre>
// *
// * @return 此应用在外置储存中的音乐目录
// */
// public static String getAppExtMusicPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_MUSIC)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的提示音目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/Notifications</pre>
// *
// * @return 此应用在外置储存中的提示音目录
// */
// public static String getAppExtNotificationsPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_NOTIFICATIONS)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的图片目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/Pictures</pre>
// *
// * @return 此应用在外置储存中的图片目录
// */
// public static String getAppExtPicturesPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_PICTURES)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的 Podcasts 目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/Podcasts</pre>
// *
// * @return 此应用在外置储存中的 Podcasts 目录
// */
// public static String getAppExtPodcastsPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_PODCASTS)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用在外置储存中的铃声目录
// * <pre>path: /storage/emulated/0/Android/data/package/files/Ringtones</pre>
// *
// * @return 此应用在外置储存中的铃声目录
// */
// public static String getAppExtRingtonesPath() {
// return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_RINGTONES)
// .getAbsolutePath();
// }
//
// /**
// * 获取此应用的 Obb 目录
// * <pre>path: /storage/emulated/0/Android/obb/package</pre>
// * <pre>一般用来存放游戏数据包</pre>
// *
// * @return 此应用的 Obb 目录
// */
// public static String getObbPath() {
// return Utils.getApp().getObbDir().getAbsolutePath();
// }
//}
package com.blankj.utilcode.util;
import android.os.Build;
import android.os.Environment;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2018/04/15
* desc : utils about path
* </pre>
*/
public class PathUtils {
private PathUtils() {
throw new UnsupportedOperationException("u can't instantiate me...");
}
/**
* Return the path of /system.
*
* @return the path of /system
*/
public static String getRootPath() {
return Environment.getRootDirectory().getAbsolutePath();
}
/**
* Return the path of /data.
*
* @return the path of /data
*/
public static String getDataPath() {
return Environment.getDataDirectory().getAbsolutePath();
}
/**
* Return the path of /cache.
*
* @return the path of /cache
*/
public static String getDownloadCachePath() {
return Environment.getDownloadCacheDirectory().getAbsolutePath();
}
/**
* Return the path of /data/data/package.
*
* @return the path of /data/data/package
*/
public static String getInternalAppDataPath() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
return Utils.getApp().getApplicationInfo().dataDir;
}
return Utils.getApp().getDataDir().getAbsolutePath();
}
/**
* Return the path of /data/data/package/code_cache.
*
* @return the path of /data/data/package/code_cache
*/
public static String getInternalAppCodeCacheDir() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
return Utils.getApp().getApplicationInfo().dataDir + "/code_cache";
}
return Utils.getApp().getCodeCacheDir().getAbsolutePath();
}
/**
* Return the path of /data/data/package/cache.
*
* @return the path of /data/data/package/cache
*/
public static String getInternalAppCachePath() {
return Utils.getApp().getCacheDir().getAbsolutePath();
}
/**
* Return the path of /data/data/package/databases.
*
* @return the path of /data/data/package/databases
*/
public static String getInternalAppDbsPath() {
return Utils.getApp().getApplicationInfo().dataDir + "/databases";
}
/**
* Return the path of /data/data/package/databases/name.
*
* @param name The name of database.
* @return the path of /data/data/package/databases/name
*/
public static String getInternalAppDbPath(String name) {
return Utils.getApp().getDatabasePath(name).getAbsolutePath();
}
/**
* Return the path of /data/data/package/files.
*
* @return the path of /data/data/package/files
*/
public static String getInternalAppFilesPath() {
return Utils.getApp().getFilesDir().getAbsolutePath();
}
/**
* Return the path of /data/data/package/shared_prefs.
*
* @return the path of /data/data/package/shared_prefs
*/
public static String getInternalAppSpPath() {
return Utils.getApp().getApplicationInfo().dataDir + "shared_prefs";
}
/**
* Return the path of /data/data/package/no_backup.
*
* @return the path of /data/data/package/no_backup
*/
public static String getInternalAppNoBackupFilesPath() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
return Utils.getApp().getApplicationInfo().dataDir + "no_backup";
}
return Utils.getApp().getNoBackupFilesDir().getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0.
*
* @return the path of /storage/emulated/0
*/
public static String getExternalStoragePath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStorageDirectory().getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Music.
*
* @return the path of /storage/emulated/0/Music
*/
public static String getExternalMusicPath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Podcasts.
*
* @return the path of /storage/emulated/0/Podcasts
*/
public static String getExternalPodcastsPath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PODCASTS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Ringtones.
*
* @return the path of /storage/emulated/0/Ringtones
*/
public static String getExternalRingtonesPath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Alarms.
*
* @return the path of /storage/emulated/0/Alarms
*/
public static String getExternalAlarmsPath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_ALARMS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Notifications.
*
* @return the path of /storage/emulated/0/Notifications
*/
public static String getExternalNotificationsPath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_NOTIFICATIONS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Pictures.
*
* @return the path of /storage/emulated/0/Pictures
*/
public static String getExternalPicturesPath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Movies.
*
* @return the path of /storage/emulated/0/Movies
*/
public static String getExternalMoviesPath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Download.
*
* @return the path of /storage/emulated/0/Download
*/
public static String getExternalDownloadsPath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/DCIM.
*
* @return the path of /storage/emulated/0/DCIM
*/
public static String getExternalDcimPath() {
if (isExternalStorageDisable()) return "";
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Documents.
*
* @return the path of /storage/emulated/0/Documents
*/
public static String getExternalDocumentsPath() {
if (isExternalStorageDisable()) return "";
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
return Environment.getExternalStorageDirectory().getAbsolutePath() + "/Documents";
}
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package.
*
* @return the path of /storage/emulated/0/Android/data/package
*/
public static String getExternalAppDataPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalCacheDir().getParentFile().getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/cache.
*
* @return the path of /storage/emulated/0/Android/data/package/cache
*/
public static String getExternalAppCachePath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalCacheDir().getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files.
*
* @return the path of /storage/emulated/0/Android/data/package/files
*/
public static String getExternalAppFilesPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(null).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/Music.
*
* @return the path of /storage/emulated/0/Android/data/package/files/Music
*/
public static String getExternalAppMusicPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_MUSIC).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/Podcasts.
*
* @return the path of /storage/emulated/0/Android/data/package/files/Podcasts
*/
public static String getExternalAppPodcastsPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_PODCASTS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/Ringtones.
*
* @return the path of /storage/emulated/0/Android/data/package/files/Ringtones
*/
public static String getExternalAppRingtonesPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_RINGTONES).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/Alarms.
*
* @return the path of /storage/emulated/0/Android/data/package/files/Alarms
*/
public static String getExternalAppAlarmsPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_ALARMS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/Notifications.
*
* @return the path of /storage/emulated/0/Android/data/package/files/Notifications
*/
public static String getExternalAppNotificationsPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_NOTIFICATIONS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/Pictures.
*
* @return path of /storage/emulated/0/Android/data/package/files/Pictures
*/
public static String getExternalAppPicturesPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/Movies.
*
* @return the path of /storage/emulated/0/Android/data/package/files/Movies
*/
public static String getExternalAppMoviesPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_MOVIES).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/Download.
*
* @return the path of /storage/emulated/0/Android/data/package/files/Download
*/
public static String getExternalAppDownloadPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/DCIM.
*
* @return the path of /storage/emulated/0/Android/data/package/files/DCIM
*/
public static String getExternalAppDcimPath() {
if (isExternalStorageDisable()) return "";
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_DCIM).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/data/package/files/Documents.
*
* @return the path of /storage/emulated/0/Android/data/package/files/Documents
*/
public static String getExternalAppDocumentsPath() {
if (isExternalStorageDisable()) return "";
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(null).getAbsolutePath() + "/Documents";
}
//noinspection ConstantConditions
return Utils.getApp().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();
}
/**
* Return the path of /storage/emulated/0/Android/obb/package.
*
* @return the path of /storage/emulated/0/Android/obb/package
*/
public static String getExternalAppObbPath() {
if (isExternalStorageDisable()) return "";
return Utils.getApp().getObbDir().getAbsolutePath();
}
private static boolean isExternalStorageDisable() {
return !Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState());
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册