Skip to content

Commit

Permalink
整理代码,准备内存优化
Browse files Browse the repository at this point in the history
  • Loading branch information
FaceAI committed Apr 16, 2019
1 parent d4461f7 commit 5153993
Show file tree
Hide file tree
Showing 55 changed files with 995 additions and 76 deletions.
283 changes: 283 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.horn.hornggsm"
android:versionCode="31"
android:versionName="1.33.4">

<uses-sdk

/>



<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
tools:replace="android:icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.horn.hornggsm.frmStart"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.horn.hornggsm.MainActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name=".frmFastAdd"
android:label="@string/app_name" >
</activity>
<activity
android:name=".frmFirstAdd"
android:label="@string/app_name" >
</activity>
<activity
android:name=".frmMainControl"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</activity>
<activity
android:name=".frmMainSet"
android:label="@string/app_name" >
</activity>
<activity
android:name=".frmMainMore"
android:label="@string/app_name" >
</activity>
<activity
android:name=".frmMainHostList"
android:label="@string/app_name" >
</activity>
<activity
android:name=".addGsmHost"
android:label="@string/app_name" >
</activity>
<activity
android:name=".editGsmHost"
android:label="@string/app_name" >
</activity>
<activity
android:name=".editGsmHostOne"
android:label="@string/app_name" >
</activity>
<activity
android:name=".gsmHostControl"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSet"
android:label="@string/app_name" >
</activity>
<activity
android:name=".gsmHostLog"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetTel"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetTime"
android:label="@string/app_name" >
</activity>
<activity
android:name=".gsmHostSetRfid"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetRemote"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetZone"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetOther"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetComText"
android:label="@string/app_name" >
</activity>
<activity
android:name=".gsmHostUserAutoBufang"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetLangage"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetDateTime"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetWifi"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostZoneValue"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetDuima"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostSetDuimaA"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustUnspecified|stateHidden" >
</activity>
<activity
android:name=".gsmHostSetYaokongqi"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostsys"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".aboutsoft"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".gsmHostAlarmList"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".doalarminfo"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".frmFast"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".frmFastA"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".frmTest"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.qrcode.testMainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.zxing.activity.CaptureActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" >
</activity>

<service android:name="com.horn.hornggsm.gsmServer"
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE" android:exported="true" >
<intent-filter android:priority="1000" >
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />

<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />


</intent-filter>
</service>

<!-- 系统启动 主动加载 -->
<receiver android:name=".SmsBootReceiver"
android:permission="android.permission.BROADCAST_WAP_PUSH">
<intent-filter>


<action android:name="com.horn.hornggsm.customMsg" >
</action>
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
<data android:mimeType="application/vnd.wap.mms-message" />


<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</receiver>
</application>
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>

<!-- 访问网络 -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- 检查网络 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- 读取sdk -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<!-- 读联系人权限 -->
<uses-permission android:name="android.permission.READ_CONTACTS" />
<!-- 写联系人权限 -->
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<!-- 拨打电话 -->
<uses-permission android:name="android.permission.CALL_PHONE" />
<!-- 获取电话 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- 获取资源包 -->
<uses-permission android:name="android.permission.RESTART_PACKAGES" />
<uses-permission android:name="android.permission.GET_TASKS" />

<!-- 发送短信 -->
<uses-permission android:name="android.permission.SEND_SMS" />
<!-- 截取短信 -->
<!--<uses-permission android:name="android.permission.RECEIVE_SMS" />-->

<!-- 添加系统启动 -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" /> <!-- 震动权限 -->
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.CAMERA" />


<uses-feature android:name="android.hardware.camera" /> <!-- 使用照相机权限 -->
<uses-feature android:name="android.hardware.camera.autofocus" /> <!-- 自动聚焦权限-->

</manifest>
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# 教训:自由的世界也是有规则的



# 关于本Demo-组件化的工程架构With MVP,Dagger2.android,RXjava2

一直在纠结在何种开发模式之中,重构希望能把关注点集中到代码结构、整体架构、可测试性、可维护性这四个方面
Expand Down Expand Up @@ -47,7 +48,7 @@

如果没有[Dagger.android](https://google.github.io/dagger//android.html) 我是不想使用dagger2的。写下面的类似代码实在太多了

我自己翻译的官方的链接https://www.jianshu.com/p/879e0fe4ef36
我自己翻译的关于Dagger Android 的文章https://www.jianshu.com/p/879e0fe4ef36 。刚开始使用会比较难上手

```
public class FrombulationActivity extends Activity {
Expand All @@ -71,20 +72,6 @@
```


# 关于热修复
阿里的HotFix&微信的Tinker
android的热修复原理大体上分为两种,其一是通过dex的执行顺序实现Apk热修复的功能(Tinker),但是其需要将App重启才能生 效;其二是通过Native修改函数指针的方式实现热修复(HotFix)。

显然对于修复紧急BUG这个场景,阿里百川HotFix的更为合适,它更加轻量,可以在不重启的情况下生效,且对性能几乎没有影
微信Tinker、QQ空间超级补丁技术更多地把场景定位在发布小的新功能上,采用ClassLoader的模式,牺牲较高的性能代价去实现 类、资源新增或替换的功能。
阿里百川HotFix对应用本身做到无侵入,无性能损耗。

[2017年6月阿里手淘推出了首个非侵入式移动热更新解决方案——Sophix。
在Android热修复的三大领域:代码修复、资源修复、SO修复方面,以及方案的安全性和易用性方面,Sophix都做到了业界领先,可是要收费](https://mp.weixin.qq.com/s?__biz=MzAxMTI4MTkwNQ==&mid=2650823404&idx=1&sn=c56458a97561f54b893b33a80635d399&chksm=80b78e72b7c00764b26972bd21cd3e4fe5bb075a8d80890340b2a7a0a565779add0757b161e8&mpshare=1&scene=1&srcid=0704C7XraNsOGvDsgN9bCNii&pass_ticket=AZhM9mvZM8BzU28oFsdChz0QSuCBcgFEhhet1%2FD2hXnrM%2FSkdWA5TsZ06l%2F%2Fhbwm#rd)



# 项目中包含的基本的通用模块
- Dagger.android 大大的优化Dagger 在android 中的使用,
- BaseActivity 中Toolbar 的处理
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zenglb/framework/AppComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
*/
public interface AppComponent {

void inject(BaseApplication application);
void inject(BaseApplication application); //

}
Binary file added baselib/AnyLife_Zlb_Keystore
Binary file not shown.
11 changes: 7 additions & 4 deletions baselib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
api "com.android.support:support-annotations:$rootProject.ext.supportLibraryVersion"
api "com.android.support:cardview-v7:$rootProject.ext.supportLibraryVersion"

// api 'com.google.android.gms:play-services-ads:17.1.1'
// api 'com.google.android.gms:play-services-ads:17.1.1' // !!!

api 'com.google.firebase:firebase-ads:17.1.3' //所有的东西都集中到了FireBase

Expand All @@ -91,7 +91,7 @@ dependencies {
api 'com.github.GrenderG:Toasty:1.2.5'
api 'com.google.code.gson:gson:2.8.4'

api 'com.kingja.loadsir:loadsir:1.3.5'
api 'com.kingja.loadsir:loadsir:1.3.6'

api 'pub.devrel:easypermissions:2.0.1' //没有其他的原因,其他的目前多少有BUG 啊

Expand All @@ -110,7 +110,6 @@ dependencies {
//Http Request log
debugImplementation 'com.readystatesoftware.chuck:library:1.1.0'


api 'com.github.florent37:singledateandtimepicker:1.2.2' //高仿IOS 时间选择
api 'de.hdodenhof:circleimageview:2.2.0' //CircleImageView
api 'com.android.support.constraint:constraint-layout:1.1.3'
Expand All @@ -124,7 +123,7 @@ dependencies {
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
api 'com.journeyapps:zxing-android-embedded:3.6.0' //只是为了简单

api 'org.greenrobot:eventbus:3.1.1' //本来不像引用太多第三方,但是目前的通信实在烦人
api 'org.greenrobot:eventbus:3.1.1' //本来不像引用太多第三方,但是目前的通信实在烦人 ------

api project(':component-base')

Expand All @@ -135,5 +134,9 @@ dependencies {
api 'anylife.scrolltextview:ScrollTextviewLib:1.4.2' //滚动字幕


// debugImplementation project(':library') //debug 版本直接引用本地项目
// releaseImplementation '远程库地址' //release 版本引用远程版本用来最终测试发现问题

// implementation fileTree(include: ['*.aar'], dir: 'libs/xxx') //gradle 在编译前就会自动进到 xxx 目录下面,遍历并引用所有 aar 文件

}
2 changes: 1 addition & 1 deletion baselib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!--<uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down
3 changes: 0 additions & 3 deletions baselib/src/main/java/com/zlb/Sp/SPDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
import android.support.annotation.NonNull;
import android.util.Log;


/**
* 存储key-value 数据,支持加密
* SharedPreferencesDao 就是操作SP
* Created by [email protected] on 2016/11/8.
*/

// TODO: 2018/1/12 最好还是和不同的账号分开来,和DAOSession 一样
public class SPDao {
private static final String TAG = SPDao.class.getSimpleName();
private static final String SharedPreferencesName = "AAAAAAA-Vanke";
Expand Down
Loading

0 comments on commit 5153993

Please sign in to comment.