Skip to content

Commit acf24c3

Browse files
committed
重命名包名,新增加密相关的单元测试,MD5加密新增文件加密重载。
1 parent 3bdde9e commit acf24c3

21 files changed

+2122
-11
lines changed

README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Android开发人员不得不收集的代码(持续更新中)
22
为方便查找,已进行大致归类,其目录如下所示:
3-
> - [App相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_app.md)[AppUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/AppUtils.java)
3+
> - [App相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_app.md)[AppUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/AppUtils.java)
44
> - 安装指定路径下的Apk *installApp*
55
> - 卸载指定包名的App *uninstallApp*
66
> - 获取当前App信息 *getAppInfo*
@@ -10,25 +10,25 @@
1010
> - 可用来做App信息分享 *shareAppInfo*
1111
> - 判断当前App处于前台还是后台 *isApplicationBackground*
1212
13-
> - [设备相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_device.md)[DeviceUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/DeviceUtils.java)
13+
> - [设备相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_device.md)[DeviceUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/DeviceUtils.java)
1414
> - 获取设备MAC地址 *getMacAddress*
1515
> - 获取设备厂商,如Xiaomi *getManufacturer*
1616
> - 获取设备型号,如MI2SC *getModel*
1717
> - 获取设备SD卡是否可用 *isSDCardEnable*
1818
> - 获取设备SD卡路径 *getSDCardPath*
1919
20-
> - [加解密相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_encrypt.md)[EncryptUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/EncryptUtils.java)
20+
> - [加解密相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_encrypt.md)[EncryptUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/EncryptUtils.java)
2121
> - MD5加密 *getMD5* *encryptMD5* *getMD5File*
2222
> - SHA加密 *getSHA* *encryptSHA*
2323
24-
> - [键盘相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_keyboard.md)[KeyboardUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/KeyboardUtils.java)
24+
> - [键盘相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_keyboard.md)[KeyboardUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/KeyboardUtils.java)
2525
> - 避免输入法面板遮挡
2626
> - 动态隐藏软键盘 *hideSoftInput*
2727
> - 点击屏幕空白区域隐藏软键盘(注释萌萌哒) *clickBlankArea2HideSoftInput0*
2828
> - 动态显示软键盘 *showSoftInput*
2929
> - 切换键盘显示与否状态 *toggleSoftInput*
3030
31-
> - [网络相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_network.md)[NetworkUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/NetworkUtils.java)
31+
> - [网络相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_network.md)[NetworkUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/NetworkUtils.java)
3232
> - 打开网络设置界面 *openWirelessSettings*
3333
> - 判断网络是否可用 *isAvailable*
3434
> - 判断网络是否连接 *isConnected*
@@ -38,7 +38,7 @@
3838
> - 获取移动终端类型 *getPhoneType*
3939
> - 获取当前的网络类型(WIFI,2G,3G,4G) *getNetWorkType* *getNetWorkTypeName*
4040
41-
> - [手机相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_phone.md)[PhoneUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/PhoneUtils.java)
41+
> - [手机相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_phone.md)[PhoneUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/PhoneUtils.java)
4242
> - 判断设备是否是手机 *isPhone*
4343
> - 获取手机的IMIE *getDeviceIMEI*
4444
> - 获取手机状态信息 *getPhoneStatus*
@@ -49,10 +49,10 @@
4949
> - 打开手机联系人界面点击联系人后便获取该号码(注释萌萌哒) *getContantNum*
5050
> - 获取手机短信并保存到xml中 *getAllSMS*
5151
52-
> - [正则相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_regular.md)[RegularUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/RegularUtils.java)
52+
> - [正则相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_regular.md)[RegularUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/RegularUtils.java)
5353
> - 正则工具类
5454
55-
> - [屏幕相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_screen.md)[ScreenUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/ScreenUtils.java)
55+
> - [屏幕相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_screen.md)[ScreenUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/ScreenUtils.java)
5656
> - 获取手机分辨率 *getDeviceWidth**getDeviceHeight*
5757
> - 设置透明状态栏(api >= 19方可使用) *setTransparentStatusBar*
5858
> - 隐藏状态栏(注释萌萌哒) *hideStatusBar*
@@ -63,14 +63,14 @@
6363
> - 获取屏幕截图 *snapShotWithStatusBar**snapShotWithoutStatusBar*
6464
> - 判断是否锁屏 *isScreenLock*
6565
66-
> - [尺寸相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_size.md)[SizeUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/SizeUtils.java)
66+
> - [尺寸相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_size.md)[SizeUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/SizeUtils.java)
6767
> - dp与px转换 *dp2px**px2dp*
6868
> - sp与px转换 *sp2px**px2sp*
6969
> - 各种单位转换 *applyDimension*
7070
> - 在onCreate()即可强行获取View的尺寸 *forceGetViewSize*
7171
> - ListView中提前测量View尺寸(注释萌萌哒) *measureView*
7272
73-
> - [时间相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_time.md)[TimeUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/TimeUtils.java)
73+
> - [时间相关](https://github.com/Blankj/AndroidUtilCode/blob/master/about_time.md)[TimeUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/TimeUtils.java)
7474
> - 将时间戳转为时间字符串 *milliseconds2String*
7575
> - 将时间字符串转为时间戳 *string2Milliseconds*
7676
> - 将时间字符串转为Date类型 *string2Date*
@@ -83,7 +83,7 @@
8383
> - 获取与当前时间的差(单位:unit) *getIntervalByNow*
8484
> - 判断闰年 *isLeapYear*
8585
86-
> - [未归类](https://github.com/Blankj/AndroidUtilCode/blob/master/unclassified.md)[UnclassifiedUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/androidframework/src/main/java/com/blankj/androidframework/utils/UnclassifiedUtils.java)
86+
> - [未归类](https://github.com/Blankj/AndroidUtilCode/blob/master/unclassified.md)[UnclassifiedUtils.java](https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/src/main/java/com/blankj/utils/UnclassifiedUtils.java)
8787
> - 获取服务是否开启 *isRunningService*
8888
> - [更新Log](https://github.com/Blankj/AndroidUtilCode/blob/master/update_log.md)
8989
@@ -102,6 +102,7 @@
102102
#### 2016/08/03 修复在onCreate中获取view尺寸的bug,MD5和SHA的Bug修复完成(在此感谢ssyijiu)
103103
#### 2016/08/04 新增时间工具类(在此感谢yi520000给的补充),手机正则分简单和精确(在此感谢MIkeeJY),新增判断是否锁屏,注释分段落,目录按首字母排序
104104
#### 2016/08/05 加密新增MD5盐加密,完善NetworkUtils,新增判断状态栏是否存在(在此感谢tiandawu)
105+
#### 2016/08/06 重命名包名,新增加密相关的单元测试,MD5加密新增文件加密重载。
105106

106107

107108
##[关于Blankj](http://blankj.com/about)

update_log.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
#### 2016/08/03 修复在onCreate中获取view尺寸的bug,MD5和SHA的Bug修复完成(在此感谢ssyijiu)
1010
#### 2016/08/04 新增时间工具类(在此感谢yi520000给的补充),手机正则分简单和精确(在此感谢MIkeeJY),新增判断是否锁屏,注释分段落,目录按首字母排序
1111
#### 2016/08/05 加密新增MD5盐加密,完善NetworkUtils,新增判断状态栏是否存在(在此感谢tiandawu)
12+
#### 2016/08/06 重命名包名,新增加密相关的单元测试,MD5加密新增文件加密重载。

utilcode/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

utilcode/build.gradle

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.1"
6+
7+
defaultConfig {
8+
minSdkVersion 11
9+
targetSdkVersion 24
10+
versionCode 1
11+
versionName "1.0"
12+
}
13+
buildTypes {
14+
release {
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
}
20+
21+
dependencies {
22+
compile fileTree(dir: 'libs', include: ['*.jar'])
23+
testCompile 'junit:junit:4.12'
24+
compile 'com.android.support:appcompat-v7:24.1.1'
25+
}

utilcode/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in G:\Android_IDE\ADT\sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.blankj.utilcode;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

utilcode/src/main/AndroidManifest.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<manifest package="com.blankj.utilcode"
2+
xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application android:allowBackup="true"
5+
android:label="@string/app_name"
6+
android:supportsRtl="true"
7+
>
8+
9+
</application>
10+
11+
</manifest>

0 commit comments

Comments
 (0)