Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f08a037

Browse files
1:keep不可混淆的类;
2:增加主动寻找View的代码样例;
1 parent 1e677de commit f08a037

File tree

18 files changed

+180
-15
lines changed

18 files changed

+180
-15
lines changed

‎lib_common/src/main/java/com/guiying/module/common/base/BaseActionBarActivity.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package com.guiying.module.common.base;
99

1010
import android.os.Bundle;
11+
import android.support.annotation.Keep;
1112
import android.support.annotation.StringRes;
1213
import android.support.v7.app.ActionBar;
1314

@@ -22,6 +23,7 @@
2223
* @version V1.2.0
2324
* @name BaseActionBarActivity
2425
*/
26+
@Keep
2527
public abstract class BaseActionBarActivity extends BaseActivity {
2628

2729
/*默认的ActionBar*/

‎lib_common/src/main/java/com/guiying/module/common/base/BaseActivity.java‎

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

33
import android.os.Bundle;
44
import android.support.annotation.IdRes;
5+
import android.support.annotation.Keep;
56
import android.support.v7.app.ActionBar;
67
import android.support.v7.app.AppCompatActivity;
78
import android.support.v7.widget.Toolbar;
@@ -17,6 +18,7 @@
1718
* @version V1.0.0
1819
* @name BaseActivity
1920
*/
21+
@Keep
2022
public abstract class BaseActivity extends AppCompatActivity {
2123

2224

‎lib_common/src/main/java/com/guiying/module/common/base/BaseApplication.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class BaseApplication extends Application {
2424

2525
private static BaseApplication sInstance;
2626

27-
private List<ApplicationDelegate> mAppDelegateList;
27+
private List<IApplicationDelegate> mAppDelegateList;
2828

2929

3030
public static BaseApplication getIns() {
@@ -37,8 +37,8 @@ public void onCreate() {
3737
sInstance = this;
3838
Logger.init("pattern").logLevel(LogLevel.FULL);
3939
Utils.init(this);
40-
mAppDelegateList = ClassUtils.getObjectsWithInterface(this, ApplicationDelegate.class, ROOT_PACKAGE);
41-
for (ApplicationDelegate delegate : mAppDelegateList) {
40+
mAppDelegateList = ClassUtils.getObjectsWithInterface(this, IApplicationDelegate.class, ROOT_PACKAGE);
41+
for (IApplicationDelegate delegate : mAppDelegateList) {
4242
delegate.onCreate();
4343
}
4444

@@ -47,7 +47,7 @@ public void onCreate() {
4747
@Override
4848
public void onTerminate() {
4949
super.onTerminate();
50-
for (ApplicationDelegate delegate : mAppDelegateList) {
50+
for (IApplicationDelegate delegate : mAppDelegateList) {
5151
delegate.onTerminate();
5252
}
5353
}
@@ -56,15 +56,15 @@ public void onTerminate() {
5656
@Override
5757
public void onLowMemory() {
5858
super.onLowMemory();
59-
for (ApplicationDelegate delegate : mAppDelegateList) {
59+
for (IApplicationDelegate delegate : mAppDelegateList) {
6060
delegate.onLowMemory();
6161
}
6262
}
6363

6464
@Override
6565
public void onTrimMemory(int level) {
6666
super.onTrimMemory(level);
67-
for (ApplicationDelegate delegate : mAppDelegateList) {
67+
for (IApplicationDelegate delegate : mAppDelegateList) {
6868
delegate.onTrimMemory(level);
6969
}
7070
}

‎lib_common/src/main/java/com/guiying/module/common/base/BaseFragment.java‎

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

33
import android.content.Context;
44
import android.support.annotation.IdRes;
5+
import android.support.annotation.Keep;
56
import android.support.v4.app.Fragment;
67

78
import com.guiying.module.common.utils.Utils;
89

10+
/**
11+
* <p>Fragment的基类</p>
12+
*
13+
* @author 张华洋
14+
* @name BaseFragment
15+
*/
16+
@Keep
917
public abstract class BaseFragment extends Fragment {
1018

1119
protected BaseActivity mActivity;

‎lib_common/src/main/java/com/guiying/module/common/base/BasePresenter.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
package com.guiying.module.common.base;
22

3+
import android.support.annotation.Keep;
4+
5+
/**
6+
* <p>Presenter的基类</p>
7+
*
8+
* @author 张华洋
9+
* @name BasePresenter
10+
*/
11+
@Keep
312
public interface BasePresenter {
413

514
void start();

‎lib_common/src/main/java/com/guiying/module/common/base/BaseView.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
package com.guiying.module.common.base;
22

3+
4+
import android.support.annotation.Keep;
5+
6+
/**
7+
* <p>View接口的基类</p>
8+
*
9+
* @author 张华洋
10+
* @name BaseView
11+
*/
12+
@Keep
313
public interface BaseView<T> {
414

515
void setPresenter(T presenter);

‎lib_common/src/main/java/com/guiying/module/common/base/ClassUtils.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.content.pm.ApplicationInfo;
66
import android.content.pm.PackageManager;
77
import android.os.Build;
8+
import android.support.annotation.Keep;
89
import android.util.Log;
910

1011
import com.guiying.module.common.utils.Utils;
@@ -25,6 +26,7 @@
2526
* Copy from galaxy sdk ${com.alibaba.android.galaxy.utils.ClassUtils}
2627
* Scanner, find out class with any conditions, copy from google source code.
2728
*/
29+
@Keep
2830
public class ClassUtils {
2931
private static final String TAG = "ClassUtils";
3032

‎lib_common/src/main/java/com/guiying/module/common/base/ApplicationDelegate.java‎ renamed to ‎lib_common/src/main/java/com/guiying/module/common/base/IApplicationDelegate.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
package com.guiying.module.common.base;
22

3+
import android.support.annotation.Keep;
4+
35
/**
46
* <p>类说明</p>
57
*
68
* @author 张华洋 2017年9月20日 22:23
79
* @version V2.8.3
810
* @name ApplicationDelegate
911
*/
10-
public interface ApplicationDelegate {
12+
@Keep
13+
public interface IApplicationDelegate {
1114

1215
void onCreate();
1316

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.guiying.module.common.base;
2+
3+
4+
import android.support.annotation.Keep;
5+
import android.view.View;
6+
7+
/**
8+
* <p>类说明</p>
9+
*
10+
* @author 张华洋 2018年1月4日 22:10
11+
* @version V2.8.3
12+
* @name IFragmentDelegate
13+
*/
14+
@Keep
15+
public interface IViewDelegate {
16+
17+
BaseFragment getFragment(String name);
18+
19+
View getView(String name);
20+
21+
}

‎lib_common/src/main/java/com/guiying/module/common/base/InfoCallback.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package com.guiying.module.common.base;
22

3+
import android.support.annotation.Keep;
4+
35
/**
46
* <p>数据回调接口</p>
57
*
68
* @author 张华洋 2017年3月22日 13:36
79
* @version V1.2.0
810
* @name InfoCallback
911
*/
12+
@Keep
1013
public interface InfoCallback<T> {
1114

1215
void onSuccess(T info);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /