Skip to content

Commit

Permalink
新增文本输入、地区选择、日期选择对话框,新增忘记密码、重置密码、设置界面模板、新增ios风格的切换按钮和设置条目栏自定义控件,新增Glid…
Browse files Browse the repository at this point in the history
…e图片加载隔离模块,对混淆规则进行解耦
  • Loading branch information
880634 committed Mar 4, 2019
1 parent f2a0142 commit 436af49
Show file tree
Hide file tree
Showing 178 changed files with 10,477 additions and 1,596 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.iml
*/build
.gradle
/local.properties
/.idea/workspace.xml
Expand Down
Binary file modified AndroidProject.apk
Binary file not shown.
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,40 @@

![](picture/8.png)

![](picture/9.png)

![](picture/10.png)

![](picture/11.png)

![](picture/12.png)

![](picture/13.png)

![](picture/14.png)

![](picture/15.png)

![](picture/16.png)

![](picture/17.png)

![](picture/18.png)

![](picture/19.png)

![](picture/20.png)

![](picture/21.png)

![](picture/22.png)

![](picture/23.png)

![](picture/24.png)

![](picture/25.png)

#### 集成框架

* 权限请求框架:[https://github.com/getActivity/XXPermissions](https://github.com/getActivity/XXPermissions)
Expand Down Expand Up @@ -72,18 +106,26 @@

* 修正 Android 9.0 限制 Http 明文请求的问题

#### 作者的其他开源项目

* 权限框架:[XXPermissions](https://github.com/getActivity/XXPermissions)

* 吐司框架:[ToastUtils](https://github.com/getActivity/ToastUtils)

* 悬浮窗框架:[XToast](https://github.com/getActivity/XToast)

* 标题栏框架:[TitleBar](https://github.com/getActivity/TitleBar)

#### Android技术讨论Q群:78797078

#### 如果您觉得我的开源库帮你节省了大量的开发时间,请扫描下方的二维码随意打赏,要是能打赏个 10.24 :monkey_face:就太:thumbsup:了。您的支持将鼓励我继续创作:octocat:

![](picture/pay_ali.png) ![](picture/pay_wechat.png)

![](picture/pay_bonus.png)

## License

```text
Copyright 2018 Huang Jinqun
Copyright 2018 Huang JinQun
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
1 change: 0 additions & 1 deletion app/.gitignore

This file was deleted.

22 changes: 15 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
// 无痛修改包名:https://www.jianshu.com/p/17327e191d2e
applicationId "com.hjq.demo"
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
Expand Down Expand Up @@ -87,19 +88,21 @@ dependencies {
implementation project(':base')
// 自定义 View
implementation project(':widget')
// 图片加载封装
implementation project(':image')
// 友盟
implementation project(':umeng')
// Dialog
implementation project(':dialog')

// 示例:添加一个 aar 包
// implementation(name: 'password_dialog', ext: 'aar')
// implementation(name: 'library', ext: 'aar')

implementation "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
implementation "com.android.support:design:$rootProject.ext.supportLibraryVersion"
implementation "com.android.support:support-v4:$rootProject.ext.supportLibraryVersion"
implementation "com.android.support:cardview-v7:$rootProject.ext.supportLibraryVersion"
implementation "com.android.support.constraint:constraint-layout:$rootProject.ext.constraintlayoutVersion"
implementation "com.android.support.constraint:constraint-layout:$rootProject.ext.constraintLayoutVersion"

// Dex分包,解决 65k 问题
implementation 'com.android.support:multidex:1.0.3'
Expand All @@ -109,26 +112,31 @@ dependencies {
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'

// 状态栏沉浸:https://github.com/gyf-dev/ImmersionBar
implementation 'com.gyf.immersionbar:immersionbar:2.3.3-beta09'
implementation 'com.gyf.immersionbar:immersionbar:2.3.3'
// 侧滑功能:https://github.com/bingoogolapple/BGASwipeBackLayout-Android
implementation 'cn.bingoogolapple:bga-swipebacklayout:1.2.0'

// 权限请求框架:https://github.com/getActivity/XXPermissions
implementation 'com.hjq:xxpermissions:5.2'
implementation 'com.hjq:xxpermissions:latest.integration'
// 标题栏:https://github.com/getActivity/TitleBar
implementation 'com.hjq:titlebar:5.0'
implementation 'com.hjq:titlebar:latest.integration'
// 吐司工具类:https://github.com/getActivity/ToastUtils
implementation 'com.hjq:toast:5.2'
implementation 'com.hjq:toast:latest.integration'

// 圆形的ImageView:https://github.com/hdodenhof/CircleImageView
implementation 'de.hdodenhof:circleimageview:2.2.0'

// 悬浮窗:https://github.com/getActivity/XToast
// 网络请求:https://github.com/zhou-you/RxEasyHttp
// RxJava: https://github.com/ReactiveX/RxAndroid
// RecyclerView:https://github.com/CymChad/BaseRecyclerViewAdapterHelper
// 工具类集合:https://github.com/Blankj/AndroidUtilCode
// 工具类:https://github.com/Blankj/AndroidUtilCode
// 图片选择:https://github.com/zhihu/Matisse
// 上拉下拉:https://github.com/bingoogolapple/BGARefreshLayout-Android
// 轮播图:https://github.com/bingoogolapple/BGABanner-Android
// 二维码:https://github.com/bingoogolapple/BGAQRCode-Android
// 第三方支付:https://github.com/getActivity/RxPay
// Log 打印:https://github.com/JakeWharton/timber
}

repositories {
Expand Down
181 changes: 9 additions & 172 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,174 +1,24 @@
#指定代码的压缩级别
-optimizationpasses 5

#包明不混合大小写
-dontusemixedcaseclassnames

#不去忽略非公共的库类
-dontskipnonpubliclibraryclasses

#优化 不优化输入的类文件
-dontoptimize

#预校验
-dontpreverify

#混淆时是否记录日志
-verbose

# 混淆时所采用的算法
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

#保护注解
-keepattributes *Annotation*

# 保持哪些类不被混淆
-keep public class * extends android.app.Fragment
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
#如果有引用v4包可以添加下面这行
-keep public class * extends android.support.v4.app.Fragment


#忽略警告
-ignorewarning

#####################记录生成的日志数据,gradle build时在本项目根目录输出################

#apk 包内所有 class 的内部结构
-dump class_files.txt
#未混淆的类和成员
-printseeds seeds.txt
#列出从 apk 中删除的代码
-printusage unused.txt
#混淆前后的映射
-printmapping mapping.txt

#####################记录生成的日志数据,gradle build时 在本项目根目录输出-end################


################混淆保护自己项目的部分代码以及引用的第三方jar包library#########################
# 混淆保护自己项目的部分代码以及引用的第三方jar包
#-libraryjars libs/umeng-analytics-v5.2.4.jar
#-libraryjars libs/alipaysdk.jar
#-libraryjars libs/alipaysecsdk.jar
#-libraryjars libs/alipayutdid.jar
#-libraryjars libs/wup-1.0.0-SNAPSHOT.jar
#-libraryjars libs/weibosdkcore.jar

# 标题栏框架
-keep class com.hjq.bar.** {*;}

#三星应用市场需要添加:sdk-v1.0.0.jar,look-v1.0.1.jar
#-libraryjars libs/sdk-v1.0.0.jar
#-libraryjars libs/look-v1.0.1.jar
# 吐司框架
-keep class com.hjq.toast.** {*;}

#我是以libaray的形式引用了一个图片加载框架,如果不想混淆 keep 掉
-keep class com.nostra13.universalimageloader.** { *; }
# 权限请求框架
-keep class com.hjq.permissions.** {*;}

#友盟
# 友盟
-keep class com.umeng.**{*;}

#支付宝
# 支付宝
-keep class com.alipay.android.app.IAliPay{*;}
-keep class com.alipay.android.app.IAlixPay{*;}
-keep class com.alipay.android.app.IRemoteServiceCallback{*;}
-keep class com.alipay.android.app.lib.ResourceMap{*;}


#信鸽推送
-keep class com.tencent.android.tpush.** {* ;}
-keep class com.tencent.mid.** {* ;}


#自己项目特殊处理代码

#忽略警告
-dontwarn com.veidy.mobile.common.**
#保留一个完整的包
-keep class com.veidy.mobile.common.** {
*;
}

-keep class com.veidy.activity.login.WebLoginActivity{*;}
-keep class com.veidy.activity.UserInfoFragment{*;}
-keep class com.veidy.activity.HomeFragmentActivity{*;}
-keep class com.veidy.activity.CityActivity{*;}
-keep class com.veidy.activity.ClinikActivity{*;}

#如果引用了v4或者v7包
-dontwarn android.support.**

############混淆保护自己项目的部分代码以及引用的第三方jar包library-end##################

-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}

#保持 native 方法不被混淆
-keepclasseswithmembernames class * {
native <methods>;
}

#保持自定义控件类不被混淆
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

#保持自定义控件类不被混淆
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
#保持自定义控件类不被混淆
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}

#保持 Parcelable 不被混淆
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

#保持 Serializable 不被混淆
-keepnames class * implements java.io.Serializable

#保持 Serializable 不被混淆并且enum 类也不被混淆
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient <fields>;
!private <fields>;
!private <methods>;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}

#保持枚举 enum 类不被混淆 如果混淆报错,建议直接使用上面的 -keepclassmembers class * implements java.io.Serializable即可
#-keepclassmembers enum * {
# public static **[] values();
# public static ** valueOf(java.lang.String);
#}

-keepclassmembers class * {
public void *ButtonClicked(android.view.View);
}

#不混淆资源类
-keepclassmembers class **.R$* {
public static <fields>;
}

#避免混淆泛型 如果混淆报错建议关掉
#–keepattributes Signature

#移除log 测试了下没有用还是建议自己定义一个开关控制是否输出日志
#-assumenosideeffects class android.util.Log {
# public static boolean isLoggable(java.lang.String, int);
Expand Down Expand Up @@ -206,19 +56,6 @@
-dontwarn cn.jiguang.**
-keep class cn.jiguang.** { *; }

# support-v7-appcompat
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}
# support-design
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }

########################################################

# 友盟统计
Expand Down
Loading

0 comments on commit 436af49

Please sign in to comment.