MCPcopy Index your code
hub / github.com/NativeScript/capacitor / runPlugin

Method runPlugin

embed/android/main/java/com/tns/Util.java:42–67  ·  view source on GitHub ↗
(Logger logger, Context context)

Source from the content-addressed store, hash-verified

40 }
41
42 static boolean runPlugin(Logger logger, Context context) {
43 boolean success = false;
44 String pluginClassName = "org.nativescript.livesync.LiveSyncPlugin";
45 try {
46 ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
47 Bundle metadataBundle = ai.metaData;
48 if (metadataBundle != null) {
49 pluginClassName = metadataBundle.getString("com.tns.internal.Plugin");
50 }
51 } catch (Exception e) {
52 if (Util.isDebuggableApp(context) && logger.isEnabled()) {
53 e.printStackTrace();
54 }
55 }
56
57 try {
58 Class<?> liveSyncPluginClass = Class.forName(pluginClassName);
59 Plugin p = (Plugin) liveSyncPluginClass.newInstance();
60 success = p.execute(context);
61 } catch (Exception e) {
62 if (Util.isDebuggableApp(context) && logger.isEnabled()) {
63 e.printStackTrace();
64 }
65 }
66 return success;
67 }
68
69 public static String readSystemProperty(String name) {
70 InputStreamReader in = null;

Callers 1

initRuntimeMethod · 0.95

Calls 3

isDebuggableAppMethod · 0.95
executeMethod · 0.95
isEnabledMethod · 0.80

Tested by

no test coverage detected