8 | * * RePlugin.registerGlobalBinderDelayed
9 | *
10 | * @author RePlugin Team
11 | */
12 | interface IBinderGetter {
13 |
14 | /**
15 | * 获取IBinder对象
16 | */
17 | IBinder get();
18 | }
19 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/component/service/server/IPluginServiceServer.aidl:
--------------------------------------------------------------------------------
1 | package com.qihoo360.replugin.component.service.server;
2 |
3 | import android.content.ComponentName;
4 | import android.os.Messenger;
5 |
6 | import com.qihoo360.loader2.mgr.IServiceConnection;
7 |
8 | /**
9 | * 负责Server端的服务调度、提供等工作,是服务的提供方,核心类之一
10 | *
11 | * @hide 框架内部使用
12 | * @author RePlugin Team
13 | */
14 | interface IPluginServiceServer {
15 | ComponentName startService(in Intent intent, in Messenger client);
16 | int stopService(in Intent intent, in Messenger client);
17 |
18 | int bindService(in Intent intent, in IServiceConnection conn, int flags, in Messenger client);
19 | boolean unbindService(in IServiceConnection conn);
20 |
21 | String dump();
22 | }
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/model/PluginInfo.aidl:
--------------------------------------------------------------------------------
1 | package com.qihoo360.replugin.model;
2 |
3 | parcelable PluginInfo;
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/packages/PluginRunningList.aidl:
--------------------------------------------------------------------------------
1 | package com.qihoo360.replugin.packages;
2 |
3 | parcelable PluginRunningList;
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/i/IModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.i;
18 |
19 | /**
20 | * 所有可查询的接口都从此interface继承
21 | * 在插件体系中,module是一种略高于interface的概念
22 | * 一个插件可导出一个到多个module,这些module可输出自己业务的各种interface
23 | *
24 | * @author RePlugin Team
25 | *
26 | */
27 | public interface IModule {
28 |
29 | /**
30 | * 万能接口:当不能升级adapter.jar的时候再考虑使用
31 | * @param args
32 | * @return
33 | */
34 | Object invoke(Object...args);
35 | }
36 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/i/IPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.i;
18 |
19 |
20 | /**
21 | * 此接口由插件负责导出
22 | * 表示一个具体的物理上的插件实体,例如barcode.jar
23 | * 具体导出细节可看Factory
24 | *
25 | * @author RePlugin Team
26 | *
27 | */
28 | public interface IPlugin {
29 |
30 | /**
31 | * @param c 需要查询的interface的类
32 | * @return
33 | */
34 | IModule query(Class extends IModule> c);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader/utils/PackageUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.loader.utils;
18 |
19 | import android.content.pm.PackageInfo;
20 | import android.content.pm.PackageManager;
21 |
22 | import com.qihoo360.replugin.helper.LogDebug;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class PackageUtils {
28 |
29 | /**
30 | * 获取PackageInfo对象
31 | *
32 | * 注:getPackageArchiveInfo Android 2.x上,可能拿不到signatures,本可以通过反射去获取,但是考虑到会触发Android 的灰/黑名单,这个方法就不再继续适配2.X了
33 | *
34 | * @return
35 | */
36 | public static PackageInfo getPackageArchiveInfo(PackageManager pm, String pkgFilePath, int flags) {
37 | PackageInfo info = null;
38 | try {
39 | info = pm.getPackageArchiveInfo(pkgFilePath, flags);
40 | } catch (Throwable e) {
41 | if (LogDebug.LOG) {
42 | e.printStackTrace();
43 | }
44 | }
45 |
46 | return info;
47 | }
48 | }
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/ProcessStates.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.loader2;
18 |
19 | /**
20 | * 保存自定义进程中,每个进程里的坑位信息
21 | *
22 | * @author RePlugin Team
23 | */
24 |
25 | class ProcessStates {
26 |
27 | /**
28 | * 保存非默认 TaskAffinity 下,坑位的状态信息。
29 | */
30 | TaskAffinityStates mTaskAffinityStates = new TaskAffinityStates();
31 |
32 | /**
33 | * 保存默认 TaskAffinity 下,坑位的状态信息。
34 | */
35 | LaunchModeStates mLaunchModeStates = new LaunchModeStates();
36 | }
37 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/mobilesafe/api/AppVar.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.mobilesafe.api;
18 |
19 | import android.content.Context;
20 |
21 | /**
22 | * @author RePlugin Team
23 | */
24 | public class AppVar {
25 |
26 | /**
27 | * API模块内部使用,记得初始化
28 | */
29 | public static Context sAppContext;
30 | }
31 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/mobilesafe/loader/s/DummyService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.mobilesafe.loader.s;
18 |
19 | import android.app.Service;
20 | import android.content.Intent;
21 | import android.os.IBinder;
22 |
23 | /**
24 | * @author RePlugin Team
25 | */
26 | public class DummyService extends Service {
27 |
28 | @Override
29 | public IBinder onBind(Intent intent) {
30 | return null;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/mobilesafe/parser/manifest/bean/ComponentBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.mobilesafe.parser.manifest.bean;
18 |
19 | import android.content.IntentFilter;
20 |
21 | import java.util.List;
22 |
23 | /**
24 | * @author RePlugin Team
25 | */
26 | public class ComponentBean {
27 |
28 | public String name;
29 | public List intentFilters;
30 |
31 | @Override
32 | public String toString() {
33 | return String.format("{name:%s, intent-filter.size():%s}", name, intentFilters.size());
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/DefaultRePluginCallbacks.java:
--------------------------------------------------------------------------------
1 | package com.qihoo360.replugin;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * @deprecated Use RePluginCallbacks instead
7 | * @see RePluginCallbacks
8 | * @author RePlugin Team
9 | */
10 |
11 | public class DefaultRePluginCallbacks extends RePluginCallbacks {
12 |
13 | /**
14 | * @deprecated Use RePluginCallbacks instead
15 | * @see RePluginCallbacks#RePluginCallbacks(Context)
16 | */
17 | public DefaultRePluginCallbacks(Context context) {
18 | super(context);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/DefaultRePluginEventCallbacks.java:
--------------------------------------------------------------------------------
1 | package com.qihoo360.replugin;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * @deprecated Use RePluginEventCallbacks instead
7 | * @see RePluginEventCallbacks
8 | * @author RePlugin Team
9 | */
10 |
11 | public class DefaultRePluginEventCallbacks extends RePluginEventCallbacks {
12 |
13 | /**
14 | * @deprecated Use RePluginEventCallbacks instead
15 | * @see RePluginEventCallbacks#RePluginEventCallbacks(Context)
16 | */
17 | public DefaultRePluginEventCallbacks(Context context) {
18 | super(context);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/IHostBinderFetcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin;
18 |
19 | import android.os.IBinder;
20 |
21 | /**
22 | * 用来实现主程序提供IBinder给其他插件
23 | *
26 | * TODO 未来会废弃Factory类,并做些调整
27 | *
28 | * @author RePlugin Team
29 | */
30 | public interface IHostBinderFetcher {
31 |
32 | /**
33 | * 主程序需实现此方法,来返回一个IBinder对象,供插件使用
34 | *
35 | * @param module 模块名
36 | * @return 一个IBinder对象
37 | */
38 | IBinder query(String module);
39 | }
40 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/base/AMSUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.base;
18 |
19 | import android.app.ActivityManager;
20 | import android.content.Context;
21 |
22 | import java.util.List;
23 |
24 | /**
25 | * 和ActivityManagerService快速封装的一些接口
26 | *
27 | * @author RePlugin Team
28 | */
29 |
30 | public class AMSUtils {
31 |
32 | /**
33 | * 无需抛出异常而调用getRunningAppProcesses方法
34 | * @param context context对象
35 | * @return RunningAppProcessInfo列表
36 | */
37 | public static List getRunningAppProcessesNoThrows(Context context) {
38 | try {
39 | ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
40 | return am.getRunningAppProcesses();
41 | } catch (Throwable e) {
42 | // 可能AMS挂了,但最多返回空列表即可。毕竟不是很重要的流程
43 | e.printStackTrace();
44 | }
45 | return null;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/dummy/DummyService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.dummy;
18 |
19 | import android.app.Service;
20 | import android.content.ComponentName;
21 | import android.content.Intent;
22 | import android.os.IBinder;
23 |
24 | /**
25 | * 表示一个“仿造的”Service,启动后什么事情也不做
26 | * 此类可防止系统调用插件时因类找不到而崩溃。请参见 registerHookingClass 的说明
27 | *
28 | * @see com.qihoo360.replugin.RePlugin#registerHookingClass(String, ComponentName, Class)
29 | * @author RePlugin Team
30 | */
31 | public class DummyService extends Service {
32 |
33 | @Override
34 | public void onCreate() {
35 | super.onCreate();
36 | stopSelf();
37 | }
38 |
39 | @Override
40 | public IBinder onBind(Intent intent) {
41 | return null;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderLoader0.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.process;
18 |
19 | /**
20 | * @author RePlugin Team
21 | */
22 | public class ProcessPitProviderLoader0 extends ProcessPitProviderBase {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderLoader1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.process;
18 |
19 | /**
20 | * @author RePlugin Team
21 | */
22 | public class ProcessPitProviderLoader1 extends ProcessPitProviderBase {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderP0.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.process;
18 |
19 | /**
20 | * @author RePlugin Team
21 | */
22 | public class ProcessPitProviderP0 extends ProcessPitProviderBase {
23 | }
24 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderP1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.process;
18 |
19 | /**
20 | * @author RePlugin Team
21 | */
22 | public class ProcessPitProviderP1 extends ProcessPitProviderBase {
23 | }
24 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderP2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.process;
18 |
19 | /**
20 | * @author RePlugin Team
21 | */
22 | public class ProcessPitProviderP2 extends ProcessPitProviderBase {
23 | }
24 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderUI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.process;
18 |
19 | /**
20 | * @author RePlugin Team
21 | */
22 | public class ProcessPitProviderUI extends ProcessPitProviderBase {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderP0.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.provider;
18 |
19 | /**
20 | * ProcessPitProviderLoader0
21 | *
22 | * @author RePlugin Team
23 | */
24 | public class PluginPitProviderP0 extends PluginPitProviderBase {
25 | public static final String AUTHORITY = AUTHORITY_PREFIX + "0";
26 |
27 | public PluginPitProviderP0() {
28 | super(AUTHORITY);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderP1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.provider;
18 |
19 | /**
20 | * ProcessPitProviderLoader1
21 | *
22 | * @author RePlugin Team
23 | */
24 | public class PluginPitProviderP1 extends PluginPitProviderBase {
25 | public static final String AUTHORITY = AUTHORITY_PREFIX + "1";
26 |
27 | public PluginPitProviderP1() {
28 | super(AUTHORITY);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderP2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.provider;
18 |
19 | /**
20 | * ProcessProviderLoader2
21 | *
22 | * @author RePlugin Team
23 | */
24 | public class PluginPitProviderP2 extends PluginPitProviderBase {
25 | public static final String AUTHORITY = AUTHORITY_PREFIX + "2";
26 |
27 | public PluginPitProviderP2() {
28 | super(AUTHORITY);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderPersist.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.provider;
18 |
19 | /**
20 | * @author RePlugin Team
21 | */
22 | public class PluginPitProviderPersist extends PluginPitProviderBase {
23 | public static final String AUTHORITY = AUTHORITY_PREFIX + "PSP";
24 |
25 | public PluginPitProviderPersist() {
26 | super(AUTHORITY);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderUI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.component.provider;
18 |
19 | /**
20 | * @author RePlugin Team
21 | */
22 | public class PluginPitProviderUI extends PluginPitProviderBase {
23 | public static final String AUTHORITY = AUTHORITY_PREFIX + "UIP";
24 |
25 | public PluginPitProviderUI() {
26 | super(AUTHORITY);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/replugin-host-library/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | pluginManagement {
17 | repositories {
18 | google()
19 | mavenCentral()
20 | gradlePluginPortal()
21 | mavenLocal()
22 | maven {
23 | allowInsecureProtocol = true
24 | url "http://maven.geelib.360.cn/nexus/repository/replugin/"}
25 | }
26 | }
27 | dependencyResolutionManagement {
28 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
29 | repositories {
30 | google()
31 | mavenCentral()
32 | mavenLocal()
33 | maven {
34 | allowInsecureProtocol = true
35 | url "http://maven.geelib.360.cn/nexus/repository/replugin/"}
36 | }
37 | }
38 |
39 | rootProject.name = "replugin-host-library"
40 | include ':replugin-host-lib'
41 |
--------------------------------------------------------------------------------
/replugin-plugin-gradle/README.md:
--------------------------------------------------------------------------------
1 | # RePlugin Plugin Gradle
2 |
3 | RePlugin Plugin Gradle是一个Gradle插件,由 **插件** 负责引入。
4 |
5 | 该Gradle插件主要负责在插件的编译期中做一些事情,是“动态编译方案”的主要实现者。此外,开发者可通过修改其属性而做一些自定义的操作。
6 |
7 | 大致包括:
8 |
9 | * 动态修改主要调用代码,改为调用RePlugin Plugin Gradle(如Activity的继承、Provider的重定向等)
10 |
11 | 开发者需要依赖此Gradle插件,以实现对RePlugin的接入。请参见WiKi以了解接入方法。
12 |
13 | 有关RePlugin Host Gradle的详细描述,请访问我们的WiKi,以了解更多的内容。
14 | (文档正在完善,请耐心等待)
--------------------------------------------------------------------------------
/replugin-plugin-gradle/config.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | *
16 | */
17 |
18 | ext {
19 | config = this.&readConfig()
20 | }
21 |
22 | def readConfig() {
23 | Properties configProperties = new Properties()
24 | file('config.properties').withInputStream {
25 | configProperties.load(it)
26 | }
27 | configProperties
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/replugin-plugin-gradle/config.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | # use this file except in compliance with the License. You may obtain a copy of
6 | # the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed To in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | # License for the specific language governing permissions and limitations under
14 | # the License.
15 | #
16 | #
17 |
18 | repoUrl =
19 |
20 | groupId = com.qihoo360.replugin
21 | artifactId = replugin-plugin-gradle
22 |
23 | # --- android config ---
24 | compileSdkVersion = 21
25 | buildToolsVersion = 23.0.3
26 | minSdkVersion = 10
27 | targetSdkVersion = 21
28 |
29 | # --- user info ---
30 | # 注意:1、仅研发一组同事能修改此URL;
31 | # 2、切勿去除,以免误上传到Maven中心库,引发代码泄露危机。
32 | username =
33 | password =
34 |
35 |
--------------------------------------------------------------------------------
/replugin-plugin-gradle/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | # use this file except in compliance with the License. You may obtain a copy of
6 | # the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed To in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | # License for the specific language governing permissions and limitations under
14 | # the License.
15 | #
16 | #
17 |
18 | # Project-wide Gradle settings.
19 |
20 | # IDE (e.g. Android Studio) users:
21 | # Gradle settings configured through the IDE *will override*
22 | # any settings specified in this file.
23 |
24 | # For more details on how to configure your build environment visit
25 | # http://www.gradle.org/docs/current/userguide/build_environment.html
26 |
27 | # Specifies the JVM arguments used for the daemon process.
28 | # The setting is particularly useful for tweaking memory settings.
29 | org.gradle.jvmargs=-Xmx1536m
30 |
31 | # When configured, Gradle will run in incubating parallel mode.
32 | # This option should only be used with decoupled projects. More details, visit
33 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
34 | # org.gradle.parallel=true
35 |
--------------------------------------------------------------------------------
/replugin-plugin-gradle/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-plugin-gradle/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/replugin-plugin-gradle/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | # use this file except in compliance with the License. You may obtain a copy of
6 | # the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed To in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | # License for the specific language governing permissions and limitations under
14 | # the License.
15 | #
16 | #
17 |
18 | #Mon Dec 28 10:00:20 PST 2015
19 | distributionBase=GRADLE_USER_HOME
20 | distributionPath=wrapper/dists
21 | zipStoreBase=GRADLE_USER_HOME
22 | zipStorePath=wrapper/dists
23 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
24 |
--------------------------------------------------------------------------------
/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/BaseInjector.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | *
16 | */
17 |
18 | package com.qihoo360.replugin.gradle.plugin.injector
19 |
20 | import org.gradle.api.Project
21 |
22 | /**
23 | * @author RePlugin Team
24 | */
25 | public abstract class BaseInjector implements IClassInjector {
26 |
27 | protected Project project
28 |
29 | protected String variantDir
30 |
31 | @Override
32 | public Object name() {
33 | return getClass().getSimpleName()
34 | }
35 |
36 | public void setProject(Project project) {
37 | this.project = project;
38 | }
39 |
40 | public void setVariantDir(String variantDir) {
41 | this.variantDir = variantDir;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/IClassInjector.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | *
16 | */
17 |
18 | package com.qihoo360.replugin.gradle.plugin.injector
19 |
20 | import javassist.ClassPool
21 | import org.gradle.api.Project
22 |
23 | /**
24 | * @author RePlugin Team
25 | */
26 | interface IClassInjector {
27 |
28 | /**
29 | * 设置project对象
30 | * @param project
31 | */
32 | void setProject(Project project)
33 |
34 | /**
35 | * 设置variant目录关键串
36 | * @param variantDir
37 | */
38 | void setVariantDir(String variantDir)
39 | /**
40 | * 注入器名称
41 | */
42 | def name()
43 |
44 | /**
45 | * 对 dir 目录中的 Class 进行注入
46 | */
47 | def injectClass(ClassPool pool, String dir, Map config)
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/inner/CommonData.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | *
16 | */
17 |
18 | package com.qihoo360.replugin.gradle.plugin.inner
19 |
20 | /**
21 | * @author RePlugin Team
22 | */
23 | public class CommonData {
24 |
25 | /** 保存类文件名和 class 文件路径的关系 */
26 | def static classAndPath = [:]
27 |
28 | /** App Module 的名称, 如 ':app', 传 '' 时,使用项目根目录为 App Module */
29 | def static String appModule
30 |
31 | def static String appPackage
32 |
33 | /** 执行 LoaderActivity 替换时,不需要替换的 Activity */
34 | def static ignoredActivities = []
35 |
36 | def static putClassAndPath(def className, def classFilePath) {
37 | classAndPath.put(className, classFilePath)
38 | }
39 |
40 | def static getClassPath(def className) {
41 | return classAndPath.get(className)
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/manifest/IManifest.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | *
16 | */
17 |
18 | package com.qihoo360.replugin.gradle.plugin.manifest;
19 |
20 | /**
21 | * @author RePlugin Team
22 | */
23 | public interface IManifest {
24 |
25 | /**
26 | * 获取 AndroidManifest 中声明的所有 Activity
27 | */
28 | List getActivities()
29 |
30 | /**
31 | * 应用程序包名
32 | */
33 | String getPackageName()
34 | }
35 |
--------------------------------------------------------------------------------
/replugin-plugin-gradle/src/main/resources/META-INF/gradle-plugins/replugin-plugin-gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | # use this file except in compliance with the License. You may obtain a copy of
6 | # the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed To in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | # License for the specific language governing permissions and limitations under
14 | # the License.
15 | #
16 | #
17 |
18 | implementation-class=com.qihoo360.replugin.gradle.plugin.ReClassPlugin
--------------------------------------------------------------------------------
/replugin-plugin-library/README.md:
--------------------------------------------------------------------------------
1 | # RePlugin Plugin Library
2 |
3 | RePlugin Plugin Library是一个Java工程,由 **插件** 负责引入。
4 |
5 | 该类主要提供通过“Java反射”来调用主程序中 RePlugin Host Library 的相关接口,并提供“双向通信”的能力。
6 |
7 | 开发者需要依赖此Library,以让您的单品工程变成“插件”。请参见WiKi以了解接入方法。
8 |
9 | 有关RePlugin Plugin Library的详细描述,请访问我们的WiKi,以了解更多的内容。
--------------------------------------------------------------------------------
/replugin-plugin-library/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
18 |
19 | plugins {
20 | id 'com.android.application' version '7.4.2' apply false
21 | id 'maven-publish'
22 | id "com.jfrog.bintray" version "1.+"
23 | }
24 |
25 | configure(allprojects - project(':replugin-plugin-lib')) {
26 | println "applying java plugin to $project"
27 | apply plugin: 'java-library'
28 | }
29 |
30 | java {
31 | sourceCompatibility = JavaVersion.VERSION_1_8
32 | targetCompatibility = JavaVersion.VERSION_1_8
33 | }
34 |
--------------------------------------------------------------------------------
/replugin-plugin-library/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-plugin-library/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/replugin-plugin-library/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | # use this file except in compliance with the License. You may obtain a copy of
6 | # the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed To in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | # License for the specific language governing permissions and limitations under
14 | # the License.
15 | #
16 |
17 | #Wed Aug 31 14:09:54 CST 2016
18 | distributionBase=GRADLE_USER_HOME
19 | distributionPath=wrapper/dists
20 | zipStoreBase=GRADLE_USER_HOME
21 | zipStorePath=wrapper/dists
22 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
23 |
--------------------------------------------------------------------------------
/replugin-plugin-library/replugin-plugin-lib/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in ./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 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 | -repackageclasses 'library'
27 |
28 | -keep class com.qihoo360.replugin.loader.a.** { public *; }
29 | -keep class com.qihoo360.replugin.loader.b.** { public *; }
30 | -keep class com.qihoo360.replugin.loader.p.** { public *; }
31 | -keep class com.qihoo360.replugin.loader.s.** { public *; }
32 | -keep class com.qihoo360.replugin.base.IPC { public *; }
33 | -keep class com.qihoo360.replugin.Entry { *; }
34 | -keep class com.qihoo360.replugin.RePlugin { public *; }
35 | -keep class com.qihoo360.replugin.model.PluginInfo { public *; }
36 |
37 |
--------------------------------------------------------------------------------
/replugin-plugin-library/replugin-plugin-lib/replugin-library-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in ./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 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 | -keep class com.qihoo360.replugin.Entry { *; }
27 |
--------------------------------------------------------------------------------
/replugin-plugin-library/replugin-plugin-lib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/replugin-plugin-library/replugin-plugin-lib/src/main/aidl/com/qihoo360/loader2/IPlugin.aidl:
--------------------------------------------------------------------------------
1 | package com.qihoo360.loader2;
2 |
3 | /**
4 | * @author RePlugin Team
5 | */
6 | interface IPlugin {
7 |
8 | IBinder query(String name);
9 | }
10 |
--------------------------------------------------------------------------------
/replugin-plugin-library/replugin-plugin-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl:
--------------------------------------------------------------------------------
1 | package com.qihoo360.replugin;
2 |
3 | /**
4 | * Binder的获取器,可用于延迟加载IBinder的情况。
5 | *
6 | * 目前用于:
7 | *
8 | * * RePlugin.registerGlobalBinderDelayed
9 | *
10 | * @author RePlugin Team
11 | */
12 | interface IBinderGetter {
13 |
14 | /**
15 | * 获取IBinder对象
16 | */
17 | IBinder get();
18 | }
19 |
--------------------------------------------------------------------------------
/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/i/IPluginManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.i;
18 |
19 |
20 | /**
21 | * 负责插件和插件之间的interface互通,可通过插件Entry得到,也可通过wrapper类Factory直接调用
22 | *
23 | * @author RePlugin Team
24 | */
25 | public interface IPluginManager {
26 |
27 | /**
28 | * 自动分配插件进程
29 | */
30 | int PROCESS_AUTO = Integer.MIN_VALUE;
31 |
32 | /**
33 | * UI进程
34 | */
35 | int PROCESS_UI = -1;
36 |
37 | /**
38 | * 常驻进程
39 | */
40 | int PROCESS_PERSIST = -2;
41 | }
42 |
--------------------------------------------------------------------------------
/replugin-plugin-library/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | pluginManagement {
17 | repositories {
18 | google()
19 | mavenCentral()
20 | gradlePluginPortal()
21 | mavenLocal()
22 | maven {
23 | allowInsecureProtocol = true
24 | url "http://maven.geelib.360.cn/nexus/repository/replugin/"}
25 | }
26 | }
27 | dependencyResolutionManagement {
28 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
29 | repositories {
30 | google()
31 | mavenCentral()
32 | mavenLocal()
33 | maven {
34 | allowInsecureProtocol = true
35 | url "http://maven.geelib.360.cn/nexus/repository/replugin/"}
36 | }
37 | }
38 |
39 | rootProject.name = "replugin-plugin-library"
40 | include ':replugin-plugin-lib'
--------------------------------------------------------------------------------
/replugin-sample-extra/README.md:
--------------------------------------------------------------------------------
1 | # replugin-sample-extra 中是一些更高级的示例
2 |
3 | 其中,replugin-sample-extra/fresco 是对 Fresco 的使用,实现了宿主和插件公用一份Fresco代码。
4 |
5 | FrescoHost是宿主代码,FrescoPlugin是插件代码。
6 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/libs/armeabi/libimagepipeline.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/armeabi/libimagepipeline.so
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/libs/drawee-modified-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/drawee-modified-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/libs/fbcore-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/fbcore-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/libs/fresco-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/fresco-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-base-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-base-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Android\android-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 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/assets/plugins/plugin1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/assets/plugins/plugin1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/facebook/fresco/patch/FrescoPatch.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.facebook.fresco.patch;
18 |
19 | import android.content.Context;
20 |
21 | import com.facebook.drawee.generic.GenericDraweeHierarchyInflater;
22 | import com.facebook.drawee.view.SimpleDraweeView;
23 |
24 | /**
25 | * 为 “自己编译好的fresco drawee 模块(对应drawee-modified-1.7.1.jar)” 设置回调接口
26 | *
27 | * @author RePlugin Team
28 | */
29 | public class FrescoPatch {
30 |
31 | /**
32 | * 初始化
33 | *
34 | * 为SimpleDraweeView设置回调
35 | * 为GenericDraweeHierarchyInflater设置回调
36 | */
37 | public static void initialize(Context context) {
38 | DraweeStyleableCallbackImpl draweeStyleableCallback = new DraweeStyleableCallbackImpl(context);
39 | SimpleDraweeView.setDraweeStyleableCallback(draweeStyleableCallback);
40 | GenericDraweeHierarchyInflater.setDraweeStyleableCallback(draweeStyleableCallback);
41 | }
42 | }
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/HostFrescoActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.fresco.host;
18 |
19 | import android.net.Uri;
20 | import android.os.Bundle;
21 | import android.support.v7.app.AppCompatActivity;
22 |
23 | import com.facebook.drawee.view.SimpleDraweeView;
24 |
25 | /**
26 | * 宿主中使用fresco
27 | *
28 | * @author RePlugin Team
29 | */
30 | public class HostFrescoActivity extends AppCompatActivity {
31 |
32 | private static final String IMAGE_URL = "https://img1.doubanio.com/view/photo/large/public/p2504463708.jpg";
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.activity_host_fresco);
38 |
39 | SimpleDraweeView draweeView = (SimpleDraweeView) findViewById(R.id.image);
40 | draweeView.setImageURI(Uri.parse(IMAGE_URL));
41 | }
42 | }
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_host_fresco.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
21 |
22 |
27 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FrescoHost
3 |
4 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | { p, cfg = "rp-config.gradle" -> if (new File(p, cfg).exists()) apply from: "${p}/${cfg}" else if (p.exists()) call(p.parentFile) }(buildscript.sourceFile.parentFile)
5 | repositories {
6 | mavenLocal()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:2.3.0'
11 | classpath "com.qihoo360.replugin:replugin-host-gradle:${RP_VERSION}"
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | mavenLocal()
20 | jcenter()
21 | }
22 | }
23 |
24 | task clean(type: Delete) {
25 | delete rootProject.buildDir
26 | }
27 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jan 05 17:10:53 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoHost/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/libs/armeabi/libimagepipeline.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/libs/armeabi/libimagepipeline.so
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/libs/drawee-modified-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/libs/drawee-modified-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fbcore-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fbcore-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fresco-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fresco-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-base-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-base-1.7.1.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Android\android-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 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/facebook/fresco/patch/FrescoPatch.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.facebook.fresco.patch;
18 |
19 | import android.content.Context;
20 |
21 | import com.facebook.drawee.generic.GenericDraweeHierarchyInflater;
22 | import com.facebook.drawee.view.SimpleDraweeView;
23 |
24 | /**
25 | * 为 “自己编译好的fresco drawee 模块(对应drawee-modified-1.7.1.jar)” 设置回调接口
26 | *
27 | * @author RePlugin Team
28 | */
29 | public class FrescoPatch {
30 |
31 | /**
32 | * 初始化
33 | *
34 | * 为SimpleDraweeView设置回调
35 | * 为GenericDraweeHierarchyInflater设置回调
36 | */
37 | public static void initialize(Context context) {
38 | DraweeStyleableCallbackImpl draweeStyleableCallback = new DraweeStyleableCallbackImpl(context);
39 | SimpleDraweeView.setDraweeStyleableCallback(draweeStyleableCallback);
40 | GenericDraweeHierarchyInflater.setDraweeStyleableCallback(draweeStyleableCallback);
41 | }
42 | }
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/qihoo360/replugin/fresco/plugin/MainActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.fresco.plugin;
18 |
19 | import android.net.Uri;
20 | import android.os.Bundle;
21 | import android.support.v7.app.AppCompatActivity;
22 |
23 | import com.facebook.drawee.view.SimpleDraweeView;
24 |
25 | /**
26 | * @author RePlugin Team
27 | */
28 | public class MainActivity extends AppCompatActivity {
29 |
30 | private static final String IMAGE_URL = "https://img1.doubanio.com/lpic/s3743777.jpg";
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_main);
36 |
37 | SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(R.id.image);
38 | Uri uri = Uri.parse(IMAGE_URL);
39 | simpleDraweeView.setImageURI(uri);
40 | }
41 | }
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/qihoo360/replugin/fresco/plugin/PluginApp.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.fresco.plugin;
18 |
19 | import android.app.Application;
20 |
21 | import com.facebook.drawee.backends.pipeline.Fresco;
22 | import com.facebook.fresco.patch.FrescoPatch;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class PluginApp extends Application {
28 |
29 | @Override
30 | public void onCreate() {
31 | super.onCreate();
32 |
33 | Fresco.initialize(this);
34 | FrescoPatch.initialize(this);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
24 |
25 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3C3C3B
4 | #000000
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FrescoPlugin
3 |
4 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | { p, cfg = "rp-config.gradle" -> if (new File(p, cfg).exists()) apply from: "${p}/${cfg}" else if (p.exists()) call(p.parentFile) }(buildscript.sourceFile.parentFile)
5 | repositories {
6 | mavenLocal()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:2.3.0'
11 | classpath "com.qihoo360.replugin:replugin-plugin-gradle:${RP_VERSION}"
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | /**
19 | * 作为插件运行,设置为true;作为单独APK运行,设置为false
20 | *
21 | */
22 | project.ext {
23 | isPlugin = true
24 | }
25 |
26 | allprojects {
27 | repositories {
28 | mavenLocal()
29 | jcenter()
30 | }
31 | }
32 |
33 | task clean(type: Delete) {
34 | delete rootProject.buildDir
35 | }
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoPlugin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jan 05 16:45:51 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/replugin-sample-extra/fresco/FrescoPlugin/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/replugin-sample/README.md:
--------------------------------------------------------------------------------
1 | # RePlugin Sample
2 |
3 | RePlugin Sample工程主要为您展现RePlugin插件的主要用法。
4 |
5 | 它并非是“纯粹”的工程,其内部包含了大量可供参考的调用代码,并含有一些测试代码,帮助开发者在接入时能够对RePlugin有所了解。
6 |
7 | 包括下列内容:
8 |
9 | * host → 主程序的Sample
10 | * plugin-demo1 → 插件1Sample,大部分逻辑都在其中(内置插件实例)
11 | * plugin-demo2 → 插件2的Sample,主要是配合插件1而做的工作(内置插件实例)
12 | * plugin-demo3-kotlin → 插件3的Sample,kotlin插件实例(外置插件实例)
13 |
14 | 阅读Sample代码需要和RePlugin的用法相结合。请访问我们的WiKi,以了解更多的内容。
15 |
--------------------------------------------------------------------------------
/replugin-sample/host/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\***\AppData\Local\Android\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 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/assets/external/README:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 |
18 | 外置插件的模拟安装说明:
19 | 1.为演示安装外置插件的过程,此处临时将外置插件放在Host的assets/external/目录下,其实开发者完全可以将待安装的外置插件放到/sdcard、/data等其他目录下(注意存储权限);
20 | 2.其中拷贝assets/external/目录下的××.apk文件到/data/data/packageName/files/目录下的过程类似于外置插件在首次安装时的下载过程;
21 | 3.其中demo3.apk为replugin-sample/plugin/plugin-demo3-kotlin工程所编译生成的安装包文件;
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/assets/external/demo3.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/assets/external/demo3.apk
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/assets/plugins/demo1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/assets/plugins/demo1.jar
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/assets/plugins/demo2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/assets/plugins/demo2.jar
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/assets/plugins/webview.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/assets/plugins/webview.jar
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/layout/activity_plugin_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
16 |
20 |
21 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-hdpi/notification_out.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-hdpi/notification_out.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | #3F51B5
20 | #303F9F
21 | #FF4081
22 |
23 |
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/values/public.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 | RePlugin Sample
19 | Start plugin demo1
20 | Start Kotlin Plugin (demo3)
21 | Start plugin webview
22 | Start plugin demo1(forResult)
23 | Start plugin demo1(Fragment from demo1)
24 | Install or update external plugin
25 |
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/replugin-sample/host/app/src/main/res/xml/fileprovider_path.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/replugin-sample/host/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | buildscript {
17 | { p, cfg = "rp-config.gradle" -> if (new File(p, cfg).exists()) apply from: "${p}/${cfg}" else if (p.exists()) call(p.parentFile) }(buildscript.sourceFile.parentFile)
18 | }
19 | plugins {
20 | id 'com.android.application' version '7.4.2' apply false
21 | id 'com.qihoo360.replugin.replugin-host-gradle' version "${RP_VERSION}" apply false
22 | }
23 |
--------------------------------------------------------------------------------
/replugin-sample/host/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | # use this file except in compliance with the License. You may obtain a copy of
6 | # the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed To in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | # License for the specific language governing permissions and limitations under
14 | # the License.
15 | #
16 |
17 | # Project-wide Gradle settings.
18 |
19 | # IDE (e.g. Android Studio) users:
20 | # Gradle settings configured through the IDE *will override*
21 | # any settings specified in this file.
22 |
23 | # For more details on how to configure your build environment visit
24 | # http://www.gradle.org/docs/current/userguide/build_environment.html
25 |
26 | # Specifies the JVM arguments used for the daemon process.
27 | # The setting is particularly useful for tweaking memory settings.
28 | org.gradle.jvmargs=-Xmx1536m
29 |
30 | # When configured, Gradle will run in incubating parallel mode.
31 | # This option should only be used with decoupled projects. More details, visit
32 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
33 | # org.gradle.parallel=true
34 | android.useAndroidX=true
35 | android.enableJetifier=true
36 | android.injected.testOnly=false
--------------------------------------------------------------------------------
/replugin-sample/host/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/host/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/replugin-sample/host/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jul 05 11:26:00 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
7 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample/plugin/plugin-demo1/README.md
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/case.gradle:
--------------------------------------------------------------------------------
1 |
2 | dependencies {
3 |
4 | if (android.defaultConfig.multiDexEnabled){
5 |
6 | implementation 'com.squareup.okhttp3:okhttp:3.4.1'
7 | implementation 'com.google.code.gson:gson:2.6.2'
8 | implementation 'com.squareup.pagerduty:pagerduty-incidents:2.0.0'
9 | implementation 'com.google.android.gms:play-services:9.6.1'
10 |
11 | }
12 |
13 | }
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\***\AppData\Local\Android\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 | #}
18 |
19 | # ---------------------------------------------
20 | # **不要改动**
21 | # 插件框架、崩溃后台等需要
22 | -repackageclasses 'demo1'
23 | -allowaccessmodification
24 |
25 | -renamesourcefileattribute demo1
26 | -keepattributes SourceFile,LineNumberTable
27 |
28 | # ---------------------------------------------
29 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/aidl/com/qihoo360/replugin/sample/demo2/IDemo2.aidl:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | package com.qihoo360.replugin.sample.demo2;
17 |
18 | /**
19 | * @author RePlugin Team
20 | */
21 | interface IDemo2 {
22 | void hello(String str);
23 | }
24 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/BaseActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.view.View;
22 | import android.widget.Button;
23 | import android.widget.TextView;
24 |
25 | /**
26 | * @author RePlugin Team
27 | */
28 | public abstract class BaseActivity extends Activity {
29 |
30 | TextView name;
31 |
32 | Button btn;
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.simple);
38 | name = (TextView) findViewById(R.id.name);
39 | btn = (Button) findViewById(R.id.btn);
40 | name.setText(title());
41 | btn.setText(btnTxt());
42 | }
43 |
44 | public abstract void jump(View v);
45 |
46 | public abstract String title();
47 |
48 | public abstract String btnTxt();
49 | }
50 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/LibMainActivity.java:
--------------------------------------------------------------------------------
1 | package com.qihoo360.replugin.sample.demo1;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | public class LibMainActivity extends Activity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.lib_activity_main);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/MainApp.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1;
18 |
19 | import android.app.Application;
20 | import android.content.Intent;
21 |
22 | import com.qihoo360.replugin.sample.demo1.service.PluginDemoAppService;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class MainApp extends Application {
28 |
29 | @Override
30 | public void onCreate() {
31 | super.onCreate();
32 |
33 | // 在插件启动时就去开启一个服务,以模拟个别插件的复杂行为
34 | testStartService();
35 | }
36 |
37 | private void testStartService() {
38 | Intent i = new Intent(this, PluginDemoAppService.class);
39 | i.setAction("MyNameIsApp");
40 | startService(i);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/TestItem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1;
18 |
19 | import android.view.View;
20 |
21 | /**
22 | * @author RePlugin Team
23 | */
24 | public class TestItem {
25 |
26 | public String title;
27 |
28 | public View.OnClickListener mClickListener;
29 |
30 | public TestItem(String title, View.OnClickListener listener) {
31 | this.title = title;
32 | this.mClickListener = listener;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/for_result/ForResultActivity.java:
--------------------------------------------------------------------------------
1 | package com.qihoo360.replugin.sample.demo1.activity.for_result;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 |
6 | import com.qihoo360.replugin.loader.a.PluginActivity;
7 |
8 | /**
9 | * @author RePlugin Team
10 | */
11 | public class ForResultActivity extends PluginActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 |
17 | Intent intent = new Intent();
18 | intent.putExtra("data", "data from demo1 plugin, resultCode is 0x012");
19 | setResult(0x012, intent);
20 |
21 | finish();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/intent_filter/IntentFilterDemoActivity1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.intent_filter;
18 |
19 | import android.view.View;
20 |
21 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
22 |
23 | /**
24 | * @author RePlugin Team
25 | */
26 | public class IntentFilterDemoActivity1 extends BaseActivity {
27 |
28 | @Override
29 | public void jump(View v) {
30 |
31 | }
32 |
33 | @Override
34 | public String title() {
35 | return IntentFilterDemoActivity1.class.getSimpleName();
36 | }
37 |
38 | @Override
39 | public String btnTxt() {
40 | return "null";
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/preference/PrefActivity2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.preference;
18 |
19 | import android.content.SharedPreferences;
20 | import android.os.Bundle;
21 | import android.preference.PreferenceActivity;
22 |
23 | import com.qihoo360.replugin.sample.demo1.R;
24 |
25 | /**
26 | * PreferenceActivity 示例2
27 | *
28 | * @author RePlugin Team
29 | */
30 | public class PrefActivity2 extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | addPreferencesFromResource(R.xml.pref_headers);
36 | }
37 |
38 | @Override
39 | public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
40 |
41 | }
42 | }
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/single_instance/TIActivity1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.single_instance;
18 |
19 | import android.view.View;
20 |
21 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
22 |
23 | /**
24 | * @author RePlugin Team
25 | */
26 | public class TIActivity1 extends BaseActivity {
27 |
28 | @Override
29 | public void jump(View v) {
30 | finish();
31 | }
32 |
33 | @Override
34 | public String title() {
35 | return this.getClass().getSimpleName();
36 | }
37 |
38 | @Override
39 | public String btnTxt() {
40 | return "back";
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/single_top/SingleTopActivity1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.single_top;
18 |
19 | import android.content.Intent;
20 | import android.view.View;
21 |
22 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class SingleTopActivity1 extends BaseActivity {
28 |
29 | @Override
30 | public void jump(View v) {
31 | startActivity(new Intent(this, SingleTopActivity1.class));
32 | }
33 |
34 | @Override
35 | public String title() {
36 | return this.getClass().getSimpleName();
37 | }
38 |
39 | @Override
40 | public String btnTxt() {
41 | return "Start Self";
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/standard/StandardActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.standard;
18 |
19 | import android.content.Intent;
20 | import android.view.View;
21 |
22 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
23 | import com.qihoo360.replugin.sample.demo1.activity.single_top.SingleTopActivity1;
24 |
25 | /**
26 | * @author RePlugin Team
27 | */
28 |
29 | public class StandardActivity extends BaseActivity {
30 |
31 | @Override
32 | public void jump(View v) {
33 | startActivity(new Intent(this, SingleTopActivity1.class));
34 | }
35 |
36 | @Override
37 | public String title() {
38 | return this.getClass().getSimpleName();
39 | }
40 |
41 | @Override
42 | public String btnTxt() {
43 | return "Start Single Top";
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity/TAActivity1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity;
18 |
19 | import android.content.Intent;
20 | import android.view.View;
21 |
22 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class TAActivity1 extends BaseActivity {
28 |
29 | @Override
30 | public void jump(View v) {
31 | startActivity(new Intent(this, TAActivity3.class));
32 | }
33 |
34 | @Override
35 | public String title() {
36 | return this.getClass().getSimpleName();
37 | }
38 |
39 | @Override
40 | public String btnTxt() {
41 | return TAActivity3.class.getSimpleName();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity/TAActivity2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity;
18 |
19 | import android.content.Intent;
20 | import android.view.View;
21 |
22 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class TAActivity2 extends BaseActivity {
28 |
29 | @Override
30 | public void jump(View v) {
31 | startActivity(new Intent(this, TAActivity4.class));
32 | }
33 |
34 | @Override
35 | public String title() {
36 | return this.getClass().getSimpleName();
37 | }
38 |
39 | @Override
40 | public String btnTxt() {
41 | return TAActivity4.class.getSimpleName();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity/TAActivity3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity;
18 |
19 | import android.content.Intent;
20 | import android.view.View;
21 |
22 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class TAActivity3 extends BaseActivity {
28 |
29 | @Override
30 | public void jump(View v) {
31 | startActivity(new Intent(this, TAActivity2.class));
32 | }
33 |
34 | @Override
35 | public String title() {
36 | return this.getClass().getSimpleName();
37 | }
38 |
39 | @Override
40 | public String btnTxt() {
41 | return TAActivity2.class.getSimpleName();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity/TAActivity4.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity;
18 |
19 | import android.view.View;
20 |
21 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
22 |
23 | /**
24 | * @author RePlugin Team
25 | */
26 | public class TAActivity4 extends BaseActivity {
27 |
28 | @Override
29 | public void jump(View v) {
30 | }
31 |
32 | @Override
33 | public String title() {
34 | return this.getClass().getSimpleName();
35 | }
36 |
37 | @Override
38 | public String btnTxt() {
39 | return "";
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity;
18 | /**
19 | * 测试 两个 TaskAffinity
20 | * MainActivity : Standard
21 | * TA1Activity : SingleTask + ta_1
22 | * TA2Activity : SingleTask + ta_1
23 | * TA3Activity : SingleTask + ta_2
24 | * TA4Activity : SingleTask + ta_2
25 | *
26 | *
27 | * Path | Stack
28 | * Main --(start)--> TA1 | TA1
29 | * ...................... | Main
30 | *
31 | * TA1 --(start)--> TA3 | TA3
32 | * ........................| TA1
33 | * ........................| Main
34 | *
35 | * TA3 --(start)--> TA2 | Ta1 > TA2
36 | * ........................| TA3
37 | * ........................| Main
38 | *
39 | * TA2 --(start)--> TA4 | TA3 > TA4
40 | * ........................| Ta1 > TA2
41 | * ........................| Main
42 | */
43 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity_2/TA2Activity1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity_2;
18 |
19 | import android.content.Intent;
20 | import android.view.View;
21 |
22 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class TA2Activity1 extends BaseActivity {
28 |
29 | @Override
30 | public void jump(View v) {
31 | startActivity(new Intent(this, TA2Activity2.class));
32 | }
33 |
34 | @Override
35 | public String title() {
36 | return this.getClass().getSimpleName();
37 | }
38 |
39 | @Override
40 | public String btnTxt() {
41 | return TA2Activity2.class.getSimpleName();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity_2/TA2Activity2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity_2;
18 |
19 | import android.content.Intent;
20 | import android.view.View;
21 |
22 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class TA2Activity2 extends BaseActivity {
28 |
29 | @Override
30 | public void jump(View v) {
31 | startActivity(new Intent(this, TA2Activity3.class));
32 | }
33 |
34 | @Override
35 | public String title() {
36 | return this.getClass().getSimpleName();
37 | }
38 |
39 | @Override
40 | public String btnTxt() {
41 | return TA2Activity3.class.getSimpleName();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity_2/TA2Activity3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity_2;
18 |
19 | import android.content.Intent;
20 | import android.view.View;
21 |
22 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class TA2Activity3 extends BaseActivity {
28 |
29 | @Override
30 | public void jump(View v) {
31 | startActivity(new Intent(this, TA2Activity4.class));
32 | }
33 |
34 | @Override
35 | public String title() {
36 | return this.getClass().getSimpleName();
37 | }
38 |
39 | @Override
40 | public String btnTxt() {
41 | return TA2Activity4.class.getSimpleName();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity_2/TA2Activity4.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity_2;
18 |
19 | import android.content.Intent;
20 | import android.view.View;
21 |
22 | import com.qihoo360.replugin.sample.demo1.BaseActivity;
23 |
24 | /**
25 | * @author RePlugin Team
26 | */
27 | public class TA2Activity4 extends BaseActivity {
28 |
29 | @Override
30 | public void jump(View v) {
31 | startActivity(new Intent(this, TA2Activity3.class));
32 | }
33 |
34 | @Override
35 | public String title() {
36 | return this.getClass().getSimpleName();
37 | }
38 |
39 | @Override
40 | public String btnTxt() {
41 | return TA2Activity3.class.getSimpleName();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/activity/task_affinity_2/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005-2017 Qihoo 360 Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed To in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.qihoo360.replugin.sample.demo1.activity.task_affinity_2;
18 | /**
19 | * 测试 两个 TaskAffinity
20 | * MainActivity : Standard
21 | * TA1Activity : SingleTask + ta_3
22 | * TA2Activity : SingleTask + ta_3
23 | * TA3Activity : Standard + ta_3
24 | * TA4Activity : Standard + ta_3
25 | *
26 | *
27 | * Path | Stack
28 | * Main --(start)--> TA1 | TA1
29 | * ...................... | Main
30 | *
31 | * TA1 --(start)--> TA2 | TA1 > TA2
32 | * ........................| Main
33 | *
34 | * TA2 --(start)--> TA3 | Ta1 > TA2 > T3
35 | * ........................| Main
36 | *
37 | * TA3 --(start)--> TA4 | Ta1 > TA2 > T3 > T4
38 | * ........................| Main
39 | *
40 | * TA4 --(start)--> TA3 | Ta1 > TA2 > T3 > T4 > T3
41 | * ........................| Main
42 | */
43 |
--------------------------------------------------------------------------------
/replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/fragment/DemoCodeFragment.java:
--------------------------------------------------------------------------------
1 | package com.qihoo360.replugin.sample.demo1.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 | import android.widget.TextView;
6 |
7 | import com.qihoo360.replugin.sample.demo1.R;
8 |
9 | /**
10 | * 描述类作用
11 | *