Java 类android.util.LogPrinter 实例源码

项目:IFWManager    文件:IntentResolver.java   
public void addFilter(F f) {
    if (localLOGV) {
        Slog.v(TAG, "Adding filter: " + f);
        f.dump(new LogPrinter(Log.VERBOSE, TAG, Log.LOG_ID_SYSTEM), "      ");
        Slog.v(TAG, "    Building Lookup Maps:");
    }

    mFilters.add(f);
    int numS = register_intent_filter(f, f.schemesIterator(),
            mSchemeToFilter, "      Scheme: ");
    int numT = register_mime_types(f, "      Type: ");
    if (numS == 0 && numT == 0) {
        register_intent_filter(f, f.actionsIterator(),
                mActionToFilter, "      Action: ");
    }
    if (numT != 0) {
        register_intent_filter(f, f.actionsIterator(),
                mTypedActionToFilter, "      TypedAction: ");
    }
}
项目:IFWManager    文件:IntentResolver.java   
void removeFilterInternal(F f) {
    if (localLOGV) {
        Slog.v(TAG, "Removing filter: " + f);
        f.dump(new LogPrinter(Log.VERBOSE, TAG, Log.LOG_ID_SYSTEM), "      ");
        Slog.v(TAG, "    Cleaning Lookup Maps:");
    }

    int numS = unregister_intent_filter(f, f.schemesIterator(),
            mSchemeToFilter, "      Scheme: ");
    int numT = unregister_mime_types(f, "      Type: ");
    if (numS == 0 && numT == 0) {
        unregister_intent_filter(f, f.actionsIterator(),
                mActionToFilter, "      Action: ");
    }
    if (numT != 0) {
        unregister_intent_filter(f, f.actionsIterator(),
                mTypedActionToFilter, "      TypedAction: ");
    }
}
项目:container    文件:VPackageManagerService.java   
public final void addActivity(PackageParser.Activity a, String type) {
    final boolean systemApp = isSystemApp(a.info.applicationInfo);
    mActivities.put(a.getComponentName(), a);
    if (DEBUG_SHOW_INFO)
        Log.v(TAG, "  " + type + " "
                + (a.info.nonLocalizedLabel != null ? a.info.nonLocalizedLabel : a.info.name) + ":");
    if (DEBUG_SHOW_INFO)
        Log.v(TAG, "    Class=" + a.info.name);
    final int NI = a.intents.size();
    for (int j = 0; j < NI; j++) {
        PackageParser.ActivityIntentInfo intent = a.intents.get(j);
        if (!systemApp && intent.getPriority() > 0 && "activity".equals(type)) {
            intent.setPriority(0);
            Log.w(TAG, "Package " + a.info.applicationInfo.packageName + " has activity " + a.className
                    + " with priority > 0, forcing to 0");
        }
        if (DEBUG_SHOW_INFO) {
            Log.v(TAG, "    IntentFilter:");
            intent.dump(new LogPrinter(Log.VERBOSE, TAG), "      ");
        }
        addFilter(intent);
    }
}
项目:container    文件:VPackageManagerService.java   
public final void removeActivity(PackageParser.Activity a, String type) {
    mActivities.remove(a.getComponentName());
    if (DEBUG_SHOW_INFO) {
        Log.v(TAG, "  " + type + " "
                + (a.info.nonLocalizedLabel != null ? a.info.nonLocalizedLabel : a.info.name) + ":");
        Log.v(TAG, "    Class=" + a.info.name);
    }
    final int NI = a.intents.size();
    for (int j = 0; j < NI; j++) {
        PackageParser.ActivityIntentInfo intent = a.intents.get(j);
        if (DEBUG_SHOW_INFO) {
            Log.v(TAG, "    IntentFilter:");
            intent.dump(new LogPrinter(Log.VERBOSE, TAG), "      ");
        }
        removeFilter(intent);
    }
}
项目:Android-plugin-support    文件:DynamicApkManager.java   
public final void addActivity(DynamicApkParser.Activity a, String type) {
    mActivities.put(a.getComponentName().getClassName(), a);
    if (DEBUG_SHOW_INFO)
        Log.v(
                TAG, "  " + type + " " +
                        (a.info.nonLocalizedLabel != null ? a.info.nonLocalizedLabel : a.info.name) + ":");
    if (DEBUG_SHOW_INFO)
        Log.v(TAG, "    Class=" + a.info.name);
    final int NI = a.intents.size();
    for (int j=0; j<NI; j++) {
        DynamicApkParser.ActivityIntentInfo intent = a.intents.get(j);
        if (intent.getPriority() > 0 && "activity".equals(type)) {
            intent.setPriority(0);
            Log.w(TAG, "Package " + a.info.applicationInfo.packageName + " has activity "
                    + a.className + " with priority > 0, forcing to 0");
        }
        if (DEBUG_SHOW_INFO) {
            Log.v(TAG, "    IntentFilter:");
            intent.dump(new LogPrinter(Log.VERBOSE, TAG), "      ");
        }
    }
}
项目:Android-plugin-support    文件:DynamicApkManager.java   
public final void removeActivity(DynamicApkParser.Activity a, String type) {
    mActivities.remove(a.getComponentName().getClassName());
    if (DEBUG_SHOW_INFO) {
        Log.v(TAG, "  " + type + " "
                + (a.info.nonLocalizedLabel != null ? a.info.nonLocalizedLabel
                : a.info.name) + ":");
        Log.v(TAG, "    Class=" + a.info.name);
    }
    final int NI = a.intents.size();
    for (int j=0; j<NI; j++) {
        DynamicApkParser.ActivityIntentInfo intent = a.intents.get(j);
        if (DEBUG_SHOW_INFO) {
            Log.v(TAG, "    IntentFilter:");
            intent.dump(new LogPrinter(Log.VERBOSE, TAG), "      ");
        }
    }
}
项目:Android-plugin-support    文件:DynamicApkManager.java   
public final void addService(DynamicApkParser.Service s) {
    mServices.put(s.getComponentName().getClassName(), s);
    if (DEBUG_SHOW_INFO)
        Log.v(
                TAG, "  " +
                        (s.info.nonLocalizedLabel != null ? s.info.nonLocalizedLabel : s.info.name) + ":");
    if (DEBUG_SHOW_INFO)
        Log.v(TAG, "    Class=" + s.info.name);
    final int NI = s.intents.size();
    for (int j=0; j<NI; j++) {
        DynamicApkParser.ServiceIntentInfo intent = s.intents.get(j);
        if (DEBUG_SHOW_INFO) {
            Log.v(TAG, "    IntentFilter:");
            intent.dump(new LogPrinter(Log.VERBOSE, TAG), "      ");
        }
    }
}
项目:Android-plugin-support    文件:DynamicApkManager.java   
public final void removeService(DynamicApkParser.Service s, String type) {
    mServices.remove(s.getComponentName().getClassName());
    if (DEBUG_SHOW_INFO) {
        Log.v(TAG, "  " + type + " "
                + (s.info.nonLocalizedLabel != null ? s.info.nonLocalizedLabel
                : s.info.name) + ":");
        Log.v(TAG, "    Class=" + s.info.name);
    }
    final int NI = s.intents.size();
    for (int j=0; j<NI; j++) {
        DynamicApkParser.ServiceIntentInfo intent = s.intents.get(j);
        if (DEBUG_SHOW_INFO) {
            Log.v(TAG, "    IntentFilter:");
            intent.dump(new LogPrinter(Log.VERBOSE, TAG), "      ");
        }
    }
}
项目:Android-plugin-support    文件:DynamicApkManager.java   
public final void addProvider(DynamicApkParser.Provider p) {

            mProviders.put(p.getComponentName().getClassName(), p);
            if (DEBUG_SHOW_INFO) {
                Log.v(TAG, "  "
                        + (p.info.nonLocalizedLabel != null
                        ? p.info.nonLocalizedLabel : p.info.name) + ":");
                Log.v(TAG, "    Class=" + p.info.name);
            }
            final int NI = p.intents.size();
            int j;
            for (j = 0; j < NI; j++) {
                DynamicApkParser.ProviderIntentInfo intent = p.intents.get(j);
                if (DEBUG_SHOW_INFO) {
                    Log.v(TAG, "    IntentFilter:");
                    intent.dump(new LogPrinter(Log.VERBOSE, TAG), "      ");
                }
            }
        }
项目:Android-plugin-support    文件:DynamicApkManager.java   
public final void removeProvider(DynamicApkParser.Provider p) {
    mProviders.remove(p.getComponentName().getClassName());
    if (DEBUG_SHOW_INFO) {
        Log.v(TAG, "  " + (p.info.nonLocalizedLabel != null
                ? p.info.nonLocalizedLabel : p.info.name) + ":");
        Log.v(TAG, "    Class=" + p.info.name);
    }
    final int NI = p.intents.size();
    int j;
    for (j = 0; j < NI; j++) {
        DynamicApkParser.ProviderIntentInfo intent = p.intents.get(j);
        if (DEBUG_SHOW_INFO) {
            Log.v(TAG, "    IntentFilter:");
            intent.dump(new LogPrinter(Log.VERBOSE, TAG), "      ");
        }
    }
}
项目:ApkLauncher    文件:IntentResolver.java   
public void addFilter(F f) {
    if (localLOGV) {
        Slog.v(TAG, "Adding filter: " + f);
        f.dump(new LogPrinter(Log.VERBOSE, TAG/*, Log.LOG_ID_SYSTEM*/), "      ");
        Slog.v(TAG, "    Building Lookup Maps:");
    }

    mFilters.add(f);
    int numS = register_intent_filter(f, f.schemesIterator(),
            mSchemeToFilter, "      Scheme: ");
    int numT = register_mime_types(f, "      Type: ");
    if (numS == 0 && numT == 0) {
        register_intent_filter(f, f.actionsIterator(),
                mActionToFilter, "      Action: ");
    }
    if (numT != 0) {
        register_intent_filter(f, f.actionsIterator(),
                mTypedActionToFilter, "      TypedAction: ");
    }
}
项目:ApkLauncher    文件:IntentResolver.java   
void removeFilterInternal(F f) {
    if (localLOGV) {
        Slog.v(TAG, "Removing filter: " + f);
        f.dump(new LogPrinter(Log.VERBOSE, TAG/*, Log.LOG_ID_SYSTEM*/), "      ");
        Slog.v(TAG, "    Cleaning Lookup Maps:");
    }

    int numS = unregister_intent_filter(f, f.schemesIterator(),
            mSchemeToFilter, "      Scheme: ");
    int numT = unregister_mime_types(f, "      Type: ");
    if (numS == 0 && numT == 0) {
        unregister_intent_filter(f, f.actionsIterator(),
                mActionToFilter, "      Action: ");
    }
    if (numT != 0) {
        unregister_intent_filter(f, f.actionsIterator(),
                mTypedActionToFilter, "      TypedAction: ");
    }
}
项目:koala--Android-Plugin-Runtime-    文件:IntentResolver.java   
public void addFilter(F f) {
    if (localLOGV) {
        Slog.v(TAG, "Adding filter: " + f);
        f.dump(new LogPrinter(Log.VERBOSE, TAG, Log.LOG_ID_SYSTEM), "      ");
        Slog.v(TAG, "    Building Lookup Maps:");
    }

    mFilters.add(f);
    int numS = register_intent_filter(f, f.schemesIterator(),
            mSchemeToFilter, "      Scheme: ");
    int numT = register_mime_types(f, "      Type: ");
    if (numS == 0 && numT == 0) {
        register_intent_filter(f, f.actionsIterator(),
                mActionToFilter, "      Action: ");
    }
    if (numT != 0) {
        register_intent_filter(f, f.actionsIterator(),
                mTypedActionToFilter, "      TypedAction: ");
    }
}
项目:koala--Android-Plugin-Runtime-    文件:IntentResolver.java   
void removeFilterInternal(F f) {
    if (localLOGV) {
        Slog.v(TAG, "Removing filter: " + f);
        f.dump(new LogPrinter(Log.VERBOSE, TAG, Log.LOG_ID_SYSTEM), "      ");
        Slog.v(TAG, "    Cleaning Lookup Maps:");
    }

    int numS = unregister_intent_filter(f, f.schemesIterator(),
            mSchemeToFilter, "      Scheme: ");
    int numT = unregister_mime_types(f, "      Type: ");
    if (numS == 0 && numT == 0) {
        unregister_intent_filter(f, f.actionsIterator(),
                mActionToFilter, "      Action: ");
    }
    if (numT != 0) {
        unregister_intent_filter(f, f.actionsIterator(),
                mTypedActionToFilter, "      TypedAction: ");
    }
}
项目:PluginM    文件:PluginManager.java   
private void loadStaticReceivers(PluginInfo pluginInfo) {
    Map<ActivityInfo, List<IntentFilter>> receiverIntentFilters = pluginInfo.pkgParser.getReceiverIntentFilter();

    if (receiverIntentFilters != null) {
        for (Map.Entry<ActivityInfo, List<IntentFilter>> entry : receiverIntentFilters.entrySet()) {
            ActivityInfo receiverInfo = entry.getKey();
            List<IntentFilter> intentFilters = entry.getValue();

            String currentProcessName = ProcessHelper.sProcessName;
            String stubProcessName = selectStubProcessName(receiverInfo.processName, receiverInfo.packageName);

            if (!TextUtils.isEmpty(currentProcessName) && currentProcessName.equals(stubProcessName)) {
                try {
                    Logger.d(TAG, "loadStaticReceivers() receiverInfo = " + receiverInfo);
                    BroadcastReceiver receiver = (BroadcastReceiver) pluginInfo.classLoader.loadClass(receiverInfo.name).newInstance();
                    int i = 1;
                    for (IntentFilter filter : intentFilters) {
                        pluginInfo.application.registerReceiver(receiver, filter);
                        Logger.d(TAG, "loadStaticReceivers() IntentFilter No." + i++ + " :");
                        filter.dump(new LogPrinter(Log.DEBUG, "loadStaticReceivers() "), "");
                        Logger.d(TAG, "loadStaticReceivers() \n");
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
项目:android-overlay-protection    文件:BaseDetectionEngine.java   
@Override
public void handleEvent(AccessibilityEvent event) {
    // Avoid processing events when screen is locked
    if (_keyguardManager != null) {
        boolean locked = _keyguardManager.inKeyguardRestrictedInputMode();
        if (locked) {
            Log.i(TAG, "Screen locked, skipping overlay check!");
            return;
        }
    }

    Log.d(TAG, String.format("New event %s", event.toString()));
    _eventCounter.newEvent();
    _notifyService.updateNotificationCount(_eventCounter.getLastMinuteEventCount());
    if (_resultReceiver != null) {
        Bundle bundle = new Bundle();
        bundle.putLong("eventCount", _eventCounter.getLastMinuteEventCount());
        _resultReceiver.send(ServiceCommunication.MSG_EVENT_COUNT_UPDATE, bundle);
    }


    // When overlay is detected avoid performing useless computation
    if (_overlayState.isHasOverlay() || _overlayState.isPendingUninstall())
        return;

    if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
        if (event.getPackageName() == null)
            return;

        String eventPackage = event.getPackageName().toString();
        ComponentName componentName = new ComponentName(
                eventPackage,
                event.getClassName().toString()
        );
        ActivityInfo activityInfo = tryGetActivity(componentName);
        boolean isActivity = activityInfo != null;
        if (isActivity) {
            LogPrinter logPrinter = new LogPrinter(Log.DEBUG, TAG);
            activityInfo.dump(logPrinter, "");
        }
        String className = event.getClassName().toString();

        // Perform detection
        boolean parentAvailable = event.getSource() != null ? event.getSource().getParent() != null : false;

        Log.d(TAG, String.format("Collected info isActivity %s, parentAvailable: %s", String.valueOf(isActivity), String.valueOf(parentAvailable)));

        if (_overlayState.getIgnoreOncePackage().equals(eventPackage)) {
            Log.d(TAG, String.format("Package %s ignored once", eventPackage));
        } else if (eventPackage.equals(previousEventPackage)) {
            Log.d(TAG, String.format("Last two event have the same package %s, skipping check!", eventPackage));
        } else if (_layoutClasses.contains(className) && !isActivity && !parentAvailable) {
            Log.d(TAG, String.format("Detected suspicious class %s without activity and parent for process %s, checking whitelist", className, eventPackage));
            if (!checkWhitelistHit(eventPackage)) {
                Log.d(TAG, "No whitelist entry found");
                if (checkSuspectedApps(eventPackage)) {
                    Log.d(TAG, String.format("******* VIEW OVERLAY DETECTED!!!"));
                    _overlayState.setOffender(eventPackage);
                    _overlayState.setProcess(_currentProcess);
                    _notifyService.processOverlayState(_overlayState);
                }
            } else {
                Log.d(TAG, "Whitelist hit skipping!");
            }
        } else if (isActivity && activityInfo.launchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE && !parentAvailable) {
            Log.d(TAG, String.format("Detected suspicious activity %s with single instance flag, checking whitelist", activityInfo.packageName));
            if (!checkWhitelistHit(eventPackage)) {
                Log.d(TAG, "No whitelist entry found");
                if (checkSuspectedApps(eventPackage)) {
                    Log.d(TAG, String.format("******* ACTIVITY OVERLAY DETECTED!!!"));
                    _overlayState.setOffender(eventPackage);
                    _overlayState.setProcess(_currentProcess);
                    _notifyService.processOverlayState(_overlayState);
                }
            } else {
                Log.d(TAG, "Whitelist hit skipping!");
            }
        }
        previousEventPackage = eventPackage;
    }
}
项目:FakeLocation    文件:LocationRecorder.java   
public LocationRecorder(Context context)
{
    mPrinter = new LogPrinter(Log.DEBUG, "LocationRecorder");
    mDbManager = new LocationRecorderDbManager(context);
    mCurrentRecordId = -1;
}
项目:droidel    文件:ActivityThread.java   
public static void main(DroidelStubs stubs) {
droidelStubs = stubs;
       SamplingProfilerIntegration.start();

       // CloseGuard defaults to true and can be quite spammy.  We
       // disable it here, but selectively enable it later (via
       // StrictMode) on debug builds, but using DropBox, not logs.
       //CloseGuard.setEnabled(false);

       Environment.initForCurrentUser();

       // Set the reporter for event logging in libcore
       //EventLogger.setReporter(new EventLoggingReporter());

       Security.addProvider(new AndroidKeyStoreProvider());

       Process.setArgV0("<pre-initialized>");

       Looper.prepareMainLooper();

       ActivityThread thread = new ActivityThread();
       thread.attach(false);

       if (sMainThreadHandler == null) {
           sMainThreadHandler = thread.getHandler();
       }

       AsyncTask.init();

       if (false) {
           Looper.myLooper().setMessageLogging(new
                   LogPrinter(Log.DEBUG, "ActivityThread"));
       }

// create all possible messages!

// for each activity
ApplicationThread appThread = thread.getApplicationThread();
try {
    while (Nondet.nondetBool()) {
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    appThread.onTransact(Nondet.nondetInt(), data, reply, Nondet.nondetInt());
    }
} catch (RemoteException e) {}
// end for each activity

       Looper.loop();

       throw new RuntimeException("Main thread loop unexpectedly exited");
   }