de.robv.android.xposed.XposedHelpers.ClassNotFoundError Java Examples

The following examples show how to use de.robv.android.xposed.XposedHelpers.ClassNotFoundError. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OneWeather.java    From MinMinGuard with GNU General Public License v3.0 6 votes vote down vote up
public static boolean handleLoadPackage(final String packageName, LoadPackageParam lpparam)
{
    try
    {
        Class<?> adView = XposedHelpers.findClass("com.handmark.expressweather.billing.BillingUtils", lpparam.classLoader);
        XposedBridge.hookAllMethods(adView, "isPurchased", new XC_MethodHook()
        {

            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {

                param.setResult(Boolean.valueOf(true));
            }
        });
    }
    catch (ClassNotFoundError e)
    {
        return false;
    }
    return true;
}
 
Example #2
Source File: LongPressNetworkClickedHook.java    From WiFiKeyView with Apache License 2.0 6 votes vote down vote up
private Class<?> getAccessPointClass(MethodHookParam param) {
	// If we already searched before, directly return
	if (accessPointClass == null) {
		// Try to load the class AccessPoint
		try {
			// If the class is not found, an error is thrown
			accessPointClass = XposedHelpers.findClass("AccessPoint", null);
		
			if (WiFiKeyView.isDebugging()) {
				WiFiKeyView.verboseLog(this, "getAccessPointClass(MethodHookParam)", "AccessPoint class was found");
			}
		} catch (ClassNotFoundError cnfe) {
			// Do not do anything, we will not use it if the reference is null
			if (WiFiKeyView.isDebugging()) {
				WiFiKeyView.verboseLog(this, "getAccessPointClass(MethodHookParam)", "AccessPoint class was not found");
			}
		}
	}
	
	return accessPointClass;
}
 
Example #3
Source File: BiliBiliPackage.java    From BiliRoaming with GNU General Public License v3.0 5 votes vote down vote up
private Class<?> findFastJsonClass() {
    Class<?> clazz;
    try {
        clazz = findClass("com.alibaba.fastjson.JSON", mClassLoader);
    } catch (ClassNotFoundError e) {
        clazz = findClass("com.alibaba.fastjson.a", mClassLoader);
    }
    return clazz;
}
 
Example #4
Source File: _2chMate.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public static boolean handleLoadPackage(final String packageName, LoadPackageParam lpparam)
{
    if (!packageName.equals("jp.co.airfront.android.a2chMate"))
    {
        return false;
    }

    try
    {
        final Class<?> viewGroupClass = XposedHelpers.findClass("android.view.ViewGroup", lpparam.classLoader);
        XposedBridge.hookAllMethods(viewGroupClass, "addView", new XC_MethodHook()
        {
            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                final View view = (View) param.args[0];
                if (view.getClass().getName().equals("jp.syoboi.a2chMate.view.MyAdView"))
                {
                    Util.log(packageName, "Detect 2chmate MyAdView in " + packageName);

                    param.setResult(null);
                }
            }
        });
        Util.log(packageName, packageName + " is 2chmate");
    }
    catch (ClassNotFoundError e)
    {
        return false;
    }

    return true;
}
 
Example #5
Source File: Og.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public boolean handleLoadPackage(final String packageName, LoadPackageParam lpparam)
{
    try
    {
        final Class<?> adView = XposedHelpers.findClass("com.og.wa.AdWebView", lpparam.classLoader);
        final Class<?> webView = XposedHelpers.findClass("android.webkit.WebView", lpparam.classLoader);
        XposedBridge.hookAllMethods(webView, "loadUrl", new XC_MethodHook()
        {

            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                if (adView.isInstance(param.thisObject))
                {
                    Util.log(packageName, "Detect og AdWebView loadUrl in " + packageName);
                    param.setResult(new Object());
                    ViewBlocking.removeAdView(packageName, (View) param.thisObject);
                }
            }
        });
        Util.log(packageName, packageName + " uses Og AdWebView");
    }
    catch (ClassNotFoundError e)
    {
        return false;
    }

    return true;
}
 
Example #6
Source File: mAdserve.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public boolean handleLoadPackage(final String packageName, LoadPackageParam lpparam)
{

    try
    {
        //TODO Add blockConstructor to ApiBlocking, so we dont have to do this hack..
        Class<?> adView = XposedHelpers.findClass("com.adsdk.sdk.banner.InAppWebView", lpparam.classLoader);
        XposedBridge.hookAllConstructors(adView, new XC_MethodHook()
        {

            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                Util.log(packageName, "Detect mAdserve InAppWebView constructor in " + packageName);

                param.setResult(new Object());
            }
        });

        Util.log(packageName, packageName + " uses mAdserve");
    }
    catch (ClassNotFoundError e)
    {
        return false;
    }
    return true;
}
 
Example #7
Source File: ApiBlocking.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public static boolean removeBannerWithResult(final String packageName, final String bannerClass, final String bannerFunc, final Object result, final XC_LoadPackage.LoadPackageParam lpparam)
{
    try
    {
        Util.hookAllMethods(bannerClass, lpparam.classLoader, bannerFunc, new XC_MethodHook()
        {
            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                String debugMsg = String.format("removeBannerWithResult: Detect %s %s in %s", bannerClass, bannerFunc, packageName);

                Util.log(packageName, debugMsg);

                ViewBlocking.removeAdView(packageName, (View) param.thisObject);

                param.setResult(result);
            }
        });
    }
    catch (ClassNotFoundError | NoSuchMethodError e)
    {
        if (e instanceof NoSuchMethodError)
        {
            Util.log(packageName, String.format("removeBannerWithResult: Method %s not found in %s.", bannerFunc, bannerClass));
        }

        return false;
    }
    return true;
}
 
Example #8
Source File: ApiBlocking.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public static boolean blockAdFunction(final String packageName, final String adClass, final String adFunc, final XC_LoadPackage.LoadPackageParam lpparam)
{
    try
    {
        Util.hookAllMethods(adClass, lpparam.classLoader, adFunc, new XC_MethodHook()
        {

            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                String debugMsg = String.format("blockAdFunction: Detect %s %s in %s", adClass, adFunc, packageName);

                Util.log(packageName, debugMsg);
                Util.notifyRemoveAdView(null, packageName, 1);

                param.setResult(new Object());
            }
        });
    }
    catch (ClassNotFoundError | NoSuchMethodError e)
    {
        if (e instanceof NoSuchMethodError)
        {
            Util.log(packageName, String.format("blockAdFunction: Method %s not found in %s.", adFunc, adFunc));
        }

        return false;
    }

    return true;
}
 
Example #9
Source File: ApiBlocking.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public static boolean blockAdFunctionExact(final String packageName, final String adClass, final String adFunc, final Object parameter, final XC_LoadPackage.LoadPackageParam lpparam)
{
    try
    {
        XposedHelpers.findAndHookMethod(adClass, lpparam.classLoader, adFunc, parameter, new XC_MethodHook()
        {
            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                String debugMsg = String.format("Detect %s %s(%s) in %s", adClass, adFunc, parameter.toString(), packageName);

                Util.log(packageName, debugMsg);

                Util.notifyRemoveAdView(null, packageName, 1);

                param.setResult(new Object());
            }
        });
    }
    catch (ClassNotFoundError | NoSuchMethodError e)
    {
        if (e instanceof NoSuchMethodError)
        {
            Util.log(packageName, String.format("blockAdFunction: Method %s(%s) not found in %s.", adFunc, parameter.toString(), adClass));
        }

        return false;
    }

    return true;
}
 
Example #10
Source File: ApiBlocking.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public static boolean blockAdFunctionExact(final String packageName, final String adClass, final String adFunc, final Object parameter1, final Object parameter2, final XC_LoadPackage.LoadPackageParam lpparam)
{
    try
    {
        XposedHelpers.findAndHookMethod(adClass, lpparam.classLoader, adFunc, parameter1, parameter2, new XC_MethodHook()
        {
            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                String debugMsg = String.format("Detect %s %s(%s, %s) in %s", adClass, adFunc, parameter1.toString(), parameter2.toString(), packageName);

                Util.log(packageName, debugMsg);

                Util.notifyRemoveAdView(null, packageName, 1);

                param.setResult(new Object());
            }
        });
    }
    catch (ClassNotFoundError | NoSuchMethodError e)
    {
        if (e instanceof NoSuchMethodError)
        {
            Util.log(packageName, String.format("blockAdFunction: Method %s(%s, %s) not found in %s.", adFunc, parameter1.toString(), parameter2.toString(), adClass));
        }

        return false;
    }

    return true;
}
 
Example #11
Source File: ApiBlocking.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public static boolean blockAdFunctionExact(final String packageName, final String adClass, final String adFunc, final Object parameter1, final Object parameter2, final Object parameter3, final XC_LoadPackage.LoadPackageParam lpparam)
{
    try
    {
        XposedHelpers.findAndHookMethod(adClass, lpparam.classLoader, adFunc, parameter1, parameter2, parameter3, new XC_MethodHook()
        {
            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                String debugMsg = String.format("Detect %s %s(%s, %s, %s) in %s", adClass, adFunc, parameter1.toString(), parameter2.toString(), parameter3.toString(), packageName);

                Util.log(packageName, debugMsg);

                Util.notifyRemoveAdView(null, packageName, 1);

                param.setResult(new Object());
            }
        });
    }
    catch (ClassNotFoundError | NoSuchMethodError e)
    {
        if (e instanceof NoSuchMethodError)
        {
            Util.log(packageName, String.format("blockAdFunction: Method %s(%s, %s, %s) not found in %s.", adFunc, parameter1.toString(), parameter2.toString(), parameter3.toString(), adClass));
        }

        return false;
    }

    return true;
}
 
Example #12
Source File: ApiBlocking.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public static boolean blockAdFunctionWithResult(final String packageName, final String adClass, final String adFunc, final Object result, final XC_LoadPackage.LoadPackageParam lpparam)
{
    try
    {
        XposedHelpers.findAndHookMethod(adClass, lpparam.classLoader, adFunc, new XC_MethodHook()
        {

            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                String debugMsg = String.format("blockAdFunctionWithResult: Detect %s %s in %s", adClass, adFunc, packageName);

                Util.log(packageName, debugMsg);

                Util.notifyRemoveAdView(null, packageName, 1);

                param.setResult(result);
            }
        });
    }
    catch (ClassNotFoundError | NoSuchMethodError e)
    {
        if (e instanceof NoSuchMethodError)
        {
            Util.log(packageName, String.format("blockAdFunctionWithResult: Method %s not found in %s.", adFunc, adClass));
        }

        return false;
    }

    return true;
}
 
Example #13
Source File: ApiBlocking.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public static boolean blockAdFunctionWithResultExact(final String packageName, final String adClass, final String adFunc, final Object parameter, final Object result, final XC_LoadPackage.LoadPackageParam lpparam)
{
    try
    {
        XposedHelpers.findAndHookMethod(adClass, lpparam.classLoader, adFunc, parameter, new XC_MethodHook()
        {

            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                String debugMsg = String.format("Detect %s %s(%s) in %s", adClass, adFunc, parameter.toString(), packageName);

                Util.log(packageName, debugMsg);

                Util.notifyRemoveAdView(null, packageName, 1);

                param.setResult(result);
            }
        });
    }
    catch (ClassNotFoundError | NoSuchMethodError e)
    {
        if (e instanceof NoSuchMethodError)
        {
            Util.log(packageName, String.format("blockAdFunctionWithResult: Method %s(%s) not found in %s.", adFunc, parameter.toString(), adClass));
        }

        return false;
    }

    return true;
}
 
Example #14
Source File: ApiBlocking.java    From MinMinGuard with GNU General Public License v3.0 5 votes vote down vote up
public static boolean blockAdFunctionWithResultExact(final String packageName, final String adClass, final String adFunc, final Object parameter1, final Object parameter2, final Object result, final XC_LoadPackage.LoadPackageParam lpparam)
{
    try
    {
        XposedHelpers.findAndHookMethod(adClass, lpparam.classLoader, adFunc, parameter1, parameter2, new XC_MethodHook()
        {

            @Override
            protected void beforeHookedMethod(MethodHookParam param)
            {
                String debugMsg = String.format("Detect %s %s(%s, %s) in %s", adClass, adFunc, parameter1.toString(), parameter2.toString(), packageName);

                Util.log(packageName, debugMsg);

                Util.notifyRemoveAdView(null, packageName, 1);

                param.setResult(result);
            }
        });
    }
    catch (ClassNotFoundError | NoSuchMethodError e)
    {
        if (e instanceof NoSuchMethodError)
        {
            Util.log(packageName, String.format("blockAdFunctionWithResultExact: Method %s(%s, %s) not found in %s.", adFunc, parameter1.toString(), parameter2.toString(), adClass));
        }

        return false;
    }

    return true;
}
 
Example #15
Source File: PieController.java    From GravityBox with Apache License 2.0 4 votes vote down vote up
public PieController(Context context, Context gbContext, XSharedPreferences prefs) {
    mContext = context;
    mGbContext = gbContext;
    mGbResources = gbContext.getResources();
    mLongPressHandler = new PieLongPressHandler(context, prefs);

    mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);

    final PackageManager pm = mContext.getPackageManager();
    mHasTelephony = pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);

    final Resources res = mContext.getResources();
    Tracker.sDistance = mGbResources.getDimensionPixelSize(R.dimen.pie_trigger_distance);

    mBackIcon = res.getDrawable(context.getResources().getIdentifier(
            "ic_sysbar_back", "drawable", PACKAGE_NAME), null).mutate();
    mBackAltIcon = res.getDrawable(context.getResources().getIdentifier(
            "ic_sysbar_back_ime", "drawable", PACKAGE_NAME), null).mutate();
    mRecentIcon = res.getDrawable(res.getIdentifier(
            "ic_sysbar_recent", "drawable", PACKAGE_NAME), null).mutate();
    mRecentAltIcon = mGbResources.getDrawable(R.drawable.ic_sysbar_recent_clear, null).mutate();

    try {
        mBaseStatusBarClass = XposedHelpers.findClass(CLASS_BASE_STATUSBAR, mContext.getClassLoader());
    } catch (ClassNotFoundError e) {
        XposedBridge.log(e);
    }

    mSysinfoDisabled = prefs.getBoolean(GravityBoxSettings.PREF_KEY_PIE_SYSINFO_DISABLE, false);
    setLongpressDelay(Integer.valueOf(prefs.getString(
            GravityBoxSettings.PREF_KEY_PIE_LONGPRESS_DELAY, "0")));;

    mColorInfo = new ColorInfo();
    mColorInfo.bgColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_BG, 
            mGbResources.getColor(R.color.pie_background_color));
    mColorInfo.selectedColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_SELECTED,
            mGbResources.getColor(R.color.pie_selected_color));
    mColorInfo.outlineColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_OUTLINE,
            mGbResources.getColor(R.color.pie_outline_color));
    mColorInfo.fgColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_FG,
            mGbResources.getColor(R.color.pie_foreground_color));
    mColorInfo.textColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_TEXT,
            mGbResources.getColor(R.color.pie_text_color));

    updateColors();
}