当前位置: 首页>>代码示例>>Java>>正文


Java XposedBridge.log方法代码示例

本文整理汇总了Java中de.robv.android.xposed.XposedBridge.log方法的典型用法代码示例。如果您正苦于以下问题:Java XposedBridge.log方法的具体用法?Java XposedBridge.log怎么用?Java XposedBridge.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.robv.android.xposed.XposedBridge的用法示例。


在下文中一共展示了XposedBridge.log方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: changeSmartRadioState

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private static void changeSmartRadioState(Intent intent) {
    try {
        if (intent.hasExtra(AShortcut.EXTRA_ENABLE)) {
            mSmartRadioEnabled = intent.getBooleanExtra(AShortcut.EXTRA_ENABLE, false);
        } else {
            mSmartRadioEnabled = !mSmartRadioEnabled;
        }
        Settings.System.putInt(mContext.getContentResolver(),
                SETTING_SMART_RADIO_ENABLED, mSmartRadioEnabled ? 1 : 0);
        if (mSmartRadioEnabled) {
            if (shouldSwitchToNormalState()) {
                switchToState(State.NORMAL);
            } else {
                switchToState(State.POWER_SAVING);
            }
        }
        if (intent.getBooleanExtra(AShortcut.EXTRA_SHOW_TOAST, false)) {
            Utils.postToast(mContext, mSmartRadioEnabled ? R.string.smart_radio_on :
                R.string.smart_radio_off);
        }
        if (DEBUG) log("mSmartRadioEnabled=" + mSmartRadioEnabled);
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:26,代码来源:ModSmartRadio.java

示例2: hasMsimSupport

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
public static boolean hasMsimSupport() {
    if (mHasMsimSupport != null) return mHasMsimSupport;

    try {
        Object mtm = XposedHelpers.callStaticMethod(getTelephonyManagerClass(), "getDefault");
        mHasMsimSupport = (Boolean) XposedHelpers.callMethod(mtm, "isMultiSimEnabled") &&
                getPhoneCount() > 1;
        if (DEBUG) log("isMultiSimEnabled: " +
                (Boolean) XposedHelpers.callMethod(mtm, "isMultiSimEnabled"));
        if (DEBUG) log("getPhoneCount: " + getPhoneCount());
    } catch (Throwable t) {
        if (DEBUG) XposedBridge.log(t);
        mHasMsimSupport = false;
    }

    if (DEBUG) log("hasMsimSupport: " + mHasMsimSupport);
    return mHasMsimSupport;
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:19,代码来源:PhoneWrapper.java

示例3: download

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private static void download(Context context, String url, File saveDirectory, String fileName) {
    File file = new File(saveDirectory, fileName);

    XposedBridge.log("[SoundCloud Downloader] Download path: " + file.getPath());

    if (file.exists()) {
        Toast.makeText(context, "File already exists!", Toast.LENGTH_SHORT).show();
        return;
    }

    DownloadManager downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
    DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
    request.setTitle(fileName);
    request.allowScanningByMediaScanner();
    request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
    request.setDestinationUri(Uri.fromFile(file));

    try {
        downloadManager.enqueue(request);
        Toast.makeText(context, "Downloading...", Toast.LENGTH_SHORT).show();
    } catch (Exception e) {
        XposedBridge.log("[SoundCloud Downloader] Download Error: " + e.getMessage());
        Toast.makeText(context, "Download failed!", Toast.LENGTH_SHORT).show();
    }
}
 
开发者ID:skyguy126,项目名称:Xposed-SoundCloudDownloader,代码行数:26,代码来源:XposedMod.java

示例4: initAndroid

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
public static final void initAndroid(final ClassLoader classLoader) {
    if (DEBUG) log("service init");

    try {
        XposedHelpers.findAndHookMethod(CLASS_FP_SERVICE_WRAPPER, classLoader,
                "isRestricted", new XC_MethodHook() {
            @Override
            protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                Object service = XposedHelpers.getSurroundingThis(param.thisObject);
                Context ctx = (Context) XposedHelpers.getObjectField(service, "mContext");
                String pkg = ctx.getPackageManager().getNameForUid(Binder.getCallingUid());
                if (pkg != null) {
                    if (pkg.contains(":")) {
                        pkg = pkg.split(":")[0];
                    }
                    if (DEBUG) log("service: isRestricted: pkg=" + pkg);
                    if (UID_SYSTEM_UI.equals(pkg)) {
                        param.setResult(false);
                    }
                }
            }
        });
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:27,代码来源:FingerprintLauncher.java

示例5: sendNfcState

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private static void sendNfcState(ResultReceiver receiver) {
    if (mContext == null || receiver == null) return;
    int nfcState = NFC_STATE_UNKNOWN;
    try {
        NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
        if (adapter != null) {
            nfcState = (Integer) XposedHelpers.callMethod(adapter, "getAdapterState");
        }
    } catch (Throwable t) {
        XposedBridge.log(t);
    } finally {
        Bundle b = new Bundle();
        b.putInt("nfcState", nfcState);
        receiver.send(0, b);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:17,代码来源:ConnectivityServiceWrapper.java

示例6: updateNavbarDimensions

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private static void updateNavbarDimensions() {
    try {
        Resources res = mContext.getResources();
        int resWidthId = res.getIdentifier(
                "navigation_bar_width", "dimen", "android");
        int resHeightId = res.getIdentifier(
                "navigation_bar_height", "dimen", "android");
        int resHeightLandscapeId = res.getIdentifier(
                "navigation_bar_height_landscape", "dimen", "android");
        mNavbarDimensions = new NavbarDimensions(
                (int) (res.getDimensionPixelSize(resWidthId) * mNavbarWidthScaleFactor),
                (int) (res.getDimensionPixelSize(resHeightId) * mNavbarHeightScaleFactor),
                (int) (res.getDimensionPixelSize(resHeightLandscapeId) * mNavbarHeightLandscapeScaleFactor));
        updateSettings();
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:19,代码来源:ModExpandedDesktop.java

示例7: dispatchMediaButtonEvent

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private static void dispatchMediaButtonEvent(KeyEvent keyEvent) {
    try {
        mAudioManager.dispatchMediaKeyEvent(keyEvent);
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:8,代码来源:ModVolumeKeySkipTrack.java

示例8: getSubIdForPhoneAccount

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private int getSubIdForPhoneAccount(final TelephonyManager tm, final PhoneAccount account) {
    try {
        return (int) XposedHelpers.callMethod(tm, "getSubIdForPhoneAccount", account);
    } catch (Throwable t) {
        XposedBridge.log(t);
        return -1;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:9,代码来源:SubscriptionManager.java

示例9: toggleShowTouches

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private static void toggleShowTouches(int showTouches) {
    try {
        if (showTouches == -1) {
            showTouches = 1 - Settings.System.getInt(mContext.getContentResolver(),
                    SETTING_SHOW_TOUCHES);
        }
        Settings.System.putInt(mContext.getContentResolver(),
                SETTING_SHOW_TOUCHES, showTouches);
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:13,代码来源:ModHwKeys.java

示例10: handleLoadPackage

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {

		/* Limit to our app */
		if (!lpparam.packageName.equals(PACKAGE_NAME))
			return;

		XposedBridge.log(TAG + ": Bypassing root detection for " + PACKAGE_NAME);

		/* Force returned value 0 for method to check Root status */
		findAndHookMethod(UTIL_CLASS,
				lpparam.classLoader,
				IS_ROOTED_METHOD,
				android.content.Context.class,
				returnConstant(0));
	}
 
开发者ID:matttbe,项目名称:DBBeRootBypass,代码行数:16,代码来源:BypassRootDetection.java

示例11: setMode

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
public void setMode(QuietHours.Mode mode) {
    try {
        Context gbContext = Utils.getGbContext(mContext);
        Intent intent = new Intent(gbContext, GravityBoxService.class);
        intent.setAction(QuietHoursActivity.ACTION_SET_QUIET_HOURS_MODE);
        intent.putExtra(QuietHoursActivity.EXTRA_QH_MODE, mode.toString());
        gbContext.startService(intent);
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:12,代码来源:StatusbarQuietHoursManager.java

示例12: log

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private static void log(String message) {
    XposedBridge.log(TAG + ": " + message);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:4,代码来源:ModPower.java

示例13: isUserLocationRestricted

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private boolean isUserLocationRestricted(int userId) {
    try {
        final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
        return (boolean) XposedHelpers.callMethod(um, "hasUserRestriction",
                UserManager.DISALLOW_SHARE_LOCATION,
                Utils.getUserHandle(userId));
    } catch (Throwable t) {
        XposedBridge.log(t);
        return false;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:12,代码来源:GpsStatusMonitor.java

示例14: log

import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
protected static void log(String message) {
    XposedBridge.log(TAG + ": " + message);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:4,代码来源:BaseTile.java


注:本文中的de.robv.android.xposed.XposedBridge.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。