Although this is a checked exception, it is rarely recoverable. Most 33 | * callers should simply wrap this exception in an unchecked exception and 34 | * rethrow: 35 | *
public JSONArray toJSONObject() { 36 | * try { 37 | * JSONObject result = new JSONObject(); 38 | * ... 39 | * } catch (JSONException e) { 40 | * throw new RuntimeException(e); 41 | * } 42 | * }43 | */ 44 | public class JSONException extends Exception { 45 | 46 | public JSONException(String s) { 47 | super(s); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /openatlasbundler/src/main/java/org/json/package-info.java: -------------------------------------------------------------------------------- 1 | /**OpenAtlasForAndroid Project 2 | 3 | The MIT License (MIT) 4 | Copyright (c) 2015 Bunny Blue 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software 8 | without restriction, including without limitation the rights to use, copy, modify, 9 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies 13 | or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 17 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 18 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | @author BunnyBlue 21 | * **/ 22 | /** 23 | * @author BunnyBlue 24 | * 25 | */ 26 | package org.json; -------------------------------------------------------------------------------- /openatlasbundler/src/main/java/org/xmlpull/v1/XmlPullParserException.java: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ 2 | // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) 3 | 4 | package org.xmlpull.v1; 5 | 6 | /** 7 | * This exception is thrown to signal XML Pull Parser related faults. 8 | * 9 | * @author Aleksander Slominski 10 | */ 11 | public class XmlPullParserException extends Exception { 12 | protected Throwable detail; 13 | protected int row = -1; 14 | protected int column = -1; 15 | 16 | /* public XmlPullParserException() { 17 | }*/ 18 | 19 | public XmlPullParserException(String s) { 20 | super(s); 21 | } 22 | 23 | /* 24 | public XmlPullParserException(String s, Throwable thrwble) { 25 | super(s); 26 | this.detail = thrwble; 27 | } 28 | 29 | public XmlPullParserException(String s, int row, int column) { 30 | super(s); 31 | this.row = row; 32 | this.column = column; 33 | } 34 | */ 35 | 36 | public XmlPullParserException(String msg, XmlPullParser parser, Throwable chain) { 37 | super ((msg == null ? "" : msg+" ") 38 | + (parser == null ? "" : "(position:"+parser.getPositionDescription()+") ") 39 | + (chain == null ? "" : "caused by: "+chain)); 40 | 41 | if (parser != null) { 42 | this.row = parser.getLineNumber(); 43 | this.column = parser.getColumnNumber(); 44 | } 45 | this.detail = chain; 46 | } 47 | 48 | public Throwable getDetail() { return detail; } 49 | // public void setDetail(Throwable cause) { this.detail = cause; } 50 | public int getLineNumber() { return row; } 51 | public int getColumnNumber() { return column; } 52 | 53 | /* 54 | public String getMessage() { 55 | if(detail == null) 56 | return super.getMessage(); 57 | else 58 | return super.getMessage() + "; nested exception is: \n\t" 59 | + detail.getMessage(); 60 | } 61 | */ 62 | 63 | //NOTE: code that prints this and detail is difficult in J2ME 64 | public void printStackTrace() { 65 | if (detail == null) { 66 | super.printStackTrace(); 67 | } else { 68 | synchronized(System.err) { 69 | System.err.println(super.getMessage() + "; nested exception is:"); 70 | detail.printStackTrace(); 71 | } 72 | } 73 | } 74 | 75 | } 76 | 77 | -------------------------------------------------------------------------------- /openatlascore/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /openatlascore/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "23.0.0 rc3" 6 | 7 | defaultConfig { 8 | minSdkVersion 14 9 | targetSdkVersion 22 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | compile 'com.android.support:appcompat-v7:22.2.1' 24 | } 25 | -------------------------------------------------------------------------------- /openatlascore/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:\adt-bundle-windows-x64-20140702\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 | -------------------------------------------------------------------------------- /openatlascore/src/androidTest/java/zafu/edu/cn/openatlascore/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package zafu.edu.cn.openatlascore; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 6 | * and associated documentation files (the "Software"), to deal in the Software 7 | * without restriction, including without limitation the rights to use, copy, modify, 8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies 12 | * or substantial portions of the Software. 13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | * 20 | * @author BunnyBlue 21 | **/ 22 | package com.openatlas.android.compat; 23 | 24 | public interface ActivityCompatJellyBean { 25 | boolean isDestroyed(); 26 | } 27 | -------------------------------------------------------------------------------- /openatlascore/src/main/java/com/openatlas/android/compat/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAtlasForAndroid Project 3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies 4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 6 | * and associated documentation files (the "Software"), to deal in the Software 7 | * without restriction, including without limitation the rights to use, copy, modify, 8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies 12 | * or substantial portions of the Software. 13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | * 20 | * @author BunnyBlue 21 | * @author BunnyBlue 22 | */ 23 | /** 24 | * @author BunnyBlue 25 | * 26 | */ 27 | package com.openatlas.android.compat; -------------------------------------------------------------------------------- /openatlascore/src/main/java/com/openatlas/android/initializer/InstallSolutionConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAtlasForAndroid Project 3 | *
4 | * The MIT License (MIT) 5 | * Copyright (c) 2015 Bunny Blue 6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 8 | * and associated documentation files (the "Software"), to deal in the Software 9 | * without restriction, including without limitation the rights to use, copy, modify, 10 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | *
13 | * The above copyright notice and this permission notice shall be included in all copies 14 | * or substantial portions of the Software. 15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
17 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
18 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
19 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 | *
22 | * @author BunnyBlue
23 | * @author BunnyBlue
24 | */
25 | /**
26 | * @author BunnyBlue
27 | */
28 | package com.openatlas.android.initializer;
29 |
30 | /***插件安装配置文件
31 | * plugin install rule config
32 | * ****/
33 | public class InstallSolutionConfig {
34 | /*****default config ,only install auto start plugin
缺省配置,只安装随机启动的apk,其余的用到的事后加载******/
35 | public static final boolean install_when_findclass = true;
36 | public static boolean install_when_oncreate = true;
37 | public static final boolean install_when_onreceive = false;
38 | public static final boolean install_when_oncreate_auto = false;
39 |
40 | }
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/android/initializer/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | *
4 | * The MIT License (MIT) 5 | * Copyright (c) 2015 Bunny Blue 6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 8 | * and associated documentation files (the "Software"), to deal in the Software 9 | * without restriction, including without limitation the rights to use, copy, modify, 10 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | *
13 | * The above copyright notice and this permission notice shall be included in all copies 14 | * or substantial portions of the Software. 15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 17 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 18 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 19 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * @author BunnyBlue 23 | * @author BunnyBlue 24 | */ 25 | /** 26 | * @author BunnyBlue 27 | * 28 | */ 29 | package com.openatlas.android.initializer; -------------------------------------------------------------------------------- /openatlascore/src/main/java/com/openatlas/android/lifecycle/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAtlasForAndroid Project 3 | *
4 | * The MIT License (MIT) 5 | * Copyright (c) 2015 Bunny Blue 6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 8 | * and associated documentation files (the "Software"), to deal in the Software 9 | * without restriction, including without limitation the rights to use, copy, modify, 10 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | *
13 | * The above copyright notice and this permission notice shall be included in all copies 14 | * or substantial portions of the Software. 15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 17 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 18 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 19 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * @author BunnyBlue 23 | * @author BunnyBlue 24 | */ 25 | /** 26 | * @author BunnyBlue 27 | * 28 | */ 29 | package com.openatlas.android.lifecycle; -------------------------------------------------------------------------------- /openatlascore/src/main/java/com/openatlas/android/task/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAtlasForAndroid Project 3 | *
4 | * The MIT License (MIT) 5 | * Copyright (c) 2015 Bunny Blue 6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 8 | * and associated documentation files (the "Software"), to deal in the Software 9 | * without restriction, including without limitation the rights to use, copy, modify, 10 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | *
13 | * The above copyright notice and this permission notice shall be included in all copies 14 | * or substantial portions of the Software. 15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 17 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 18 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 19 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * @author BunnyBlue 23 | * @author BunnyBlue 24 | */ 25 | /** 26 | * @author BunnyBlue 27 | * 28 | */ 29 | package com.openatlas.android.task; -------------------------------------------------------------------------------- /openatlascore/src/main/java/com/openatlas/boot/PlatformConfigure.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAtlasForAndroid Project 3 | *
4 | * The MIT License (MIT) 5 | * Copyright (c) 2015 Bunny Blue 6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 8 | * and associated documentation files (the "Software"), to deal in the Software 9 | * without restriction, including without limitation the rights to use, copy, modify, 10 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | *
13 | * The above copyright notice and this permission notice shall be included in all copies 14 | * or substantial portions of the Software. 15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 17 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 18 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 19 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * @author BunnyBlue 23 | **/ 24 | package com.openatlas.boot; 25 | 26 | 27 | /** 28 | * App Platform configuration 29 | * @author BunnyBlue 30 | * 31 | */ 32 | public class PlatformConfigure { 33 | /****闪屏activity****/ 34 | public static final String BOOT_ACTIVITY = "com.openAtlas.welcome.Welcome"; 35 | public static final String BOOT_ACTIVITY_DEFAULT = "com.openAtlas.launcher.welcome"; 36 | public static final String ACTION_BROADCAST_BUNDLES_INSTALLED = "com.openAtlas.action.BUNDLES_INSTALLED"; 37 | public static final String ATLAS_APP_DIRECTORY = "com.openAtlas.AppDirectory"; 38 | public static final String INSTALL_LOACTION = "com.openAtlas.storage"; 39 | public static final String COM_OPENATLAS_DEBUG_BUNDLES = "com.openAtlas.debug.bundles"; 40 | public static final String OPENATLAS_PUBLIC_KEY = "om.openAtlas.publickey"; 41 | public static final String OPENATLAS_BASEDIR = "com.openAtlas.basedir"; 42 | public static final String OPENATLAS_BUNDLE_LOCATION = "com.openAtlas.jars"; 43 | public static final String OPENATLAS_CLASSLOADER_BUFFER_SIZE = "com.openAtlas.classloader.buffersize"; 44 | public static final String OPENATLAS_LOG_LEVEL = "com.openAtlas.log.level"; 45 | public static final String OPENATLAS_DEBUG_BUNDLES = "com.openAtlas.debug.bundles"; 46 | public static final String OPENATLAS_DEBUG_PACKAGES = "com.openAtlas.debug.packages"; 47 | public static final String OPENATLAS_DEBUG_SERVICES = "com.openAtlas.debug.services"; 48 | public static final String OPENATLAS_DEBUG_CLASSLOADING = "com.openAtlas.debug.classloading"; 49 | public static final String OPENATLAS_DEBUG = "com.openAtlas.debug"; 50 | public static final String OPENATLAS_FRAMEWORK_PACKAGE = "com.openAtlas.framework"; 51 | 52 | public static final String OPENATLAS_STRICT_STARTUP = "com.openAtlas.strictStartup"; 53 | public static final String OPENATLAS_AUTO_LOAD = "com.openAtlas.auto.load"; 54 | public static Class> BundleNotFoundActivity = null; 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /openatlascore/src/main/java/com/openatlas/boot/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAtlasForAndroid Project 3 | *
4 | * The MIT License (MIT) 5 | * Copyright (c) 2015 Bunny Blue 6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 8 | * and associated documentation files (the "Software"), to deal in the Software 9 | * without restriction, including without limitation the rights to use, copy, modify, 10 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | *
13 | * The above copyright notice and this permission notice shall be included in all copies 14 | * or substantial portions of the Software. 15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 17 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 18 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 19 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * @author BunnyBlue 23 | * @author BunnyBlue 24 | */ 25 | /** 26 | * @author BunnyBlue 27 | * 28 | */ 29 | package com.openatlas.boot; -------------------------------------------------------------------------------- /openatlascore/src/main/java/com/openatlas/dexopt/InitExecutor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAtlasForAndroid Project 3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies 4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 6 | * and associated documentation files (the "Software"), to deal in the Software 7 | * without restriction, including without limitation the rights to use, copy, modify, 8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies 12 | * or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | * 20 | * @author BunnyBlue 21 | **/ 22 | package com.openatlas.dexopt; 23 | 24 | import android.os.Build; 25 | 26 | import com.openatlas.framework.AtlasConfig; 27 | import com.openatlas.log.Logger; 28 | import com.openatlas.log.LoggerFactory; 29 | 30 | import java.util.HashMap; 31 | import java.util.Map; 32 | 33 | public class InitExecutor { 34 | static final Logger log; 35 | private static boolean sDexOptLoaded; 36 | static boolean isART = false; 37 | private static Map4 | * The MIT License (MIT) 5 | * Copyright (c) 2015 Bunny Blue 6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 8 | * and associated documentation files (the "Software"), to deal in the Software 9 | * without restriction, including without limitation the rights to use, copy, modify, 10 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | *
13 | * The above copyright notice and this permission notice shall be included in all copies 14 | * or substantial portions of the Software. 15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 17 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 18 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 19 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * @author BunnyBlue 23 | **/ 24 | package com.openatlas.framework; 25 | 26 | /** 27 | * @author BunnyBlue 28 | * 29 | */ 30 | public class AtlasConfig { 31 | /***延时启动配*****/ 32 | public static String[] DELAY = new String[]{}; 33 | public static String[] AUTO = new String[]{}; 34 | public static String[] STORE = new String[]{}; 35 | 36 | /**plugin preload dir ******/ 37 | public static String PRELOAD_DIR = "armeabi"; 38 | /**enable opt dex on ART ****/ 39 | public static boolean optART=true; 40 | /********disable compile code****/ 41 | public static final boolean CODE_Deprecated=true; 42 | } 43 | -------------------------------------------------------------------------------- /openatlascore/src/main/java/com/openatlas/framework/bundlestorage/Archive.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAtlasForAndroid Project 3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies 4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 6 | * and associated documentation files (the "Software"), to deal in the Software 7 | * without restriction, including without limitation the rights to use, copy, modify, 8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies 12 | * or substantial portions of the Software. 13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.framework.bundlestorage;
23 |
24 | import java.io.File;
25 | import java.io.IOException;
26 | import java.io.InputStream;
27 | import java.net.URL;
28 | import java.util.List;
29 | import java.util.jar.Manifest;
30 |
31 | public interface Archive {
32 | void close();
33 |
34 | Class> findClass(String clazz, ClassLoader classLoader)
35 | throws ClassNotFoundException;
36 |
37 | File findLibrary(String name);
38 |
39 | File getArchiveFile();
40 |
41 | BundleArchiveRevision getCurrentRevision();
42 |
43 | Manifest getManifest() throws IOException;
44 |
45 | List
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.hack;
23 |
24 | import java.lang.reflect.InvocationHandler;
25 | import java.lang.reflect.InvocationTargetException;
26 | import java.lang.reflect.Method;
27 | import java.lang.reflect.Proxy;
28 |
29 | public class Interception {
30 |
31 | private interface Intercepted {
32 | }
33 |
34 | public static abstract class InterceptionHandler
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.log;
23 |
24 | import android.util.Log;
25 |
26 | public class AndroidLogger implements Logger {
27 | private final String category;
28 |
29 | public AndroidLogger(String str) {
30 | this.category = str;
31 | }
32 |
33 | public AndroidLogger(Class> cls) {
34 | this(cls.getSimpleName());
35 | }
36 |
37 | @Override
38 | public void verbose(String str) {
39 | Log.v(category, str);
40 | }
41 |
42 | @Override
43 | public void debug(String str) {
44 | Log.d(category, str);
45 | }
46 |
47 | @Override
48 | public void info(String str) {
49 | Log.i(category, str);
50 | }
51 |
52 | @Override
53 | public void warn(String str) {
54 | Log.w(category, str);
55 | }
56 |
57 | @Override
58 | public void warn(String str, Throwable th) {
59 | Log.w(str, th);
60 | }
61 |
62 | @Override
63 | public void warn(StringBuffer stringBuffer, Throwable th) {
64 | warn(stringBuffer.toString(), th);
65 | }
66 |
67 | @Override
68 | public void error(String str) {
69 | Log.e(this.category, str);
70 | }
71 |
72 | @Override
73 | public void error(String str, Throwable th) {
74 | Log.e(this.category, str, th);
75 | }
76 |
77 | @Override
78 | public void error(StringBuffer stringBuffer, Throwable th) {
79 | error(stringBuffer.toString(), th);
80 | }
81 |
82 | @Override
83 | public void fatal(String str) {
84 | error(str);
85 | }
86 |
87 | @Override
88 | public void fatal(String str, Throwable th) {
89 | error(str, th);
90 | }
91 |
92 | @Override
93 | public boolean isVerboseEnabled() {
94 | return LoggerFactory.logLevel <= 2;
95 | }
96 |
97 | @Override
98 | public boolean isDebugEnabled() {
99 | return LoggerFactory.logLevel <= 3;
100 | }
101 |
102 | @Override
103 | public boolean isInfoEnabled() {
104 | return LoggerFactory.logLevel <= 4;
105 | }
106 |
107 | @Override
108 | public boolean isWarnEnabled() {
109 | return LoggerFactory.logLevel <= 5;
110 | }
111 |
112 | @Override
113 | public boolean isErrorEnabled() {
114 | return LoggerFactory.logLevel <= 6;
115 | }
116 |
117 | @Override
118 | public boolean isFatalEnabled() {
119 | return LoggerFactory.logLevel <= 6;
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/log/ILog.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | *
4 | * The MIT License (MIT)
5 | * Copyright (c) 2015 Bunny Blue
6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
8 | * and associated documentation files (the "Software"), to deal in the Software
9 | * without restriction, including without limitation the rights to use, copy, modify,
10 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
11 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all copies
14 | * or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
17 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
18 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
19 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 | *
22 | * @author BunnyBlue
23 | **/
24 | package com.openatlas.log;
25 |
26 | /**
27 | * @author BunnyBlue
28 | *
29 | */
30 |
31 |
32 | public interface ILog {
33 | void d(String tag, String msg);
34 |
35 | void e(String tag, String msg);
36 |
37 | void e(String tag, String msg, Throwable th);
38 |
39 | void i(String tag, String msg);
40 |
41 | void v(String tag, String msg);
42 |
43 | void w(String tag, String msg);
44 | }
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/log/IMonitor.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.log;
23 |
24 | public interface IMonitor {
25 | void trace(Integer monitorType, String bundleName, String voidTag, String info);
26 |
27 | void trace(String monitorType, String bundleName, String voidTag, String info);
28 | }
29 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/log/Logger.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.log;
23 |
24 | public interface Logger {
25 | void debug(String str);
26 |
27 | void error(String str);
28 |
29 | void error(String str, Throwable th);
30 |
31 | void error(StringBuffer stringBuffer, Throwable th);
32 |
33 | void fatal(String str);
34 |
35 | void fatal(String str, Throwable th);
36 |
37 | void info(String str);
38 |
39 | boolean isDebugEnabled();
40 |
41 | boolean isErrorEnabled();
42 |
43 | boolean isFatalEnabled();
44 |
45 | boolean isInfoEnabled();
46 |
47 | boolean isVerboseEnabled();
48 |
49 | boolean isWarnEnabled();
50 |
51 | void verbose(String str);
52 |
53 | void warn(String str);
54 |
55 | void warn(String str, Throwable th);
56 |
57 | void warn(StringBuffer stringBuffer, Throwable th);
58 | }
59 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/log/LoggerFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.log;
23 |
24 | public class LoggerFactory {
25 | public static int logLevel;
26 |
27 | static {
28 | logLevel = 1;
29 | }
30 |
31 | public static Logger getInstance(String str) {
32 | return getInstance(str, null);
33 | }
34 |
35 | public static Logger getInstance(Class> cls) {
36 | return getInstance(null, cls);
37 | }
38 |
39 | private static Logger getInstance(String str, Class> cls) {
40 | if (cls != null) {
41 | return new AndroidLogger(cls);
42 | }
43 | return new AndroidLogger(str);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/log/OpenAtlasLog.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | *
4 | * The MIT License (MIT)
5 | * Copyright (c) 2015 Bunny Blue
6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
8 | * and associated documentation files (the "Software"), to deal in the Software
9 | * without restriction, including without limitation the rights to use, copy, modify,
10 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
11 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all copies
14 | * or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
17 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
18 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
19 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 | *
22 | * @author BunnyBlue
23 | **/
24 | package com.openatlas.log;
25 |
26 | /**
27 | * @author BunnyBlue
28 | *
29 | */
30 |
31 |
32 | import android.util.Log;
33 |
34 | public class OpenAtlasLog {
35 | private static ILog externalLogger;
36 |
37 | public static void setExternalLogger(ILog iLog) {
38 | externalLogger = iLog;
39 | }
40 |
41 | public static void v(String tag, String msg) {
42 | if (externalLogger != null) {
43 | externalLogger.v(tag, msg);
44 | }
45 | }
46 |
47 | public static void i(String tag, String msg) {
48 | if (externalLogger != null) {
49 | externalLogger.i(tag, msg);
50 | }
51 | }
52 |
53 | public static void d(String tag, String msg) {
54 | if (externalLogger != null) {
55 | externalLogger.d(tag, msg);
56 | }
57 | }
58 |
59 | public static void w(String tag, String msg) {
60 | if (externalLogger != null) {
61 | externalLogger.w(tag, msg);
62 | }
63 | }
64 |
65 | public static void e(String tag, String msg) {
66 | if (externalLogger != null) {
67 | externalLogger.e(tag, msg);
68 | } else {
69 | Log.e(tag, msg);
70 | }
71 | }
72 |
73 | public static void e(String tag, String msg, Throwable th) {
74 | if (externalLogger != null) {
75 | externalLogger.e(tag, msg, th);
76 | } else {
77 | Log.e(tag, msg, th);
78 | }
79 | }
80 | }
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/log/OpenAtlasMonitor.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.log;
23 |
24 |
25 | import java.io.PrintWriter;
26 | import java.io.StringWriter;
27 | import java.io.Writer;
28 | import java.util.HashMap;
29 | import java.util.Map;
30 |
31 | public class OpenAtlasMonitor implements IMonitor {
32 | public static final int BUNDLE_INSTALL_FAIL = -1;
33 | public static final int DELETE_STORAGE_FAIL = -2;
34 | public static final int RESOURCES_FAIL = -4;
35 | public static final int WRITE_META_FAIL = -3;
36 | private static IMonitor externalMonitor;
37 | private static OpenAtlasMonitor singleton;
38 |
39 | public static OpenAtlasMonitor getInstance() {
40 |
41 | if (singleton == null) {
42 | singleton = new OpenAtlasMonitor();
43 | }
44 | return singleton;
45 | }
46 |
47 | public static void setExternalMonitor(IMonitor iMonitor) {
48 |
49 | externalMonitor = iMonitor;
50 | }
51 |
52 |
53 | public void trace(String monitorType, String bundleName, String voidTag, String info, Throwable th) {
54 | if (th != null) {
55 | Writer stringWriter = new StringWriter();
56 | th.printStackTrace(new PrintWriter(stringWriter));
57 | String stringWriter2 = stringWriter.toString();
58 | Map hashMap = new HashMap();
59 | hashMap.put("errorStr", stringWriter2);
60 | trace(monitorType, bundleName, voidTag, info + " " + hashMap.toString());
61 | return;
62 | }
63 | trace(monitorType, bundleName, voidTag, info);
64 | }
65 |
66 | public void trace(Integer monitorType, String bundleName, String voidTag, String info, Throwable th) {
67 |
68 | trace(monitorType.toString(), bundleName, voidTag, info, th);
69 | }
70 |
71 | @Override
72 | public void trace(String monitorType, String bundleName, String voidTag, String info) {
73 |
74 | if (externalMonitor != null) {
75 | externalMonitor.trace(monitorType, bundleName, voidTag, info);
76 | }
77 | }
78 |
79 | @Override
80 | public void trace(Integer monitorType, String bundleName, String voidTag, String info) {
81 |
82 | if (externalMonitor != null) {
83 | externalMonitor.trace(monitorType, bundleName, voidTag, info);
84 | }
85 | }
86 | }
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/runtime/ClassNotFoundInterceptorCallback.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.runtime;
23 |
24 | import android.content.Intent;
25 |
26 | public interface ClassNotFoundInterceptorCallback {
27 | Intent returnIntent(Intent intent);
28 | }
29 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/runtime/DelegateClassLoader.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.runtime;
23 |
24 | import com.openatlas.framework.Framework;
25 |
26 | import org.osgi.framework.Bundle;
27 |
28 | import java.util.List;
29 |
30 | public class DelegateClassLoader extends ClassLoader {
31 | public DelegateClassLoader(ClassLoader classLoader) {
32 | super(classLoader);
33 | }
34 |
35 | @Override
36 | public Class> loadClass(String className) throws ClassNotFoundException {
37 | return super.loadClass(className);
38 | }
39 |
40 | @Override
41 | protected Class> findClass(String className) throws ClassNotFoundException {
42 | ClassLoadFromBundle.checkInstallBundleIfNeed(className);
43 | Class> loadFromInstalledBundles = ClassLoadFromBundle.loadFromInstalledBundles(className);
44 | if (loadFromInstalledBundles != null) {
45 | return loadFromInstalledBundles;
46 | }
47 | throw new ClassNotFoundException("Can't find class " + className + printExceptionInfo() + " " + ClassLoadFromBundle.getClassNotFoundReason(className));
48 | }
49 |
50 |
51 | private String printExceptionInfo() {
52 | StringBuilder stringBuilder = new StringBuilder("installed bundles: ");
53 | List
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.runtime;
23 |
24 | import android.app.Application;
25 |
26 | import com.openatlas.log.Logger;
27 | import com.openatlas.log.LoggerFactory;
28 |
29 | import java.util.HashMap;
30 | import java.util.Map;
31 | import java.util.Map.Entry;
32 | import java.util.concurrent.ConcurrentHashMap;
33 |
34 | /***Component Delegate,Bundle Component Manger*******/
35 | public class DelegateComponent {
36 | static Map
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.runtime;
23 |
24 | import android.app.Application;
25 | import android.content.res.Resources;
26 |
27 | public class RuntimeVariables {
28 | public static Application androidApplication;
29 | public static DelegateClassLoader delegateClassLoader;
30 | public static Resources delegateResources;
31 |
32 | // public static Resources getDelegateResources() {
33 | // return delegateResources;
34 | // }
35 | //
36 | // public static void setDelegateResources(Resources delegateResources) {
37 | //
38 | // Log.e("bunny", "setDelegateResources" + delegateResources.toString());
39 | // RuntimeVariables.delegateResources = delegateResources;
40 | // }
41 | }
42 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/util/BundleLock.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlasForAndroid Project
3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.util;
23 |
24 | import java.util.HashMap;
25 | import java.util.Map;
26 | import java.util.concurrent.locks.ReentrantReadWriteLock;
27 |
28 | public class BundleLock {
29 | static Map
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.util;
23 |
24 | import android.annotation.TargetApi;
25 | import android.os.Build;
26 | import android.util.Base64;
27 |
28 | import java.util.Arrays;
29 | import java.util.jar.Attributes;
30 |
31 | /**
32 | * Represents the manifest digest for a package. This is suitable for comparison
33 | * of two packages to know whether the manifests are identical.
34 | *
35 | */
36 | public class ManifestDigest {
37 | /** The digest of the manifest in our preferred order. */
38 | private final byte[] mDigest;
39 |
40 | /** Digest field names to look for in preferred order. */
41 | private static final String[] DIGEST_TYPES = {
42 | "SHA1-Digest", "SHA-Digest", "MD5-Digest",
43 | };
44 |
45 | /** What we print out first when toString() is called. */
46 | private static final String TO_STRING_PREFIX = "ManifestDigest {mDigest=";
47 |
48 | ManifestDigest(byte[] digest) {
49 | mDigest = digest;
50 | }
51 |
52 |
53 | @TargetApi(Build.VERSION_CODES.FROYO)
54 | static ManifestDigest fromAttributes(Attributes attributes) {
55 | if (attributes == null) {
56 | return null;
57 | }
58 |
59 | String encodedDigest = null;
60 |
61 | for (int i = 0; i < DIGEST_TYPES.length; i++) {
62 | final String value = attributes.getValue(DIGEST_TYPES[i]);
63 | if (value != null) {
64 | encodedDigest = value;
65 | break;
66 | }
67 | }
68 |
69 | if (encodedDigest == null) {
70 | return null;
71 | }
72 |
73 | final byte[] digest = Base64.decode(encodedDigest, Base64.DEFAULT);
74 | return new ManifestDigest(digest);
75 | }
76 |
77 |
78 | @Override
79 | public boolean equals(Object o) {
80 | if (!(o instanceof ManifestDigest)) {
81 | return false;
82 | }
83 |
84 | final ManifestDigest other = (ManifestDigest) o;
85 |
86 | return this == other || Arrays.equals(mDigest, other.mDigest);
87 | }
88 |
89 | @Override
90 | public int hashCode() {
91 | return Arrays.hashCode(mDigest);
92 | }
93 |
94 |
95 | }
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/util/OpenAtlasUtils.java:
--------------------------------------------------------------------------------
1 | /**
2 | * OpenAtlas
3 | * The MIT License (MIT) Copyright (OpenAtlasForAndroid) 2015 Bunny Blue,achellies
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 | * and associated documentation files (the "Software"), to deal in the Software
7 | * without restriction, including without limitation the rights to use, copy, modify,
8 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in all copies
12 | * or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 | *
20 | * @author BunnyBlue
21 | **/
22 | package com.openatlas.util;
23 |
24 |
25 | import java.io.BufferedReader;
26 | import java.io.FileInputStream;
27 | import java.io.FileNotFoundException;
28 | import java.io.IOException;
29 | import java.io.InputStreamReader;
30 |
31 | /**
32 | * Created by BunnyBlue on 7/18/15.
33 | */
34 | public class OpenAtlasUtils {
35 |
36 | public static String getProcessNameByPID(int pid) {
37 |
38 | InputStreamReader reader = null;
39 | BufferedReader br = null;
40 | try {
41 | reader = new InputStreamReader(new FileInputStream("/proc/" + pid + "/cmdline"));
42 | br = new BufferedReader(reader);
43 | char[] data = new char[256];
44 | br.read(data);
45 | int len = 0;
46 | for (char c : data) {
47 | if (c == 0) {
48 | break;
49 | }
50 | len++;
51 | }
52 | return new String(data, 0, len);
53 | } catch (FileNotFoundException e) {
54 | e.printStackTrace();
55 | } catch (IOException e) {
56 | e.printStackTrace();
57 | } finally {
58 | if (reader != null) {
59 | try {
60 | reader.close();
61 | } catch (IOException e) {
62 | e.printStackTrace();
63 | }
64 | }
65 | if (br != null) {
66 | try {
67 | br.close();
68 | } catch (IOException e) {
69 | }
70 | }
71 |
72 | }
73 | return "";
74 |
75 |
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/com/openatlas/util/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * @author BunnyBlue
3 | */
4 | /**
5 | * @author BunnyBlue
6 | *
7 | */
8 | package com.openatlas.util;
--------------------------------------------------------------------------------
/openatlascore/src/main/java/org/osgi/framework/BundleListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) OSGi Alliance (2000, 2008). All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of 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,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.osgi.framework;
18 |
19 | import java.util.EventListener;
20 |
21 | /**
22 | * A
29 | * A
22 | *
23 | *
36 | *
37 | * Services implementing
41 | * If the Java Runtime Environment supports permissions, it is recommended
42 | * that the caller is checked for some appropriate permission before
43 | * returning the configuration object.
44 | *
45 | * @return The configuration object for this service.
46 | * @throws SecurityException If the caller does not have an
47 | * appropriate permission and the Java Runtime Environment supports
48 | * permissions.
49 | * @deprecated As of 1.2. Please use Configuration Admin service.
50 | */
51 | @Deprecated
52 | Object getConfigurationObject();
53 | }
54 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/org/osgi/framework/FrameworkListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) OSGi Alliance (2000, 2008). All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of 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,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.osgi.framework;
18 |
19 | import java.util.EventListener;
20 |
21 | /**
22 | * A
29 | *
30 | * A
30 | *
31 | * A
37 | *
38 | *
29 | * A
35 | * Unlike normal
42 | * BundleEvent
listener. BundleListener
is a
23 | * listener interface that may be implemented by a bundle developer. When a
24 | * BundleEvent
is fired, it is asynchronously delivered to a
25 | * BundleListener
. The Framework delivers
26 | * BundleEvent
objects to a BundleListener
in
27 | * order and must not concurrently call a BundleListener
.
28 | * BundleListener
object is registered with the Framework using
30 | * the {@link BundleContext#addBundleListener} method.
31 | * BundleListener
s are called with a BundleEvent
32 | * object when a bundle has been installed, resolved, started, stopped, updated,
33 | * unresolved, or uninstalled.
34 | *
35 | * @version $Revision: 5673 $
36 | * @see BundleEvent
37 | */
38 |
39 | public interface BundleListener extends EventListener {
40 | /**
41 | * Receives notification that a bundle has had a lifecycle change.
42 | *
43 | * @param event The BundleEvent
.
44 | */
45 | void bundleChanged(BundleEvent event);
46 | }
47 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/org/osgi/framework/Configurable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) OSGi Alliance (2000, 2009). All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of 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,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.osgi.framework;
18 |
19 | /**
20 | * Supports a configuration object.
21 | * Configurable
is an interface that should be used by a bundle
24 | * developer in support of a configurable service. Bundles that need to
25 | * configure a service may test to determine if the service object is an
26 | * instanceof Configurable
.
27 | *
28 | * @version $Revision: 6361 $
29 | * @deprecated As of 1.2. Please use Configuration Admin service.
30 | */
31 | @Deprecated
32 | public interface Configurable {
33 | /**
34 | * Returns this service's configuration object.
35 | * Configurable
should take care when
38 | * returning a service configuration object since this object is probably
39 | * sensitive.
40 | * FrameworkEvent
listener. FrameworkListener
is
23 | * a listener interface that may be implemented by a bundle developer. When a
24 | * FrameworkEvent
is fired, it is asynchronously delivered to a
25 | * FrameworkListener
. The Framework delivers
26 | * FrameworkEvent
objects to a FrameworkListener
27 | * in order and must not concurrently call a FrameworkListener
.
28 | * FrameworkListener
object is registered with the Framework
31 | * using the {@link BundleContext#addFrameworkListener} method.
32 | * FrameworkListener
objects are called with a
33 | * FrameworkEvent
objects when the Framework starts and when
34 | * asynchronous errors occur.
35 | *
36 | * @version $Revision: 5673 $
37 | * @see FrameworkEvent
38 | */
39 |
40 | public interface FrameworkListener extends EventListener {
41 |
42 | /**
43 | * Receives notification of a general FrameworkEvent
object.
44 | *
45 | * @param event The FrameworkEvent
object.
46 | */
47 | void frameworkEvent(FrameworkEvent event);
48 | }
49 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/org/osgi/framework/GetUserInfoRequest.java:
--------------------------------------------------------------------------------
1 | package org.osgi.framework;
2 |
3 | public class GetUserInfoRequest {
4 | public static final String version = "*";
5 | }
6 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/org/osgi/framework/ServiceListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) OSGi Alliance (2000, 2008). All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of 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,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.osgi.framework;
18 |
19 | import java.util.EventListener;
20 |
21 | /**
22 | * A ServiceEvent
listener. ServiceListener
is a
23 | * listener interface that may be implemented by a bundle developer. When a
24 | * ServiceEvent
is fired, it is synchronously delivered to a
25 | * ServiceListener
. The Framework may deliver
26 | * ServiceEvent
objects to a ServiceListener
out
27 | * of order and may concurrently call and/or reenter a
28 | * ServiceListener
.
29 | * ServiceListener
object is registered with the Framework
32 | * using the BundleContext.addServiceListener
method.
33 | * ServiceListener
objects are called with a
34 | * ServiceEvent
object when a service is registered, modified, or
35 | * is in the process of unregistering.
36 | * ServiceEvent
object delivery to ServiceListener
39 | * objects is filtered by the filter specified when the listener was registered.
40 | * If the Java Runtime Environment supports permissions, then additional
41 | * filtering is done. ServiceEvent
objects are only delivered to
42 | * the listener if the bundle which defines the listener object's class has the
43 | * appropriate ServicePermission
to get the service using at
44 | * least one of the named classes under which the service was registered.
45 | *
46 | * @version $Revision: 5673 $
47 | * @see ServiceEvent
48 | * @see ServicePermission
49 | */
50 |
51 | public interface ServiceListener extends EventListener {
52 | /**
53 | * Receives notification that a service has had a lifecycle change.
54 | *
55 | * @param event The ServiceEvent
object.
56 | */
57 | void serviceChanged(ServiceEvent event);
58 | }
59 |
--------------------------------------------------------------------------------
/openatlascore/src/main/java/org/osgi/framework/SynchronousBundleListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) OSGi Alliance (2001, 2008). All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of 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,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.osgi.framework;
18 |
19 | /**
20 | * A synchronous BundleEvent
listener.
21 | * SynchronousBundleListener
is a listener interface that may be
22 | * implemented by a bundle developer. When a BundleEvent
is
23 | * fired, it is synchronously delivered to a
24 | * SynchronousBundleListener
. The Framework may deliver
25 | * BundleEvent
objects to a
26 | * SynchronousBundleListener
out of order and may concurrently
27 | * call and/or reenter a SynchronousBundleListener
.
28 | * SynchronousBundleListener
object is registered with the
30 | * Framework using the {@link BundleContext#addBundleListener} method.
31 | * SynchronousBundleListener
objects are called with a
32 | * BundleEvent
object when a bundle has been installed, resolved,
33 | * starting, started, stopping, stopped, updated, unresolved, or uninstalled.
34 | * BundleListener
objects,
36 | * SynchronousBundleListener
s are synchronously called during
37 | * bundle lifecycle processing. The bundle lifecycle processing will not proceed
38 | * until all SynchronousBundleListener
s have completed.
39 | * SynchronousBundleListener
objects will be called prior to
40 | * BundleListener
objects.
41 | * AdminPermission[bundle,LISTENER]
is required to add or remove
43 | * a SynchronousBundleListener
object.
44 | *
45 | * @version $Revision: 5673 $
46 | * @see BundleEvent
47 | * @since 1.1
48 | */
49 |
50 | public interface SynchronousBundleListener extends BundleListener {
51 | // This is a marker interface
52 | }
53 |
--------------------------------------------------------------------------------
/openatlascore/src/main/jniLibs/armeabi/libdexopt.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/OpenAtlasDemo/8dff5d5988df5f98a608857b501b1f0d0efc32be/openatlascore/src/main/jniLibs/armeabi/libdexopt.so
--------------------------------------------------------------------------------
/openatlascore/src/main/jniLibs/x86/libdexopt.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lizhangqu/OpenAtlasDemo/8dff5d5988df5f98a608857b501b1f0d0efc32be/openatlascore/src/main/jniLibs/x86/libdexopt.so
--------------------------------------------------------------------------------
/openatlascore/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |