本文整理汇总了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);
}
}
示例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;
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例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));
}
示例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);
}
}
示例12: log
import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
private static void log(String message) {
XposedBridge.log(TAG + ": " + message);
}
示例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;
}
}
示例14: log
import de.robv.android.xposed.XposedBridge; //导入方法依赖的package包/类
protected static void log(String message) {
XposedBridge.log(TAG + ": " + message);
}