Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAppWidgetService中getAppWidgetIds函数报错bug #209

Open
seakingjin opened this issue Jun 6, 2016 · 0 comments
Open

IAppWidgetService中getAppWidgetIds函数报错bug #209

seakingjin opened this issue Jun 6, 2016 · 0 comments

Comments

@seakingjin
Copy link

添加IAppWidgetServiceHookHandle,IAppWidgetServiceBinderHook,IAppWidgetServiceCompat等文件

其中IAppWidgetServiceHookHandle hook函数如下:

private class getAppWidgetIds extends HookedMethodHandler {
public getAppWidgetIds(Context hostContext) {
super(hostContext);
}

    @Override
    protected boolean beforeInvoke(Object receiver, Method method, Object[] args) throws Throwable {
        try
        {
            if (args.length>0)
            {
                if (args[0] instanceof ComponentName)
                {
                    ComponentName myarg=(ComponentName)args[0];
                    FieldUtils.writeField(myarg, "mPackage", mHostContext.getPackageName());
                }
            }
        }
        catch(Exception ex)
        {
            ex.printStackTrace();
        }
        return super.beforeInvoke(receiver, method, args);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant