Qihoo360 / RePlugin

RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework
Apache License 2.0
7.28k stars 1.53k forks source link

【PR】com.qihoo360.replugin.loader.p.PluginProviderClient update 方法 #418

Open jeozey opened 7 years ago

jeozey commented 7 years ago

    /**
     * 调用插件里的Provider
     *
     * @see android.content.ContentResolver#update(Uri, ContentValues, String, String[])
     */
    public static int update(Context c, Uri uri, ContentValues values, String selection, String[] selectionArgs) {
        if (c == null) {
            return 0;
        }

        if (!RePluginFramework.mHostInitialized) {
            return c.getContentResolver().update(uri, values, selection, selectionArgs);
        }

        try {
            Object obj = ProxyRePluginProviderClientVar.update.call(null, c, uri, values, selection, selectionArgs);//new
//            Object obj = ProxyRePluginProviderClientVar.update.call(null, c, uri); //old
            if (obj != null) {
                return (Integer) obj;
            }
        } catch (Exception e) {
            if (LogDebug.LOG) {
                e.printStackTrace();
            }
        }

        return -1;
    }
jeozey commented 7 years ago

原逻辑缺少后面的三个参数,导致ContentProvider update失败