Info Call to SQLite query API

Description

Improper SQL query construction could lead to SQL injection. An SQL injection attack consists of injecting of an SQL query via the input data from the client to the application

Recommendation

This entry is informative, no recommendations applicable.

Technical details

Method com.android.providers.media.MediaProvider.query() calling method android.database.sqlite.SQLiteQueryBuilder.appendWhere()


    public android.database.Cursor query(android.net.Uri p28, String[] p29, String p30, String[] p31, String p32)
    {
        String v12_1 = p30;
        android.net.Uri v14 = this.safeUncanonicalize(p28);
        String v15_1 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v14);
        int v9_1 = new java.util.ArrayList();
        if (v15_1 != 500) {
            if (v15_1 != 600) {
                if (v15_1 != 601) {
                    String v16 = 0;
                    String v8_1 = this.getDatabaseForUri(v14);
                    if (v8_1 != null) {
                        v8_1.mNumQueries = (v8_1.mNumQueries + 1);
                        int v7_1 = v8_1.getReadableDatabase();
                        if (v7_1 != 0) {
                            String[] v6_1;
                            boolean v5_4 = new android.database.sqlite.SQLiteQueryBuilder();
                            String v17 = v14.getQueryParameter("limit");
                            int v2_28 = v14.getQueryParameter("filter");
                            int v3_14 = 0;
                            if (v2_28 == 0) {
                                v6_1 = 0;
                            } else {
                                int v2_29 = android.net.Uri.decode(v2_28).trim();
                                if (!android.text.TextUtils.isEmpty(v2_29)) {
                                    boolean v4_12 = v2_29.split(" ");
                                    v3_14 = new String[v4_12.length];
                                    int v0_64 = 0;
                                    while (v0_64 < v4_12.length) {
                                        String v21 = v2_29;
                                        v3_14[v0_64] = android.provider.MediaStore$Audio.keyFor(v4_12[v0_64]).replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
                                        v0_64++;
                                        v2_29 = v21;
                                        String[] v6 = 0;
                                    }
                                }
                                v6_1 = v3_14;
                            }
                            if (v14.getQueryParameter("distinct") != null) {
                                v5_4.setDistinct(1);
                            }
                            String v15_0;
                            int v24;
                            int v9_0;
                            int v22 = 0;
                            if (v15_1 == 120) {
                                v24 = v7_1;
                                v15_0 = v9_1;
                                v9_0 = v5_4;
                                v9_0.setTables("album_art");
                                v9_0.appendWhere("album_id=?");
                                v15_0.add(((String) v14.getPathSegments().get(3)));
                            } else {
                                switch (v15_1) {
                                    case 1:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        break;
                                    case 2:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        v9_0.appendWhere("_id=?");
                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                        break;
                                    case 3:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        break;
                                    case 4:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v22 = 1;
                                        break;
                                    default:
                                        switch (v15_1) {
                                            case 100:
                                                int v0_100;
                                                v24 = v7_1;
                                                String v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && ((!p30.equalsIgnoreCase("is_music=1")) && (!p30.equalsIgnoreCase("is_podcast=1"))))))) {
                                                    v0_100 = 0;
                                                } else {
                                                    v0_100 = 0;
                                                    if ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null)) {
                                                        v9_0.setTables("audio_meta");
                                                        int v0_127 = v9_0.query(v24, p29, v12_1, this.combine(v15_0, p31), v16, 0, p32, v17);
                                                        if (v0_127 != 0) {
                                                            String v1_63 = v14.getQueryParameter("nonotify");
                                                            if ((v1_63 == null) || (!v1_63.equals("1"))) {
                                                                v0_127.setNotificationUri(this.getContext().getContentResolver(), v14);
                                                            }
                                                        }
                                                        return v0_127;
                                                    }
                                                }
                                                v9_0.setTables("audio");
                                                while ((v8_0 != null) && (v0_100 < v8_0.length)) {
                                                    if (v0_100 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_52 = new StringBuilder();
                                                    v1_52.append("%");
                                                    v1_52.append(v8_0[v0_100]);
                                                    v1_52.append("%");
                                                    v15_0.add(v1_52.toString());
                                                    v0_100++;
                                                }
                                            case 101:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 102:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id IN (SELECT genre_id FROM audio_genres_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 103:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 104:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id IN (SELECT playlist_id FROM audio_playlists_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 105:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 106:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                break;
                                            case 107:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 108:
                                            case 109:
                                                int v20_1;
                                                v24 = v7_1;
                                                int v7_0 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("genre_id=?"))))) {
                                                    v20_1 = 0;
                                                } else {
                                                    v20_1 = 1;
                                                }
                                                int v0_61 = v20_1;
                                                if (p29 != null) {
                                                    int v2_30 = v0_61;
                                                    int v0_62 = 0;
                                                    while (v0_62 < p29.length) {
                                                        int v3_26 = p29[v0_62];
                                                        if (v3_26.equals("_id")) {
                                                            v2_30 = 0;
                                                        }
                                                        if ((v2_30 != 0) && ((!v3_26.equals("audio_id")) && (!v3_26.equals("genre_id")))) {
                                                            v2_30 = 0;
                                                        }
                                                        v0_62++;
                                                    }
                                                    v0_61 = v2_30;
                                                }
                                                if (v0_61 == 0) {
                                                    v9_0.setTables("audio_genres_map_noid, audio");
                                                    v9_0.appendWhere("audio._id = audio_id");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere(" AND genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                    int v18_4 = 0;
                                                    while(true) {
                                                        String v1_34 = v18_4;
                                                        if ((v8_0 == null) || (v1_34 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v2_38 = new StringBuilder();
                                                        v2_38.append("%");
                                                        v2_38.append(v8_0[v1_34]);
                                                        v2_38.append("%");
                                                        v15_0.add(v2_38.toString());
                                                        v18_4 = (v1_34 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_genres_map_noid");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere("genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                }
                                                break;
                                            case 110:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                break;
                                            case 111:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 112:
                                            case 113:
                                                int v20_0;
                                                v24 = v7_1;
                                                int v26_2 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("playlist_id=?"))))) {
                                                    v20_0 = 0;
                                                } else {
                                                    v20_0 = 1;
                                                }
                                                int v2_25 = v20_0;
                                                if (p29 != null) {
                                                    int v3_5 = v2_25;
                                                    int v2_27 = 0;
                                                    while (v2_27 < p29.length) {
                                                        boolean v4_8 = p29[v2_27];
                                                        if ((v3_5 != 0) && ((!v4_8.equals("audio_id")) && ((!v4_8.equals("playlist_id")) && (!v4_8.equals("play_order"))))) {
                                                            v3_5 = 0;
                                                        }
                                                        if (v4_8.equals("_id")) {
                                                            p29[v2_27] = "audio_playlists_map._id AS _id";
                                                        }
                                                        v2_27++;
                                                    }
                                                    v2_25 = v3_5;
                                                }
                                                if (v2_25 == 0) {
                                                    v9_0.setTables("audio_playlists_map, audio");
                                                    v9_0.appendWhere("audio._id = audio_id AND playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    int v18_3 = 0;
                                                    while(true) {
                                                        String v1_26 = v18_3;
                                                        if ((v8_0 == null) || (v1_26 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v3_13 = new StringBuilder();
                                                        v3_13.append("%");
                                                        v3_13.append(v8_0[v1_26]);
                                                        v3_13.append("%");
                                                        v15_0.add(v3_13.toString());
                                                        v18_3 = (v1_26 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_playlists_map");
                                                    v9_0.appendWhere("playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                }
                                                if (v26_2 == 113) {
                                                    v9_0.appendWhere(" AND audio_playlists_map._id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(5)));
                                                }
                                                break;
                                            case 114:
                                                v24 = v7_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if (((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && (p30.length() != 0))))) || ((!p29[0].equalsIgnoreCase("count(*)")) || (v8_0 == null))) {
                                                    v9_0.setTables("artist_info");
                                                    int v18_2 = 0;
                                                    while(true) {
                                                        int v0_47 = v18_2;
                                                        if ((v8_0 == null) || (v0_47 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        if (v0_47 > 0) {
                                                            v9_0.appendWhere(" AND ");
                                                        }
                                                        v9_0.appendWhere("artist_key LIKE ? ESCAPE \'\\\'");
                                                        String v1_21 = new StringBuilder();
                                                        v1_21.append("%");
                                                        v1_21.append(v8_0[v0_47]);
                                                        v1_21.append("%");
                                                        v15_0.add(v1_21.toString());
                                                        v18_2 = (v0_47 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_meta");
                                                    p29[0] = "count(distinct artist_id)";
                                                    v9_0.appendWhere("is_music=1");
                                                }
                                                break;
                                            case 115:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("artist_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 116:
                                                String v12_2 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || (p31 != null))) {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                } else {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                    if (((p30 == null) || (p30.length() == 0)) && ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null))) {
                                                        v9_0.setTables("audio_meta");
                                                        p29[0] = "count(distinct album_id)";
                                                        v9_0.appendWhere("is_music=1");
                                                    }
                                                }
                                                v9_0.setTables("album_info");
                                                int v18_1 = 0;
                                                while(true) {
                                                    int v0_32 = v18_1;
                                                    if ((v8_0 == null) || (v0_32 >= v8_0.length)) {
                                                        break;
                                                    }
                                                    if (v0_32 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_12 = new StringBuilder();
                                                    v1_12.append("%");
                                                    v1_12.append(v8_0[v0_32]);
                                                    v1_12.append("%");
                                                    v15_0.add(v1_12.toString());
                                                    v18_1 = (v0_32 + 1);
                                                }
                                                break;
                                            case 117:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("album_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 118:
                                                String v12_0 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                int v0_20 = ((String) v14.getPathSegments().get(3));
                                                v9_0.setTables("audio LEFT OUTER JOIN album_art ON audio.album_id=album_art.album_id");
                                                v9_0.appendWhere("is_music=1 AND audio.album_id IN (SELECT album_id FROM artists_albums_map WHERE artist_id=?)");
                                                v15_0.add(v0_20);
                                                int v18_0 = 0;
                                                while(true) {
                                                    String v1_4 = v18_0;
                                                    if ((v12_0 == null) || (v1_4 >= v12_0.length)) {
                                                        break;
                                                    }
                                                    v9_0.appendWhere(" AND ");
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    int v2_10 = new StringBuilder();
                                                    v2_10.append("%");
                                                    v2_10.append(v12_0[v1_4]);
                                                    v2_10.append("%");
                                                    v15_0.add(v2_10.toString());
                                                    v18_0 = (v1_4 + 1);
                                                }
                                                boolean v4_2 = new StringBuilder();
                                                v4_2.append("count(CASE WHEN artist_id==");
                                                v4_2.append(v0_20);
                                                v4_2.append(" THEN \'foo\' ELSE NULL END) AS ");
                                                v4_2.append("numsongs_by_artist");
                                                com.android.providers.media.MediaProvider.sArtistAlbumsMap.put("numsongs_by_artist", v4_2.toString());
                                                v9_0.setProjectionMap(com.android.providers.media.MediaProvider.sArtistAlbumsMap);
                                                v16 = "audio.album_id";
                                                break;
                                            default:
                                                int v23_0;
                                                switch (v15_1) {
                                                    case 200:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v12_1 = p30;
                                                        break;
                                                    case 201:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v9_0.appendWhere("_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                        break;
                                                    case 202:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        break;
                                                    case 203:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v22 = 1;
                                                        break;
                                                    default:
                                                        switch (v15_1) {
                                                            case 400:
                                                                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Legacy media search Uri used. Please update your code.");
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            default:
                                                                switch (v15_1) {
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 701:
                                                                    case 703:
                                                                        v5_4.appendWhere("_id=?");
                                                                        v9_1.add(((String) v14.getPathSegments().get(2)));
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 704:
                                                                        return this.getObjectReferences(v8_1, v7_1, Integer.parseInt(((String) v14.getPathSegments().get(2))));
                                                                    default:
                                                                        String v1_65 = new StringBuilder();
                                                                        v1_65.append("Unknown URL: ");
                                                                        v1_65.append(v14.toString());
                                                                        throw new IllegalStateException(v1_65.toString());
                                                                }
                                                                v5_4.setTables("files");
                                                                v24 = v7_1;
                                                                v15_0 = v9_1;
                                                                v9_0 = v5_4;
                                                        }
                                                        String v15 = v9_1;
                                                        return this.doAudioSearch(v7_1, v5_4, v14, p29, p30, this.combine(v9_1, p31), p32, v15_1, v17);
                                                }
                                                if (this.queryThumbnail(v23_0, v14, "videothumbnails", "video_id", v22)) {
                                                    v9_0 = v23_0;
                                                } else {
                                                    return 0;
                                                }
                                        }
                                }
                                if (!this.queryThumbnail(v9_0, v14, "thumbnails", "image_id", v22)) {
                                    return 0;
                                }
                            }
                        } else {
                            return 0;
                        }
                    } else {
                        return 0;
                    }
                } else {
                    int v2_59 = new android.database.MatrixCursor(new String[] {"version"}));
                    String v1_71 = new Integer[1];
                    v1_71[0] = Integer.valueOf(com.android.providers.media.MediaProvider.getDatabaseVersion(this.getContext()));
                    v2_59.addRow(v1_71);
                    return v2_59;
                }
            } else {
                int v2_61 = new android.database.MatrixCursor(new String[] {"fsid"}));
                String v1_72 = new Integer[1];
                v1_72[0] = Integer.valueOf(this.mVolumeId);
                v2_61.addRow(v1_72);
                return v2_61;
            }
        } else {
            if (this.mMediaScannerVolume != null) {
                int v2_64 = new android.database.MatrixCursor(new String[] {"volume"}));
                String v1_73 = new String[1];
                v1_73[0] = this.mMediaScannerVolume;
                v2_64.addRow(v1_73);
                return v2_64;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.query() calling method android.database.sqlite.SQLiteQueryBuilder.appendWhere()


    public android.database.Cursor query(android.net.Uri p28, String[] p29, String p30, String[] p31, String p32)
    {
        String v12_1 = p30;
        android.net.Uri v14 = this.safeUncanonicalize(p28);
        String v15_1 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v14);
        int v9_1 = new java.util.ArrayList();
        if (v15_1 != 500) {
            if (v15_1 != 600) {
                if (v15_1 != 601) {
                    String v16 = 0;
                    String v8_1 = this.getDatabaseForUri(v14);
                    if (v8_1 != null) {
                        v8_1.mNumQueries = (v8_1.mNumQueries + 1);
                        int v7_1 = v8_1.getReadableDatabase();
                        if (v7_1 != 0) {
                            String[] v6_1;
                            boolean v5_4 = new android.database.sqlite.SQLiteQueryBuilder();
                            String v17 = v14.getQueryParameter("limit");
                            int v2_28 = v14.getQueryParameter("filter");
                            int v3_14 = 0;
                            if (v2_28 == 0) {
                                v6_1 = 0;
                            } else {
                                int v2_29 = android.net.Uri.decode(v2_28).trim();
                                if (!android.text.TextUtils.isEmpty(v2_29)) {
                                    boolean v4_12 = v2_29.split(" ");
                                    v3_14 = new String[v4_12.length];
                                    int v0_64 = 0;
                                    while (v0_64 < v4_12.length) {
                                        String v21 = v2_29;
                                        v3_14[v0_64] = android.provider.MediaStore$Audio.keyFor(v4_12[v0_64]).replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
                                        v0_64++;
                                        v2_29 = v21;
                                        String[] v6 = 0;
                                    }
                                }
                                v6_1 = v3_14;
                            }
                            if (v14.getQueryParameter("distinct") != null) {
                                v5_4.setDistinct(1);
                            }
                            String v15_0;
                            int v9_0;
                            int v24;
                            int v22 = 0;
                            if (v15_1 == 120) {
                                v24 = v7_1;
                                v15_0 = v9_1;
                                v9_0 = v5_4;
                                v9_0.setTables("album_art");
                                v9_0.appendWhere("album_id=?");
                                v15_0.add(((String) v14.getPathSegments().get(3)));
                            } else {
                                switch (v15_1) {
                                    case 1:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        break;
                                    case 2:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        v9_0.appendWhere("_id=?");
                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                        break;
                                    case 3:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        break;
                                    case 4:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v22 = 1;
                                        break;
                                    default:
                                        switch (v15_1) {
                                            case 100:
                                                int v0_100;
                                                v24 = v7_1;
                                                String v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && ((!p30.equalsIgnoreCase("is_music=1")) && (!p30.equalsIgnoreCase("is_podcast=1"))))))) {
                                                    v0_100 = 0;
                                                } else {
                                                    v0_100 = 0;
                                                    if ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null)) {
                                                        v9_0.setTables("audio_meta");
                                                        int v0_127 = v9_0.query(v24, p29, v12_1, this.combine(v15_0, p31), v16, 0, p32, v17);
                                                        if (v0_127 != 0) {
                                                            String v1_63 = v14.getQueryParameter("nonotify");
                                                            if ((v1_63 == null) || (!v1_63.equals("1"))) {
                                                                v0_127.setNotificationUri(this.getContext().getContentResolver(), v14);
                                                            }
                                                        }
                                                        return v0_127;
                                                    }
                                                }
                                                v9_0.setTables("audio");
                                                while ((v8_0 != null) && (v0_100 < v8_0.length)) {
                                                    if (v0_100 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_52 = new StringBuilder();
                                                    v1_52.append("%");
                                                    v1_52.append(v8_0[v0_100]);
                                                    v1_52.append("%");
                                                    v15_0.add(v1_52.toString());
                                                    v0_100++;
                                                }
                                            case 101:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 102:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id IN (SELECT genre_id FROM audio_genres_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 103:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 104:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id IN (SELECT playlist_id FROM audio_playlists_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 105:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 106:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                break;
                                            case 107:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 108:
                                            case 109:
                                                int v20_1;
                                                v24 = v7_1;
                                                int v7_0 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("genre_id=?"))))) {
                                                    v20_1 = 0;
                                                } else {
                                                    v20_1 = 1;
                                                }
                                                int v0_61 = v20_1;
                                                if (p29 != null) {
                                                    int v2_30 = v0_61;
                                                    int v0_62 = 0;
                                                    while (v0_62 < p29.length) {
                                                        int v3_26 = p29[v0_62];
                                                        if (v3_26.equals("_id")) {
                                                            v2_30 = 0;
                                                        }
                                                        if ((v2_30 != 0) && ((!v3_26.equals("audio_id")) && (!v3_26.equals("genre_id")))) {
                                                            v2_30 = 0;
                                                        }
                                                        v0_62++;
                                                    }
                                                    v0_61 = v2_30;
                                                }
                                                if (v0_61 == 0) {
                                                    v9_0.setTables("audio_genres_map_noid, audio");
                                                    v9_0.appendWhere("audio._id = audio_id");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere(" AND genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                    int v18_4 = 0;
                                                    while(true) {
                                                        String v1_34 = v18_4;
                                                        if ((v8_0 == null) || (v1_34 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v2_38 = new StringBuilder();
                                                        v2_38.append("%");
                                                        v2_38.append(v8_0[v1_34]);
                                                        v2_38.append("%");
                                                        v15_0.add(v2_38.toString());
                                                        v18_4 = (v1_34 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_genres_map_noid");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere("genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                }
                                                break;
                                            case 110:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                break;
                                            case 111:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 112:
                                            case 113:
                                                int v20_0;
                                                v24 = v7_1;
                                                int v26_2 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("playlist_id=?"))))) {
                                                    v20_0 = 0;
                                                } else {
                                                    v20_0 = 1;
                                                }
                                                int v2_25 = v20_0;
                                                if (p29 != null) {
                                                    int v3_5 = v2_25;
                                                    int v2_27 = 0;
                                                    while (v2_27 < p29.length) {
                                                        boolean v4_8 = p29[v2_27];
                                                        if ((v3_5 != 0) && ((!v4_8.equals("audio_id")) && ((!v4_8.equals("playlist_id")) && (!v4_8.equals("play_order"))))) {
                                                            v3_5 = 0;
                                                        }
                                                        if (v4_8.equals("_id")) {
                                                            p29[v2_27] = "audio_playlists_map._id AS _id";
                                                        }
                                                        v2_27++;
                                                    }
                                                    v2_25 = v3_5;
                                                }
                                                if (v2_25 == 0) {
                                                    v9_0.setTables("audio_playlists_map, audio");
                                                    v9_0.appendWhere("audio._id = audio_id AND playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    int v18_3 = 0;
                                                    while(true) {
                                                        String v1_26 = v18_3;
                                                        if ((v8_0 == null) || (v1_26 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v3_13 = new StringBuilder();
                                                        v3_13.append("%");
                                                        v3_13.append(v8_0[v1_26]);
                                                        v3_13.append("%");
                                                        v15_0.add(v3_13.toString());
                                                        v18_3 = (v1_26 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_playlists_map");
                                                    v9_0.appendWhere("playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                }
                                                if (v26_2 == 113) {
                                                    v9_0.appendWhere(" AND audio_playlists_map._id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(5)));
                                                }
                                                break;
                                            case 114:
                                                v24 = v7_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if (((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && (p30.length() != 0))))) || ((!p29[0].equalsIgnoreCase("count(*)")) || (v8_0 == null))) {
                                                    v9_0.setTables("artist_info");
                                                    int v18_2 = 0;
                                                    while(true) {
                                                        int v0_47 = v18_2;
                                                        if ((v8_0 == null) || (v0_47 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        if (v0_47 > 0) {
                                                            v9_0.appendWhere(" AND ");
                                                        }
                                                        v9_0.appendWhere("artist_key LIKE ? ESCAPE \'\\\'");
                                                        String v1_21 = new StringBuilder();
                                                        v1_21.append("%");
                                                        v1_21.append(v8_0[v0_47]);
                                                        v1_21.append("%");
                                                        v15_0.add(v1_21.toString());
                                                        v18_2 = (v0_47 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_meta");
                                                    p29[0] = "count(distinct artist_id)";
                                                    v9_0.appendWhere("is_music=1");
                                                }
                                                break;
                                            case 115:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("artist_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 116:
                                                String v12_2 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || (p31 != null))) {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                } else {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                    if (((p30 == null) || (p30.length() == 0)) && ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null))) {
                                                        v9_0.setTables("audio_meta");
                                                        p29[0] = "count(distinct album_id)";
                                                        v9_0.appendWhere("is_music=1");
                                                    }
                                                }
                                                v9_0.setTables("album_info");
                                                int v18_1 = 0;
                                                while(true) {
                                                    int v0_32 = v18_1;
                                                    if ((v8_0 == null) || (v0_32 >= v8_0.length)) {
                                                        break;
                                                    }
                                                    if (v0_32 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_12 = new StringBuilder();
                                                    v1_12.append("%");
                                                    v1_12.append(v8_0[v0_32]);
                                                    v1_12.append("%");
                                                    v15_0.add(v1_12.toString());
                                                    v18_1 = (v0_32 + 1);
                                                }
                                                break;
                                            case 117:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("album_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 118:
                                                String v12_0 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                int v0_20 = ((String) v14.getPathSegments().get(3));
                                                v9_0.setTables("audio LEFT OUTER JOIN album_art ON audio.album_id=album_art.album_id");
                                                v9_0.appendWhere("is_music=1 AND audio.album_id IN (SELECT album_id FROM artists_albums_map WHERE artist_id=?)");
                                                v15_0.add(v0_20);
                                                int v18_0 = 0;
                                                while(true) {
                                                    String v1_4 = v18_0;
                                                    if ((v12_0 == null) || (v1_4 >= v12_0.length)) {
                                                        break;
                                                    }
                                                    v9_0.appendWhere(" AND ");
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    int v2_10 = new StringBuilder();
                                                    v2_10.append("%");
                                                    v2_10.append(v12_0[v1_4]);
                                                    v2_10.append("%");
                                                    v15_0.add(v2_10.toString());
                                                    v18_0 = (v1_4 + 1);
                                                }
                                                boolean v4_2 = new StringBuilder();
                                                v4_2.append("count(CASE WHEN artist_id==");
                                                v4_2.append(v0_20);
                                                v4_2.append(" THEN \'foo\' ELSE NULL END) AS ");
                                                v4_2.append("numsongs_by_artist");
                                                com.android.providers.media.MediaProvider.sArtistAlbumsMap.put("numsongs_by_artist", v4_2.toString());
                                                v9_0.setProjectionMap(com.android.providers.media.MediaProvider.sArtistAlbumsMap);
                                                v16 = "audio.album_id";
                                                break;
                                            default:
                                                int v23_0;
                                                switch (v15_1) {
                                                    case 200:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v12_1 = p30;
                                                        break;
                                                    case 201:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v9_0.appendWhere("_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                        break;
                                                    case 202:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        break;
                                                    case 203:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v22 = 1;
                                                        break;
                                                    default:
                                                        switch (v15_1) {
                                                            case 400:
                                                                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Legacy media search Uri used. Please update your code.");
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            default:
                                                                switch (v15_1) {
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 701:
                                                                    case 703:
                                                                        v5_4.appendWhere("_id=?");
                                                                        v9_1.add(((String) v14.getPathSegments().get(2)));
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 704:
                                                                        return this.getObjectReferences(v8_1, v7_1, Integer.parseInt(((String) v14.getPathSegments().get(2))));
                                                                    default:
                                                                        String v1_65 = new StringBuilder();
                                                                        v1_65.append("Unknown URL: ");
                                                                        v1_65.append(v14.toString());
                                                                        throw new IllegalStateException(v1_65.toString());
                                                                }
                                                                v5_4.setTables("files");
                                                                v24 = v7_1;
                                                                v15_0 = v9_1;
                                                                v9_0 = v5_4;
                                                        }
                                                        String v15 = v9_1;
                                                        return this.doAudioSearch(v7_1, v5_4, v14, p29, p30, this.combine(v9_1, p31), p32, v15_1, v17);
                                                }
                                                if (this.queryThumbnail(v23_0, v14, "videothumbnails", "video_id", v22)) {
                                                    v9_0 = v23_0;
                                                } else {
                                                    return 0;
                                                }
                                        }
                                }
                                if (!this.queryThumbnail(v9_0, v14, "thumbnails", "image_id", v22)) {
                                    return 0;
                                }
                            }
                        } else {
                            return 0;
                        }
                    } else {
                        return 0;
                    }
                } else {
                    int v2_59 = new android.database.MatrixCursor(new String[] {"version"}));
                    String v1_71 = new Integer[1];
                    v1_71[0] = Integer.valueOf(com.android.providers.media.MediaProvider.getDatabaseVersion(this.getContext()));
                    v2_59.addRow(v1_71);
                    return v2_59;
                }
            } else {
                int v2_61 = new android.database.MatrixCursor(new String[] {"fsid"}));
                String v1_72 = new Integer[1];
                v1_72[0] = Integer.valueOf(this.mVolumeId);
                v2_61.addRow(v1_72);
                return v2_61;
            }
        } else {
            if (this.mMediaScannerVolume != null) {
                int v2_64 = new android.database.MatrixCursor(new String[] {"volume"}));
                String v1_73 = new String[1];
                v1_73[0] = this.mMediaScannerVolume;
                v2_64.addRow(v1_73);
                return v2_64;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.query() calling method android.database.sqlite.SQLiteQueryBuilder.appendWhere()


    public android.database.Cursor query(android.net.Uri p28, String[] p29, String p30, String[] p31, String p32)
    {
        String v12_1 = p30;
        android.net.Uri v14 = this.safeUncanonicalize(p28);
        String v15_1 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v14);
        int v9_1 = new java.util.ArrayList();
        if (v15_1 != 500) {
            if (v15_1 != 600) {
                if (v15_1 != 601) {
                    String v16 = 0;
                    String v8_1 = this.getDatabaseForUri(v14);
                    if (v8_1 != null) {
                        v8_1.mNumQueries = (v8_1.mNumQueries + 1);
                        int v7_1 = v8_1.getReadableDatabase();
                        if (v7_1 != 0) {
                            String[] v6_1;
                            boolean v5_4 = new android.database.sqlite.SQLiteQueryBuilder();
                            String v17 = v14.getQueryParameter("limit");
                            int v2_28 = v14.getQueryParameter("filter");
                            int v3_14 = 0;
                            if (v2_28 == 0) {
                                v6_1 = 0;
                            } else {
                                int v2_29 = android.net.Uri.decode(v2_28).trim();
                                if (!android.text.TextUtils.isEmpty(v2_29)) {
                                    boolean v4_12 = v2_29.split(" ");
                                    v3_14 = new String[v4_12.length];
                                    int v0_64 = 0;
                                    while (v0_64 < v4_12.length) {
                                        String v21 = v2_29;
                                        v3_14[v0_64] = android.provider.MediaStore$Audio.keyFor(v4_12[v0_64]).replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
                                        v0_64++;
                                        v2_29 = v21;
                                        String[] v6 = 0;
                                    }
                                }
                                v6_1 = v3_14;
                            }
                            if (v14.getQueryParameter("distinct") != null) {
                                v5_4.setDistinct(1);
                            }
                            int v9_0;
                            int v24;
                            String v15_0;
                            int v22 = 0;
                            if (v15_1 == 120) {
                                v24 = v7_1;
                                v15_0 = v9_1;
                                v9_0 = v5_4;
                                v9_0.setTables("album_art");
                                v9_0.appendWhere("album_id=?");
                                v15_0.add(((String) v14.getPathSegments().get(3)));
                            } else {
                                switch (v15_1) {
                                    case 1:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        break;
                                    case 2:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        v9_0.appendWhere("_id=?");
                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                        break;
                                    case 3:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        break;
                                    case 4:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v22 = 1;
                                        break;
                                    default:
                                        switch (v15_1) {
                                            case 100:
                                                int v0_100;
                                                v24 = v7_1;
                                                String v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && ((!p30.equalsIgnoreCase("is_music=1")) && (!p30.equalsIgnoreCase("is_podcast=1"))))))) {
                                                    v0_100 = 0;
                                                } else {
                                                    v0_100 = 0;
                                                    if ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null)) {
                                                        v9_0.setTables("audio_meta");
                                                        int v0_127 = v9_0.query(v24, p29, v12_1, this.combine(v15_0, p31), v16, 0, p32, v17);
                                                        if (v0_127 != 0) {
                                                            String v1_63 = v14.getQueryParameter("nonotify");
                                                            if ((v1_63 == null) || (!v1_63.equals("1"))) {
                                                                v0_127.setNotificationUri(this.getContext().getContentResolver(), v14);
                                                            }
                                                        }
                                                        return v0_127;
                                                    }
                                                }
                                                v9_0.setTables("audio");
                                                while ((v8_0 != null) && (v0_100 < v8_0.length)) {
                                                    if (v0_100 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_52 = new StringBuilder();
                                                    v1_52.append("%");
                                                    v1_52.append(v8_0[v0_100]);
                                                    v1_52.append("%");
                                                    v15_0.add(v1_52.toString());
                                                    v0_100++;
                                                }
                                            case 101:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 102:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id IN (SELECT genre_id FROM audio_genres_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 103:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 104:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id IN (SELECT playlist_id FROM audio_playlists_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 105:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 106:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                break;
                                            case 107:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 108:
                                            case 109:
                                                int v20_1;
                                                v24 = v7_1;
                                                int v7_0 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("genre_id=?"))))) {
                                                    v20_1 = 0;
                                                } else {
                                                    v20_1 = 1;
                                                }
                                                int v0_61 = v20_1;
                                                if (p29 != null) {
                                                    int v2_30 = v0_61;
                                                    int v0_62 = 0;
                                                    while (v0_62 < p29.length) {
                                                        int v3_26 = p29[v0_62];
                                                        if (v3_26.equals("_id")) {
                                                            v2_30 = 0;
                                                        }
                                                        if ((v2_30 != 0) && ((!v3_26.equals("audio_id")) && (!v3_26.equals("genre_id")))) {
                                                            v2_30 = 0;
                                                        }
                                                        v0_62++;
                                                    }
                                                    v0_61 = v2_30;
                                                }
                                                if (v0_61 == 0) {
                                                    v9_0.setTables("audio_genres_map_noid, audio");
                                                    v9_0.appendWhere("audio._id = audio_id");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere(" AND genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                    int v18_4 = 0;
                                                    while(true) {
                                                        String v1_34 = v18_4;
                                                        if ((v8_0 == null) || (v1_34 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v2_38 = new StringBuilder();
                                                        v2_38.append("%");
                                                        v2_38.append(v8_0[v1_34]);
                                                        v2_38.append("%");
                                                        v15_0.add(v2_38.toString());
                                                        v18_4 = (v1_34 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_genres_map_noid");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere("genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                }
                                                break;
                                            case 110:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                break;
                                            case 111:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 112:
                                            case 113:
                                                int v20_0;
                                                v24 = v7_1;
                                                int v26_2 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("playlist_id=?"))))) {
                                                    v20_0 = 0;
                                                } else {
                                                    v20_0 = 1;
                                                }
                                                int v2_25 = v20_0;
                                                if (p29 != null) {
                                                    int v3_5 = v2_25;
                                                    int v2_27 = 0;
                                                    while (v2_27 < p29.length) {
                                                        boolean v4_8 = p29[v2_27];
                                                        if ((v3_5 != 0) && ((!v4_8.equals("audio_id")) && ((!v4_8.equals("playlist_id")) && (!v4_8.equals("play_order"))))) {
                                                            v3_5 = 0;
                                                        }
                                                        if (v4_8.equals("_id")) {
                                                            p29[v2_27] = "audio_playlists_map._id AS _id";
                                                        }
                                                        v2_27++;
                                                    }
                                                    v2_25 = v3_5;
                                                }
                                                if (v2_25 == 0) {
                                                    v9_0.setTables("audio_playlists_map, audio");
                                                    v9_0.appendWhere("audio._id = audio_id AND playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    int v18_3 = 0;
                                                    while(true) {
                                                        String v1_26 = v18_3;
                                                        if ((v8_0 == null) || (v1_26 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v3_13 = new StringBuilder();
                                                        v3_13.append("%");
                                                        v3_13.append(v8_0[v1_26]);
                                                        v3_13.append("%");
                                                        v15_0.add(v3_13.toString());
                                                        v18_3 = (v1_26 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_playlists_map");
                                                    v9_0.appendWhere("playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                }
                                                if (v26_2 == 113) {
                                                    v9_0.appendWhere(" AND audio_playlists_map._id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(5)));
                                                }
                                                break;
                                            case 114:
                                                v24 = v7_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if (((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && (p30.length() != 0))))) || ((!p29[0].equalsIgnoreCase("count(*)")) || (v8_0 == null))) {
                                                    v9_0.setTables("artist_info");
                                                    int v18_2 = 0;
                                                    while(true) {
                                                        int v0_47 = v18_2;
                                                        if ((v8_0 == null) || (v0_47 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        if (v0_47 > 0) {
                                                            v9_0.appendWhere(" AND ");
                                                        }
                                                        v9_0.appendWhere("artist_key LIKE ? ESCAPE \'\\\'");
                                                        String v1_21 = new StringBuilder();
                                                        v1_21.append("%");
                                                        v1_21.append(v8_0[v0_47]);
                                                        v1_21.append("%");
                                                        v15_0.add(v1_21.toString());
                                                        v18_2 = (v0_47 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_meta");
                                                    p29[0] = "count(distinct artist_id)";
                                                    v9_0.appendWhere("is_music=1");
                                                }
                                                break;
                                            case 115:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("artist_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 116:
                                                String v12_2 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || (p31 != null))) {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                } else {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                    if (((p30 == null) || (p30.length() == 0)) && ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null))) {
                                                        v9_0.setTables("audio_meta");
                                                        p29[0] = "count(distinct album_id)";
                                                        v9_0.appendWhere("is_music=1");
                                                    }
                                                }
                                                v9_0.setTables("album_info");
                                                int v18_1 = 0;
                                                while(true) {
                                                    int v0_32 = v18_1;
                                                    if ((v8_0 == null) || (v0_32 >= v8_0.length)) {
                                                        break;
                                                    }
                                                    if (v0_32 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_12 = new StringBuilder();
                                                    v1_12.append("%");
                                                    v1_12.append(v8_0[v0_32]);
                                                    v1_12.append("%");
                                                    v15_0.add(v1_12.toString());
                                                    v18_1 = (v0_32 + 1);
                                                }
                                                break;
                                            case 117:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("album_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 118:
                                                String v12_0 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                int v0_20 = ((String) v14.getPathSegments().get(3));
                                                v9_0.setTables("audio LEFT OUTER JOIN album_art ON audio.album_id=album_art.album_id");
                                                v9_0.appendWhere("is_music=1 AND audio.album_id IN (SELECT album_id FROM artists_albums_map WHERE artist_id=?)");
                                                v15_0.add(v0_20);
                                                int v18_0 = 0;
                                                while(true) {
                                                    String v1_4 = v18_0;
                                                    if ((v12_0 == null) || (v1_4 >= v12_0.length)) {
                                                        break;
                                                    }
                                                    v9_0.appendWhere(" AND ");
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    int v2_10 = new StringBuilder();
                                                    v2_10.append("%");
                                                    v2_10.append(v12_0[v1_4]);
                                                    v2_10.append("%");
                                                    v15_0.add(v2_10.toString());
                                                    v18_0 = (v1_4 + 1);
                                                }
                                                boolean v4_2 = new StringBuilder();
                                                v4_2.append("count(CASE WHEN artist_id==");
                                                v4_2.append(v0_20);
                                                v4_2.append(" THEN \'foo\' ELSE NULL END) AS ");
                                                v4_2.append("numsongs_by_artist");
                                                com.android.providers.media.MediaProvider.sArtistAlbumsMap.put("numsongs_by_artist", v4_2.toString());
                                                v9_0.setProjectionMap(com.android.providers.media.MediaProvider.sArtistAlbumsMap);
                                                v16 = "audio.album_id";
                                                break;
                                            default:
                                                int v23_0;
                                                switch (v15_1) {
                                                    case 200:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v12_1 = p30;
                                                        break;
                                                    case 201:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v9_0.appendWhere("_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                        break;
                                                    case 202:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        break;
                                                    case 203:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v22 = 1;
                                                        break;
                                                    default:
                                                        switch (v15_1) {
                                                            case 400:
                                                                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Legacy media search Uri used. Please update your code.");
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            default:
                                                                switch (v15_1) {
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 701:
                                                                    case 703:
                                                                        v5_4.appendWhere("_id=?");
                                                                        v9_1.add(((String) v14.getPathSegments().get(2)));
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 704:
                                                                        return this.getObjectReferences(v8_1, v7_1, Integer.parseInt(((String) v14.getPathSegments().get(2))));
                                                                    default:
                                                                        String v1_65 = new StringBuilder();
                                                                        v1_65.append("Unknown URL: ");
                                                                        v1_65.append(v14.toString());
                                                                        throw new IllegalStateException(v1_65.toString());
                                                                }
                                                                v5_4.setTables("files");
                                                                v24 = v7_1;
                                                                v15_0 = v9_1;
                                                                v9_0 = v5_4;
                                                        }
                                                        String v15 = v9_1;
                                                        return this.doAudioSearch(v7_1, v5_4, v14, p29, p30, this.combine(v9_1, p31), p32, v15_1, v17);
                                                }
                                                if (this.queryThumbnail(v23_0, v14, "videothumbnails", "video_id", v22)) {
                                                    v9_0 = v23_0;
                                                } else {
                                                    return 0;
                                                }
                                        }
                                }
                                if (!this.queryThumbnail(v9_0, v14, "thumbnails", "image_id", v22)) {
                                    return 0;
                                }
                            }
                        } else {
                            return 0;
                        }
                    } else {
                        return 0;
                    }
                } else {
                    int v2_59 = new android.database.MatrixCursor(new String[] {"version"}));
                    String v1_71 = new Integer[1];
                    v1_71[0] = Integer.valueOf(com.android.providers.media.MediaProvider.getDatabaseVersion(this.getContext()));
                    v2_59.addRow(v1_71);
                    return v2_59;
                }
            } else {
                int v2_61 = new android.database.MatrixCursor(new String[] {"fsid"}));
                String v1_72 = new Integer[1];
                v1_72[0] = Integer.valueOf(this.mVolumeId);
                v2_61.addRow(v1_72);
                return v2_61;
            }
        } else {
            if (this.mMediaScannerVolume != null) {
                int v2_64 = new android.database.MatrixCursor(new String[] {"volume"}));
                String v1_73 = new String[1];
                v1_73[0] = this.mMediaScannerVolume;
                v2_64.addRow(v1_73);
                return v2_64;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.query() calling method android.database.sqlite.SQLiteQueryBuilder.appendWhere()


    public android.database.Cursor query(android.net.Uri p28, String[] p29, String p30, String[] p31, String p32)
    {
        String v12_1 = p30;
        android.net.Uri v14 = this.safeUncanonicalize(p28);
        String v15_1 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v14);
        int v9_1 = new java.util.ArrayList();
        if (v15_1 != 500) {
            if (v15_1 != 600) {
                if (v15_1 != 601) {
                    String v16 = 0;
                    String v8_1 = this.getDatabaseForUri(v14);
                    if (v8_1 != null) {
                        v8_1.mNumQueries = (v8_1.mNumQueries + 1);
                        int v7_1 = v8_1.getReadableDatabase();
                        if (v7_1 != 0) {
                            String[] v6_1;
                            boolean v5_4 = new android.database.sqlite.SQLiteQueryBuilder();
                            String v17 = v14.getQueryParameter("limit");
                            int v2_28 = v14.getQueryParameter("filter");
                            int v3_14 = 0;
                            if (v2_28 == 0) {
                                v6_1 = 0;
                            } else {
                                int v2_29 = android.net.Uri.decode(v2_28).trim();
                                if (!android.text.TextUtils.isEmpty(v2_29)) {
                                    boolean v4_12 = v2_29.split(" ");
                                    v3_14 = new String[v4_12.length];
                                    int v0_64 = 0;
                                    while (v0_64 < v4_12.length) {
                                        String v21 = v2_29;
                                        v3_14[v0_64] = android.provider.MediaStore$Audio.keyFor(v4_12[v0_64]).replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
                                        v0_64++;
                                        v2_29 = v21;
                                        String[] v6 = 0;
                                    }
                                }
                                v6_1 = v3_14;
                            }
                            if (v14.getQueryParameter("distinct") != null) {
                                v5_4.setDistinct(1);
                            }
                            int v24;
                            int v9_0;
                            String v15_0;
                            int v22 = 0;
                            if (v15_1 == 120) {
                                v24 = v7_1;
                                v15_0 = v9_1;
                                v9_0 = v5_4;
                                v9_0.setTables("album_art");
                                v9_0.appendWhere("album_id=?");
                                v15_0.add(((String) v14.getPathSegments().get(3)));
                            } else {
                                switch (v15_1) {
                                    case 1:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        break;
                                    case 2:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        v9_0.appendWhere("_id=?");
                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                        break;
                                    case 3:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        break;
                                    case 4:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v22 = 1;
                                        break;
                                    default:
                                        switch (v15_1) {
                                            case 100:
                                                int v0_100;
                                                v24 = v7_1;
                                                String v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && ((!p30.equalsIgnoreCase("is_music=1")) && (!p30.equalsIgnoreCase("is_podcast=1"))))))) {
                                                    v0_100 = 0;
                                                } else {
                                                    v0_100 = 0;
                                                    if ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null)) {
                                                        v9_0.setTables("audio_meta");
                                                        int v0_127 = v9_0.query(v24, p29, v12_1, this.combine(v15_0, p31), v16, 0, p32, v17);
                                                        if (v0_127 != 0) {
                                                            String v1_63 = v14.getQueryParameter("nonotify");
                                                            if ((v1_63 == null) || (!v1_63.equals("1"))) {
                                                                v0_127.setNotificationUri(this.getContext().getContentResolver(), v14);
                                                            }
                                                        }
                                                        return v0_127;
                                                    }
                                                }
                                                v9_0.setTables("audio");
                                                while ((v8_0 != null) && (v0_100 < v8_0.length)) {
                                                    if (v0_100 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_52 = new StringBuilder();
                                                    v1_52.append("%");
                                                    v1_52.append(v8_0[v0_100]);
                                                    v1_52.append("%");
                                                    v15_0.add(v1_52.toString());
                                                    v0_100++;
                                                }
                                            case 101:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 102:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id IN (SELECT genre_id FROM audio_genres_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 103:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 104:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id IN (SELECT playlist_id FROM audio_playlists_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 105:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 106:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                break;
                                            case 107:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 108:
                                            case 109:
                                                int v20_1;
                                                v24 = v7_1;
                                                int v7_0 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("genre_id=?"))))) {
                                                    v20_1 = 0;
                                                } else {
                                                    v20_1 = 1;
                                                }
                                                int v0_61 = v20_1;
                                                if (p29 != null) {
                                                    int v2_30 = v0_61;
                                                    int v0_62 = 0;
                                                    while (v0_62 < p29.length) {
                                                        int v3_26 = p29[v0_62];
                                                        if (v3_26.equals("_id")) {
                                                            v2_30 = 0;
                                                        }
                                                        if ((v2_30 != 0) && ((!v3_26.equals("audio_id")) && (!v3_26.equals("genre_id")))) {
                                                            v2_30 = 0;
                                                        }
                                                        v0_62++;
                                                    }
                                                    v0_61 = v2_30;
                                                }
                                                if (v0_61 == 0) {
                                                    v9_0.setTables("audio_genres_map_noid, audio");
                                                    v9_0.appendWhere("audio._id = audio_id");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere(" AND genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                    int v18_4 = 0;
                                                    while(true) {
                                                        String v1_34 = v18_4;
                                                        if ((v8_0 == null) || (v1_34 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v2_38 = new StringBuilder();
                                                        v2_38.append("%");
                                                        v2_38.append(v8_0[v1_34]);
                                                        v2_38.append("%");
                                                        v15_0.add(v2_38.toString());
                                                        v18_4 = (v1_34 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_genres_map_noid");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere("genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                }
                                                break;
                                            case 110:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                break;
                                            case 111:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 112:
                                            case 113:
                                                int v20_0;
                                                v24 = v7_1;
                                                int v26_2 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("playlist_id=?"))))) {
                                                    v20_0 = 0;
                                                } else {
                                                    v20_0 = 1;
                                                }
                                                int v2_25 = v20_0;
                                                if (p29 != null) {
                                                    int v3_5 = v2_25;
                                                    int v2_27 = 0;
                                                    while (v2_27 < p29.length) {
                                                        boolean v4_8 = p29[v2_27];
                                                        if ((v3_5 != 0) && ((!v4_8.equals("audio_id")) && ((!v4_8.equals("playlist_id")) && (!v4_8.equals("play_order"))))) {
                                                            v3_5 = 0;
                                                        }
                                                        if (v4_8.equals("_id")) {
                                                            p29[v2_27] = "audio_playlists_map._id AS _id";
                                                        }
                                                        v2_27++;
                                                    }
                                                    v2_25 = v3_5;
                                                }
                                                if (v2_25 == 0) {
                                                    v9_0.setTables("audio_playlists_map, audio");
                                                    v9_0.appendWhere("audio._id = audio_id AND playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    int v18_3 = 0;
                                                    while(true) {
                                                        String v1_26 = v18_3;
                                                        if ((v8_0 == null) || (v1_26 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v3_13 = new StringBuilder();
                                                        v3_13.append("%");
                                                        v3_13.append(v8_0[v1_26]);
                                                        v3_13.append("%");
                                                        v15_0.add(v3_13.toString());
                                                        v18_3 = (v1_26 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_playlists_map");
                                                    v9_0.appendWhere("playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                }
                                                if (v26_2 == 113) {
                                                    v9_0.appendWhere(" AND audio_playlists_map._id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(5)));
                                                }
                                                break;
                                            case 114:
                                                v24 = v7_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if (((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && (p30.length() != 0))))) || ((!p29[0].equalsIgnoreCase("count(*)")) || (v8_0 == null))) {
                                                    v9_0.setTables("artist_info");
                                                    int v18_2 = 0;
                                                    while(true) {
                                                        int v0_47 = v18_2;
                                                        if ((v8_0 == null) || (v0_47 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        if (v0_47 > 0) {
                                                            v9_0.appendWhere(" AND ");
                                                        }
                                                        v9_0.appendWhere("artist_key LIKE ? ESCAPE \'\\\'");
                                                        String v1_21 = new StringBuilder();
                                                        v1_21.append("%");
                                                        v1_21.append(v8_0[v0_47]);
                                                        v1_21.append("%");
                                                        v15_0.add(v1_21.toString());
                                                        v18_2 = (v0_47 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_meta");
                                                    p29[0] = "count(distinct artist_id)";
                                                    v9_0.appendWhere("is_music=1");
                                                }
                                                break;
                                            case 115:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("artist_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 116:
                                                String v12_2 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || (p31 != null))) {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                } else {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                    if (((p30 == null) || (p30.length() == 0)) && ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null))) {
                                                        v9_0.setTables("audio_meta");
                                                        p29[0] = "count(distinct album_id)";
                                                        v9_0.appendWhere("is_music=1");
                                                    }
                                                }
                                                v9_0.setTables("album_info");
                                                int v18_1 = 0;
                                                while(true) {
                                                    int v0_32 = v18_1;
                                                    if ((v8_0 == null) || (v0_32 >= v8_0.length)) {
                                                        break;
                                                    }
                                                    if (v0_32 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_12 = new StringBuilder();
                                                    v1_12.append("%");
                                                    v1_12.append(v8_0[v0_32]);
                                                    v1_12.append("%");
                                                    v15_0.add(v1_12.toString());
                                                    v18_1 = (v0_32 + 1);
                                                }
                                                break;
                                            case 117:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("album_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 118:
                                                String v12_0 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                int v0_20 = ((String) v14.getPathSegments().get(3));
                                                v9_0.setTables("audio LEFT OUTER JOIN album_art ON audio.album_id=album_art.album_id");
                                                v9_0.appendWhere("is_music=1 AND audio.album_id IN (SELECT album_id FROM artists_albums_map WHERE artist_id=?)");
                                                v15_0.add(v0_20);
                                                int v18_0 = 0;
                                                while(true) {
                                                    String v1_4 = v18_0;
                                                    if ((v12_0 == null) || (v1_4 >= v12_0.length)) {
                                                        break;
                                                    }
                                                    v9_0.appendWhere(" AND ");
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    int v2_10 = new StringBuilder();
                                                    v2_10.append("%");
                                                    v2_10.append(v12_0[v1_4]);
                                                    v2_10.append("%");
                                                    v15_0.add(v2_10.toString());
                                                    v18_0 = (v1_4 + 1);
                                                }
                                                boolean v4_2 = new StringBuilder();
                                                v4_2.append("count(CASE WHEN artist_id==");
                                                v4_2.append(v0_20);
                                                v4_2.append(" THEN \'foo\' ELSE NULL END) AS ");
                                                v4_2.append("numsongs_by_artist");
                                                com.android.providers.media.MediaProvider.sArtistAlbumsMap.put("numsongs_by_artist", v4_2.toString());
                                                v9_0.setProjectionMap(com.android.providers.media.MediaProvider.sArtistAlbumsMap);
                                                v16 = "audio.album_id";
                                                break;
                                            default:
                                                int v23_0;
                                                switch (v15_1) {
                                                    case 200:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v12_1 = p30;
                                                        break;
                                                    case 201:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v9_0.appendWhere("_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                        break;
                                                    case 202:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        break;
                                                    case 203:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v22 = 1;
                                                        break;
                                                    default:
                                                        switch (v15_1) {
                                                            case 400:
                                                                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Legacy media search Uri used. Please update your code.");
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            default:
                                                                switch (v15_1) {
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 701:
                                                                    case 703:
                                                                        v5_4.appendWhere("_id=?");
                                                                        v9_1.add(((String) v14.getPathSegments().get(2)));
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 704:
                                                                        return this.getObjectReferences(v8_1, v7_1, Integer.parseInt(((String) v14.getPathSegments().get(2))));
                                                                    default:
                                                                        String v1_65 = new StringBuilder();
                                                                        v1_65.append("Unknown URL: ");
                                                                        v1_65.append(v14.toString());
                                                                        throw new IllegalStateException(v1_65.toString());
                                                                }
                                                                v5_4.setTables("files");
                                                                v24 = v7_1;
                                                                v15_0 = v9_1;
                                                                v9_0 = v5_4;
                                                        }
                                                        String v15 = v9_1;
                                                        return this.doAudioSearch(v7_1, v5_4, v14, p29, p30, this.combine(v9_1, p31), p32, v15_1, v17);
                                                }
                                                if (this.queryThumbnail(v23_0, v14, "videothumbnails", "video_id", v22)) {
                                                    v9_0 = v23_0;
                                                } else {
                                                    return 0;
                                                }
                                        }
                                }
                                if (!this.queryThumbnail(v9_0, v14, "thumbnails", "image_id", v22)) {
                                    return 0;
                                }
                            }
                        } else {
                            return 0;
                        }
                    } else {
                        return 0;
                    }
                } else {
                    int v2_59 = new android.database.MatrixCursor(new String[] {"version"}));
                    String v1_71 = new Integer[1];
                    v1_71[0] = Integer.valueOf(com.android.providers.media.MediaProvider.getDatabaseVersion(this.getContext()));
                    v2_59.addRow(v1_71);
                    return v2_59;
                }
            } else {
                int v2_61 = new android.database.MatrixCursor(new String[] {"fsid"}));
                String v1_72 = new Integer[1];
                v1_72[0] = Integer.valueOf(this.mVolumeId);
                v2_61.addRow(v1_72);
                return v2_61;
            }
        } else {
            if (this.mMediaScannerVolume != null) {
                int v2_64 = new android.database.MatrixCursor(new String[] {"volume"}));
                String v1_73 = new String[1];
                v1_73[0] = this.mMediaScannerVolume;
                v2_64.addRow(v1_73);
                return v2_64;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.query() calling method android.database.sqlite.SQLiteQueryBuilder.appendWhere()


    public android.database.Cursor query(android.net.Uri p28, String[] p29, String p30, String[] p31, String p32)
    {
        String v12_1 = p30;
        android.net.Uri v14 = this.safeUncanonicalize(p28);
        String v15_1 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v14);
        int v9_1 = new java.util.ArrayList();
        if (v15_1 != 500) {
            if (v15_1 != 600) {
                if (v15_1 != 601) {
                    String v16 = 0;
                    String v8_1 = this.getDatabaseForUri(v14);
                    if (v8_1 != null) {
                        v8_1.mNumQueries = (v8_1.mNumQueries + 1);
                        int v7_1 = v8_1.getReadableDatabase();
                        if (v7_1 != 0) {
                            String[] v6_1;
                            boolean v5_4 = new android.database.sqlite.SQLiteQueryBuilder();
                            String v17 = v14.getQueryParameter("limit");
                            int v2_28 = v14.getQueryParameter("filter");
                            int v3_14 = 0;
                            if (v2_28 == 0) {
                                v6_1 = 0;
                            } else {
                                int v2_29 = android.net.Uri.decode(v2_28).trim();
                                if (!android.text.TextUtils.isEmpty(v2_29)) {
                                    boolean v4_12 = v2_29.split(" ");
                                    v3_14 = new String[v4_12.length];
                                    int v0_64 = 0;
                                    while (v0_64 < v4_12.length) {
                                        String v21 = v2_29;
                                        v3_14[v0_64] = android.provider.MediaStore$Audio.keyFor(v4_12[v0_64]).replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
                                        v0_64++;
                                        v2_29 = v21;
                                        String[] v6 = 0;
                                    }
                                }
                                v6_1 = v3_14;
                            }
                            if (v14.getQueryParameter("distinct") != null) {
                                v5_4.setDistinct(1);
                            }
                            int v9_0;
                            String v15_0;
                            int v24;
                            int v22 = 0;
                            if (v15_1 == 120) {
                                v24 = v7_1;
                                v15_0 = v9_1;
                                v9_0 = v5_4;
                                v9_0.setTables("album_art");
                                v9_0.appendWhere("album_id=?");
                                v15_0.add(((String) v14.getPathSegments().get(3)));
                            } else {
                                switch (v15_1) {
                                    case 1:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        break;
                                    case 2:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        v9_0.appendWhere("_id=?");
                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                        break;
                                    case 3:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        break;
                                    case 4:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v22 = 1;
                                        break;
                                    default:
                                        switch (v15_1) {
                                            case 100:
                                                int v0_100;
                                                v24 = v7_1;
                                                String v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && ((!p30.equalsIgnoreCase("is_music=1")) && (!p30.equalsIgnoreCase("is_podcast=1"))))))) {
                                                    v0_100 = 0;
                                                } else {
                                                    v0_100 = 0;
                                                    if ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null)) {
                                                        v9_0.setTables("audio_meta");
                                                        int v0_127 = v9_0.query(v24, p29, v12_1, this.combine(v15_0, p31), v16, 0, p32, v17);
                                                        if (v0_127 != 0) {
                                                            String v1_63 = v14.getQueryParameter("nonotify");
                                                            if ((v1_63 == null) || (!v1_63.equals("1"))) {
                                                                v0_127.setNotificationUri(this.getContext().getContentResolver(), v14);
                                                            }
                                                        }
                                                        return v0_127;
                                                    }
                                                }
                                                v9_0.setTables("audio");
                                                while ((v8_0 != null) && (v0_100 < v8_0.length)) {
                                                    if (v0_100 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_52 = new StringBuilder();
                                                    v1_52.append("%");
                                                    v1_52.append(v8_0[v0_100]);
                                                    v1_52.append("%");
                                                    v15_0.add(v1_52.toString());
                                                    v0_100++;
                                                }
                                            case 101:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 102:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id IN (SELECT genre_id FROM audio_genres_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 103:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 104:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id IN (SELECT playlist_id FROM audio_playlists_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 105:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 106:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                break;
                                            case 107:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 108:
                                            case 109:
                                                int v20_1;
                                                v24 = v7_1;
                                                int v7_0 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("genre_id=?"))))) {
                                                    v20_1 = 0;
                                                } else {
                                                    v20_1 = 1;
                                                }
                                                int v0_61 = v20_1;
                                                if (p29 != null) {
                                                    int v2_30 = v0_61;
                                                    int v0_62 = 0;
                                                    while (v0_62 < p29.length) {
                                                        int v3_26 = p29[v0_62];
                                                        if (v3_26.equals("_id")) {
                                                            v2_30 = 0;
                                                        }
                                                        if ((v2_30 != 0) && ((!v3_26.equals("audio_id")) && (!v3_26.equals("genre_id")))) {
                                                            v2_30 = 0;
                                                        }
                                                        v0_62++;
                                                    }
                                                    v0_61 = v2_30;
                                                }
                                                if (v0_61 == 0) {
                                                    v9_0.setTables("audio_genres_map_noid, audio");
                                                    v9_0.appendWhere("audio._id = audio_id");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere(" AND genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                    int v18_4 = 0;
                                                    while(true) {
                                                        String v1_34 = v18_4;
                                                        if ((v8_0 == null) || (v1_34 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v2_38 = new StringBuilder();
                                                        v2_38.append("%");
                                                        v2_38.append(v8_0[v1_34]);
                                                        v2_38.append("%");
                                                        v15_0.add(v2_38.toString());
                                                        v18_4 = (v1_34 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_genres_map_noid");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere("genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                }
                                                break;
                                            case 110:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                break;
                                            case 111:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 112:
                                            case 113:
                                                int v20_0;
                                                v24 = v7_1;
                                                int v26_2 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("playlist_id=?"))))) {
                                                    v20_0 = 0;
                                                } else {
                                                    v20_0 = 1;
                                                }
                                                int v2_25 = v20_0;
                                                if (p29 != null) {
                                                    int v3_5 = v2_25;
                                                    int v2_27 = 0;
                                                    while (v2_27 < p29.length) {
                                                        boolean v4_8 = p29[v2_27];
                                                        if ((v3_5 != 0) && ((!v4_8.equals("audio_id")) && ((!v4_8.equals("playlist_id")) && (!v4_8.equals("play_order"))))) {
                                                            v3_5 = 0;
                                                        }
                                                        if (v4_8.equals("_id")) {
                                                            p29[v2_27] = "audio_playlists_map._id AS _id";
                                                        }
                                                        v2_27++;
                                                    }
                                                    v2_25 = v3_5;
                                                }
                                                if (v2_25 == 0) {
                                                    v9_0.setTables("audio_playlists_map, audio");
                                                    v9_0.appendWhere("audio._id = audio_id AND playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    int v18_3 = 0;
                                                    while(true) {
                                                        String v1_26 = v18_3;
                                                        if ((v8_0 == null) || (v1_26 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v3_13 = new StringBuilder();
                                                        v3_13.append("%");
                                                        v3_13.append(v8_0[v1_26]);
                                                        v3_13.append("%");
                                                        v15_0.add(v3_13.toString());
                                                        v18_3 = (v1_26 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_playlists_map");
                                                    v9_0.appendWhere("playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                }
                                                if (v26_2 == 113) {
                                                    v9_0.appendWhere(" AND audio_playlists_map._id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(5)));
                                                }
                                                break;
                                            case 114:
                                                v24 = v7_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if (((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && (p30.length() != 0))))) || ((!p29[0].equalsIgnoreCase("count(*)")) || (v8_0 == null))) {
                                                    v9_0.setTables("artist_info");
                                                    int v18_2 = 0;
                                                    while(true) {
                                                        int v0_47 = v18_2;
                                                        if ((v8_0 == null) || (v0_47 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        if (v0_47 > 0) {
                                                            v9_0.appendWhere(" AND ");
                                                        }
                                                        v9_0.appendWhere("artist_key LIKE ? ESCAPE \'\\\'");
                                                        String v1_21 = new StringBuilder();
                                                        v1_21.append("%");
                                                        v1_21.append(v8_0[v0_47]);
                                                        v1_21.append("%");
                                                        v15_0.add(v1_21.toString());
                                                        v18_2 = (v0_47 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_meta");
                                                    p29[0] = "count(distinct artist_id)";
                                                    v9_0.appendWhere("is_music=1");
                                                }
                                                break;
                                            case 115:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("artist_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 116:
                                                String v12_2 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || (p31 != null))) {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                } else {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                    if (((p30 == null) || (p30.length() == 0)) && ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null))) {
                                                        v9_0.setTables("audio_meta");
                                                        p29[0] = "count(distinct album_id)";
                                                        v9_0.appendWhere("is_music=1");
                                                    }
                                                }
                                                v9_0.setTables("album_info");
                                                int v18_1 = 0;
                                                while(true) {
                                                    int v0_32 = v18_1;
                                                    if ((v8_0 == null) || (v0_32 >= v8_0.length)) {
                                                        break;
                                                    }
                                                    if (v0_32 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_12 = new StringBuilder();
                                                    v1_12.append("%");
                                                    v1_12.append(v8_0[v0_32]);
                                                    v1_12.append("%");
                                                    v15_0.add(v1_12.toString());
                                                    v18_1 = (v0_32 + 1);
                                                }
                                                break;
                                            case 117:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("album_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 118:
                                                String v12_0 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                int v0_20 = ((String) v14.getPathSegments().get(3));
                                                v9_0.setTables("audio LEFT OUTER JOIN album_art ON audio.album_id=album_art.album_id");
                                                v9_0.appendWhere("is_music=1 AND audio.album_id IN (SELECT album_id FROM artists_albums_map WHERE artist_id=?)");
                                                v15_0.add(v0_20);
                                                int v18_0 = 0;
                                                while(true) {
                                                    String v1_4 = v18_0;
                                                    if ((v12_0 == null) || (v1_4 >= v12_0.length)) {
                                                        break;
                                                    }
                                                    v9_0.appendWhere(" AND ");
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    int v2_10 = new StringBuilder();
                                                    v2_10.append("%");
                                                    v2_10.append(v12_0[v1_4]);
                                                    v2_10.append("%");
                                                    v15_0.add(v2_10.toString());
                                                    v18_0 = (v1_4 + 1);
                                                }
                                                boolean v4_2 = new StringBuilder();
                                                v4_2.append("count(CASE WHEN artist_id==");
                                                v4_2.append(v0_20);
                                                v4_2.append(" THEN \'foo\' ELSE NULL END) AS ");
                                                v4_2.append("numsongs_by_artist");
                                                com.android.providers.media.MediaProvider.sArtistAlbumsMap.put("numsongs_by_artist", v4_2.toString());
                                                v9_0.setProjectionMap(com.android.providers.media.MediaProvider.sArtistAlbumsMap);
                                                v16 = "audio.album_id";
                                                break;
                                            default:
                                                int v23_0;
                                                switch (v15_1) {
                                                    case 200:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v12_1 = p30;
                                                        break;
                                                    case 201:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v9_0.appendWhere("_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                        break;
                                                    case 202:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        break;
                                                    case 203:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v22 = 1;
                                                        break;
                                                    default:
                                                        switch (v15_1) {
                                                            case 400:
                                                                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Legacy media search Uri used. Please update your code.");
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            default:
                                                                switch (v15_1) {
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 701:
                                                                    case 703:
                                                                        v5_4.appendWhere("_id=?");
                                                                        v9_1.add(((String) v14.getPathSegments().get(2)));
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 704:
                                                                        return this.getObjectReferences(v8_1, v7_1, Integer.parseInt(((String) v14.getPathSegments().get(2))));
                                                                    default:
                                                                        String v1_65 = new StringBuilder();
                                                                        v1_65.append("Unknown URL: ");
                                                                        v1_65.append(v14.toString());
                                                                        throw new IllegalStateException(v1_65.toString());
                                                                }
                                                                v5_4.setTables("files");
                                                                v24 = v7_1;
                                                                v15_0 = v9_1;
                                                                v9_0 = v5_4;
                                                        }
                                                        String v15 = v9_1;
                                                        return this.doAudioSearch(v7_1, v5_4, v14, p29, p30, this.combine(v9_1, p31), p32, v15_1, v17);
                                                }
                                                if (this.queryThumbnail(v23_0, v14, "videothumbnails", "video_id", v22)) {
                                                    v9_0 = v23_0;
                                                } else {
                                                    return 0;
                                                }
                                        }
                                }
                                if (!this.queryThumbnail(v9_0, v14, "thumbnails", "image_id", v22)) {
                                    return 0;
                                }
                            }
                        } else {
                            return 0;
                        }
                    } else {
                        return 0;
                    }
                } else {
                    int v2_59 = new android.database.MatrixCursor(new String[] {"version"}));
                    String v1_71 = new Integer[1];
                    v1_71[0] = Integer.valueOf(com.android.providers.media.MediaProvider.getDatabaseVersion(this.getContext()));
                    v2_59.addRow(v1_71);
                    return v2_59;
                }
            } else {
                int v2_61 = new android.database.MatrixCursor(new String[] {"fsid"}));
                String v1_72 = new Integer[1];
                v1_72[0] = Integer.valueOf(this.mVolumeId);
                v2_61.addRow(v1_72);
                return v2_61;
            }
        } else {
            if (this.mMediaScannerVolume != null) {
                int v2_64 = new android.database.MatrixCursor(new String[] {"volume"}));
                String v1_73 = new String[1];
                v1_73[0] = this.mMediaScannerVolume;
                v2_64.addRow(v1_73);
                return v2_64;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.openFile() calling method android.database.sqlite.SQLiteQueryBuilder.appendWhere()


    public android.os.ParcelFileDescriptor openFile(android.net.Uri p24, String p25)
    {
        android.net.Uri v10 = this.safeUncanonicalize(p24);
        android.os.ParcelFileDescriptor v11 = 0;
        if (com.android.providers.media.MediaProvider.URI_MATCHER.match(v10) != 121) {
            try {
                Throwable v0_0 = this.openFileAndEnforcePathPermissionsHelper(v10, p25);
            } catch (Throwable v0_9) {
                java.io.FileNotFoundException v12_1 = v0_9;
                if (p25.contains("w")) {
                    throw v12_1;
                } else {
                    if (com.android.providers.media.MediaProvider.URI_MATCHER.match(v10) == 120) {
                        com.android.providers.media.MediaProvider$DatabaseHelper v13_2 = this.getDatabaseForUri(v10);
                        if (v13_2 == null) {
                            throw v12_1;
                        } else {
                            android.database.sqlite.SQLiteDatabase v22 = v13_2.getReadableDatabase();
                            if (v22 == null) {
                                com.android.providers.media.MediaProvider v1_10 = new StringBuilder();
                                v1_10.append("Couldn\'t open database for ");
                                v1_10.append(v10);
                                throw new IllegalStateException(v1_10.toString());
                            } else {
                                android.net.Uri v7_2 = new android.database.sqlite.SQLiteQueryBuilder();
                                long v5_2 = Integer.parseInt(((String) v10.getPathSegments().get(3)));
                                v7_2.setTables("audio_meta");
                                Throwable v0_39 = new StringBuilder();
                                v0_39.append("album_id=");
                                v0_39.append(v5_2);
                                v7_2.appendWhere(v0_39.toString());
                                android.database.Cursor v14_3 = v7_2.query(v22, new String[] {"_data"}), 0, 0, 0, 0, "track");
                                try {
                                    if (!v14_3.moveToFirst()) {
                                        android.net.Uri v15 = v7_2;
                                    } else {
                                        try {
                                            v11 = this.getThumb(v13_2, v22, v14_3.getString(0), ((long) v5_2), v10);
                                        } catch (Throwable v0_45) {
                                            libcore.io.IoUtils.closeQuietly(v14_3);
                                            throw v0_45;
                                        }
                                    }
                                } catch (Throwable v0_45) {
                                    v15 = v7_2;
                                }
                                libcore.io.IoUtils.closeQuietly(v14_3);
                            }
                        }
                    }
                    v0_0 = v11;
                    if (v0_0 == null) {
                        throw v12_1;
                    } else {
                    }
                }
            }
            return v0_0;
        } else {
            java.io.FileNotFoundException v12_0 = this.getDatabaseForUri(v10);
            if (v12_0 == null) {
                com.android.providers.media.MediaProvider v1_1 = new StringBuilder();
                v1_1.append("Couldn\'t open database for ");
                v1_1.append(v10);
                throw new IllegalStateException(v1_1.toString());
            } else {
                String v21_0 = v12_0.getReadableDatabase();
                if (v21_0 == null) {
                    com.android.providers.media.MediaProvider v1_4 = new StringBuilder();
                    v1_4.append("Couldn\'t open database for ");
                    v1_4.append(v10);
                    throw new IllegalStateException(v1_4.toString());
                } else {
                    android.net.Uri v7_0 = new android.database.sqlite.SQLiteQueryBuilder();
                    long v5_0 = Integer.parseInt(((String) v10.getPathSegments().get(3)));
                    v7_0.setTables("audio_meta");
                    Throwable v0_13 = new StringBuilder();
                    v0_13.append("_id=");
                    v0_13.append(v5_0);
                    v7_0.appendWhere(v0_13.toString());
                    com.android.providers.media.MediaProvider$DatabaseHelper v13_1 = v7_0.query(v21_0, new String[] {"_data", "album_id"}), 0, 0, 0, 0, 0);
                    try {
                        if (!v13_1.moveToFirst()) {
                            long v17 = v7_0;
                        } else {
                            String v4_0 = v13_1.getString(0);
                            android.database.Cursor v14_1 = v13_1.getInt(1);
                            try {
                                v11 = this.openFileAndEnforcePathPermissionsHelper(android.content.ContentUris.withAppendedId(com.android.providers.media.MediaProvider.ALBUMART_URI, ((long) v14_1)), p25);
                                v17 = v7_0;
                            } catch (Throwable v0_19) {
                                v17 = v7_0;
                                libcore.io.IoUtils.closeQuietly(v13_1);
                                throw v0_19;
                            } catch (Throwable v0_26) {
                                try {
                                    v11 = this.getThumb(v12_0, v21_0, v4_0, ((long) v14_1), 0);
                                } catch (Throwable v0_19) {
                                }
                            }
                        }
                    } catch (Throwable v0_19) {
                        v17 = v7_0;
                    }
                    libcore.io.IoUtils.closeQuietly(v13_1);
                    return v11;
                }
            }
        }
    }

Method com.android.providers.media.MediaProvider.queryThumbnail() calling method android.database.sqlite.SQLiteQueryBuilder.appendWhere()


    private boolean queryThumbnail(android.database.sqlite.SQLiteQueryBuilder p27, android.net.Uri p28, String p29, String p30, boolean p31)
    {
        boolean v15_0 = this;
        p27.setTables(p29);
        if (!p31) {
            String v12 = p28.getQueryParameter("orig_id");
            if (v12 != null) {
                boolean v16 = "1".equals(p28.getQueryParameter("blocking"));
                boolean v17 = "1".equals(p28.getQueryParameter("cancel"));
                int v10_1 = p28.buildUpon().encodedPath(p28.getPath().replaceFirst("thumbnails", "media")).appendPath(v12).build();
                if ((!v16) || (this.waitForThumbnailReady(v10_1))) {
                    String v4_0;
                    if (!v17) {
                        v4_0 = v12;
                    } else {
                        com.android.providers.media.MediaThumbRequest v9_1 = p28.getQueryParameter("group_id");
                        boolean v18 = "video".equals(p28.getPathSegments().get(1));
                        int v19 = android.os.Binder.getCallingPid();
                        try {
                            String v4_3 = Long.parseLong(v12);
                            try {
                                long v6 = Long.parseLong(v9_1);
                                try {
                                    if (this.mCurrentThumbRequest == null) {
                                        com.android.providers.media.MediaThumbRequest v1_2 = this.mMediaThumbQueue.iterator();
                                        while (v1_2.hasNext()) {
                                            com.android.providers.media.MediaThumbRequest v2_8 = ((com.android.providers.media.MediaThumbRequest) v1_2.next());
                                            com.android.providers.media.MediaThumbRequest v23 = v9_1;
                                            int v24 = v10_1;
                                            String v3_2 = v12;
                                            com.android.providers.media.MediaThumbRequest v25 = v1_2;
                                            com.android.providers.media.MediaThumbRequest v1_3 = v15_0;
                                            if (v15_0.matchThumbRequest(v2_8, v19, v4_3, v6, v18)) {
                                                v2_8.mState = com.android.providers.media.MediaThumbRequest$State.CANCEL;
                                                v2_8.notifyAll();
                                                v1_3.mMediaThumbQueue.remove(v2_8);
                                            }
                                            String v11 = p29;
                                            v15_0 = v1_3;
                                            v12 = v3_2;
                                            v9_1 = v23;
                                            v10_1 = v24;
                                            v1_2 = v25;
                                        }
                                        v24 = v10_1;
                                        v4_0 = v12;
                                        if (v4_0 == null) {
                                            android.database.sqlite.SQLiteQueryBuilder v5 = p27;
                                        } else {
                                            com.android.providers.media.MediaThumbRequest v2_4 = new StringBuilder();
                                            v2_4.append(p30);
                                            v2_4.append(" = ");
                                            v2_4.append(v4_0);
                                            p27.appendWhere(v2_4.toString());
                                        }
                                        return 1;
                                    } else {
                                        try {
                                            try {
                                                if (!this.matchThumbRequest(this.mCurrentThumbRequest, v19, v4_3, v6, v18)) {
                                                } else {
                                                    this.mCurrentThumbRequest.mState = com.android.providers.media.MediaThumbRequest$State.CANCEL;
                                                    this.mCurrentThumbRequest.notifyAll();
                                                }
                                            } catch (Throwable v0_1) {
                                                v24 = v10_1;
                                                com.android.providers.media.MediaThumbRequest v1 = this;
                                            }
                                        } catch (Throwable v0_1) {
                                        }
                                    }
                                } catch (Throwable v0_1) {
                                }
                                throw v0_1;
                            } catch (Throwable v0) {
                                java.util.PriorityQueue v8_4 = 0;
                                v24 = v10_1;
                                com.android.providers.media.MediaThumbRequest v2 = v4_3;
                                return v8_4;
                            }
                        } catch (Throwable v0) {
                            v8_4 = 0;
                            v24 = v10_1;
                            v1 = this;
                            return v8_4;
                        }
                    }
                } else {
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "original media doesn\'t exist or it\'s canceled.");
                    return 0;
                }
            } else {
                return 1;
            }
        } else {
            com.android.providers.media.MediaThumbRequest v1_6 = new StringBuilder();
            v1_6.append("_id = ");
            v1_6.append(((String) p28.getPathSegments().get(3)));
            p27.appendWhere(v1_6.toString());
            return 1;
        }
    }

Method com.android.providers.media.MediaProvider.query() calling method android.database.sqlite.SQLiteQueryBuilder.query()


    public android.database.Cursor query(android.net.Uri p28, String[] p29, String p30, String[] p31, String p32)
    {
        String v12_1 = p30;
        android.net.Uri v14 = this.safeUncanonicalize(p28);
        String v15_1 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v14);
        int v9_1 = new java.util.ArrayList();
        if (v15_1 != 500) {
            if (v15_1 != 600) {
                if (v15_1 != 601) {
                    String v16 = 0;
                    String v8_1 = this.getDatabaseForUri(v14);
                    if (v8_1 != null) {
                        v8_1.mNumQueries = (v8_1.mNumQueries + 1);
                        int v7_1 = v8_1.getReadableDatabase();
                        if (v7_1 != 0) {
                            String[] v6_1;
                            boolean v5_4 = new android.database.sqlite.SQLiteQueryBuilder();
                            String v17 = v14.getQueryParameter("limit");
                            int v2_28 = v14.getQueryParameter("filter");
                            int v3_14 = 0;
                            if (v2_28 == 0) {
                                v6_1 = 0;
                            } else {
                                int v2_29 = android.net.Uri.decode(v2_28).trim();
                                if (!android.text.TextUtils.isEmpty(v2_29)) {
                                    boolean v4_12 = v2_29.split(" ");
                                    v3_14 = new String[v4_12.length];
                                    int v0_64 = 0;
                                    while (v0_64 < v4_12.length) {
                                        String v21 = v2_29;
                                        v3_14[v0_64] = android.provider.MediaStore$Audio.keyFor(v4_12[v0_64]).replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
                                        v0_64++;
                                        v2_29 = v21;
                                        String[] v6 = 0;
                                    }
                                }
                                v6_1 = v3_14;
                            }
                            if (v14.getQueryParameter("distinct") != null) {
                                v5_4.setDistinct(1);
                            }
                            int v9_0;
                            String v15_0;
                            int v24;
                            int v22 = 0;
                            if (v15_1 == 120) {
                                v24 = v7_1;
                                v15_0 = v9_1;
                                v9_0 = v5_4;
                                v9_0.setTables("album_art");
                                v9_0.appendWhere("album_id=?");
                                v15_0.add(((String) v14.getPathSegments().get(3)));
                            } else {
                                switch (v15_1) {
                                    case 1:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        break;
                                    case 2:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v9_0.setTables("images");
                                        if (v14.getQueryParameter("distinct") != null) {
                                            v9_0.setDistinct(1);
                                        }
                                        v9_0.appendWhere("_id=?");
                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                        break;
                                    case 3:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        break;
                                    case 4:
                                        v24 = v7_1;
                                        v15_0 = v9_1;
                                        v9_0 = v5_4;
                                        v22 = 1;
                                        break;
                                    default:
                                        switch (v15_1) {
                                            case 100:
                                                int v0_100;
                                                v24 = v7_1;
                                                String v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && ((!p30.equalsIgnoreCase("is_music=1")) && (!p30.equalsIgnoreCase("is_podcast=1"))))))) {
                                                    v0_100 = 0;
                                                } else {
                                                    v0_100 = 0;
                                                    if ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null)) {
                                                        v9_0.setTables("audio_meta");
                                                        int v0_127 = v9_0.query(v24, p29, v12_1, this.combine(v15_0, p31), v16, 0, p32, v17);
                                                        if (v0_127 != 0) {
                                                            String v1_63 = v14.getQueryParameter("nonotify");
                                                            if ((v1_63 == null) || (!v1_63.equals("1"))) {
                                                                v0_127.setNotificationUri(this.getContext().getContentResolver(), v14);
                                                            }
                                                        }
                                                        return v0_127;
                                                    }
                                                }
                                                v9_0.setTables("audio");
                                                while ((v8_0 != null) && (v0_100 < v8_0.length)) {
                                                    if (v0_100 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_52 = new StringBuilder();
                                                    v1_52.append("%");
                                                    v1_52.append(v8_0[v0_100]);
                                                    v1_52.append("%");
                                                    v15_0.add(v1_52.toString());
                                                    v0_100++;
                                                }
                                            case 101:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 102:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id IN (SELECT genre_id FROM audio_genres_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 103:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 104:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id IN (SELECT playlist_id FROM audio_playlists_map WHERE audio_id=?)");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 105:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(5)));
                                                break;
                                            case 106:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                break;
                                            case 107:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_genres");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 108:
                                            case 109:
                                                int v20_1;
                                                v24 = v7_1;
                                                int v7_0 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("genre_id=?"))))) {
                                                    v20_1 = 0;
                                                } else {
                                                    v20_1 = 1;
                                                }
                                                int v0_61 = v20_1;
                                                if (p29 != null) {
                                                    int v2_30 = v0_61;
                                                    int v0_62 = 0;
                                                    while (v0_62 < p29.length) {
                                                        int v3_26 = p29[v0_62];
                                                        if (v3_26.equals("_id")) {
                                                            v2_30 = 0;
                                                        }
                                                        if ((v2_30 != 0) && ((!v3_26.equals("audio_id")) && (!v3_26.equals("genre_id")))) {
                                                            v2_30 = 0;
                                                        }
                                                        v0_62++;
                                                    }
                                                    v0_61 = v2_30;
                                                }
                                                if (v0_61 == 0) {
                                                    v9_0.setTables("audio_genres_map_noid, audio");
                                                    v9_0.appendWhere("audio._id = audio_id");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere(" AND genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                    int v18_4 = 0;
                                                    while(true) {
                                                        String v1_34 = v18_4;
                                                        if ((v8_0 == null) || (v1_34 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v2_38 = new StringBuilder();
                                                        v2_38.append("%");
                                                        v2_38.append(v8_0[v1_34]);
                                                        v2_38.append("%");
                                                        v15_0.add(v2_38.toString());
                                                        v18_4 = (v1_34 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_genres_map_noid");
                                                    if (v7_0 == 108) {
                                                        v9_0.appendWhere("genre_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    }
                                                }
                                                break;
                                            case 110:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                break;
                                            case 111:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("audio_playlists");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 112:
                                            case 113:
                                                int v20_0;
                                                v24 = v7_1;
                                                int v26_2 = v15_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((v8_0 != null) || ((p29 == null) || ((p30 != null) && (!p30.equalsIgnoreCase("playlist_id=?"))))) {
                                                    v20_0 = 0;
                                                } else {
                                                    v20_0 = 1;
                                                }
                                                int v2_25 = v20_0;
                                                if (p29 != null) {
                                                    int v3_5 = v2_25;
                                                    int v2_27 = 0;
                                                    while (v2_27 < p29.length) {
                                                        boolean v4_8 = p29[v2_27];
                                                        if ((v3_5 != 0) && ((!v4_8.equals("audio_id")) && ((!v4_8.equals("playlist_id")) && (!v4_8.equals("play_order"))))) {
                                                            v3_5 = 0;
                                                        }
                                                        if (v4_8.equals("_id")) {
                                                            p29[v2_27] = "audio_playlists_map._id AS _id";
                                                        }
                                                        v2_27++;
                                                    }
                                                    v2_25 = v3_5;
                                                }
                                                if (v2_25 == 0) {
                                                    v9_0.setTables("audio_playlists_map, audio");
                                                    v9_0.appendWhere("audio._id = audio_id AND playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                    int v18_3 = 0;
                                                    while(true) {
                                                        String v1_26 = v18_3;
                                                        if ((v8_0 == null) || (v1_26 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        v9_0.appendWhere(" AND ");
                                                        v9_0.appendWhere("artist_key||album_key||title_key LIKE ? ESCAPE \'\\\'");
                                                        int v3_13 = new StringBuilder();
                                                        v3_13.append("%");
                                                        v3_13.append(v8_0[v1_26]);
                                                        v3_13.append("%");
                                                        v15_0.add(v3_13.toString());
                                                        v18_3 = (v1_26 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_playlists_map");
                                                    v9_0.appendWhere("playlist_id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(3)));
                                                }
                                                if (v26_2 == 113) {
                                                    v9_0.appendWhere(" AND audio_playlists_map._id=?");
                                                    v15_0.add(((String) v14.getPathSegments().get(5)));
                                                }
                                                break;
                                            case 114:
                                                v24 = v7_1;
                                                v8_0 = v6_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if (((p29 == null) || ((p29.length != 1) || ((p31 != null) || ((p30 != null) && (p30.length() != 0))))) || ((!p29[0].equalsIgnoreCase("count(*)")) || (v8_0 == null))) {
                                                    v9_0.setTables("artist_info");
                                                    int v18_2 = 0;
                                                    while(true) {
                                                        int v0_47 = v18_2;
                                                        if ((v8_0 == null) || (v0_47 >= v8_0.length)) {
                                                            break;
                                                        }
                                                        if (v0_47 > 0) {
                                                            v9_0.appendWhere(" AND ");
                                                        }
                                                        v9_0.appendWhere("artist_key LIKE ? ESCAPE \'\\\'");
                                                        String v1_21 = new StringBuilder();
                                                        v1_21.append("%");
                                                        v1_21.append(v8_0[v0_47]);
                                                        v1_21.append("%");
                                                        v15_0.add(v1_21.toString());
                                                        v18_2 = (v0_47 + 1);
                                                    }
                                                } else {
                                                    v9_0.setTables("audio_meta");
                                                    p29[0] = "count(distinct artist_id)";
                                                    v9_0.appendWhere("is_music=1");
                                                }
                                                break;
                                            case 115:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("artist_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 116:
                                                String v12_2 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                if ((p29 == null) || ((p29.length != 1) || (p31 != null))) {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                } else {
                                                    v8_0 = v12_2;
                                                    v12_1 = p30;
                                                    if (((p30 == null) || (p30.length() == 0)) && ((p29[0].equalsIgnoreCase("count(*)")) && (v8_0 != null))) {
                                                        v9_0.setTables("audio_meta");
                                                        p29[0] = "count(distinct album_id)";
                                                        v9_0.appendWhere("is_music=1");
                                                    }
                                                }
                                                v9_0.setTables("album_info");
                                                int v18_1 = 0;
                                                while(true) {
                                                    int v0_32 = v18_1;
                                                    if ((v8_0 == null) || (v0_32 >= v8_0.length)) {
                                                        break;
                                                    }
                                                    if (v0_32 > 0) {
                                                        v9_0.appendWhere(" AND ");
                                                    }
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    String v1_12 = new StringBuilder();
                                                    v1_12.append("%");
                                                    v1_12.append(v8_0[v0_32]);
                                                    v1_12.append("%");
                                                    v15_0.add(v1_12.toString());
                                                    v18_1 = (v0_32 + 1);
                                                }
                                                break;
                                            case 117:
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                v9_0.setTables("album_info");
                                                v9_0.appendWhere("_id=?");
                                                v15_0.add(((String) v14.getPathSegments().get(3)));
                                                break;
                                            case 118:
                                                String v12_0 = v6_1;
                                                v24 = v7_1;
                                                v15_0 = v9_1;
                                                v9_0 = v5_4;
                                                int v0_20 = ((String) v14.getPathSegments().get(3));
                                                v9_0.setTables("audio LEFT OUTER JOIN album_art ON audio.album_id=album_art.album_id");
                                                v9_0.appendWhere("is_music=1 AND audio.album_id IN (SELECT album_id FROM artists_albums_map WHERE artist_id=?)");
                                                v15_0.add(v0_20);
                                                int v18_0 = 0;
                                                while(true) {
                                                    String v1_4 = v18_0;
                                                    if ((v12_0 == null) || (v1_4 >= v12_0.length)) {
                                                        break;
                                                    }
                                                    v9_0.appendWhere(" AND ");
                                                    v9_0.appendWhere("artist_key||album_key LIKE ? ESCAPE \'\\\'");
                                                    int v2_10 = new StringBuilder();
                                                    v2_10.append("%");
                                                    v2_10.append(v12_0[v1_4]);
                                                    v2_10.append("%");
                                                    v15_0.add(v2_10.toString());
                                                    v18_0 = (v1_4 + 1);
                                                }
                                                boolean v4_2 = new StringBuilder();
                                                v4_2.append("count(CASE WHEN artist_id==");
                                                v4_2.append(v0_20);
                                                v4_2.append(" THEN \'foo\' ELSE NULL END) AS ");
                                                v4_2.append("numsongs_by_artist");
                                                com.android.providers.media.MediaProvider.sArtistAlbumsMap.put("numsongs_by_artist", v4_2.toString());
                                                v9_0.setProjectionMap(com.android.providers.media.MediaProvider.sArtistAlbumsMap);
                                                v16 = "audio.album_id";
                                                break;
                                            default:
                                                int v23_0;
                                                switch (v15_1) {
                                                    case 200:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v12_1 = p30;
                                                        break;
                                                    case 201:
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v9_0 = v5_4;
                                                        v9_0.setTables("video");
                                                        v9_0.appendWhere("_id=?");
                                                        v15_0.add(((String) v14.getPathSegments().get(3)));
                                                        break;
                                                    case 202:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        break;
                                                    case 203:
                                                        v23_0 = v5_4;
                                                        v24 = v7_1;
                                                        v15_0 = v9_1;
                                                        v22 = 1;
                                                        break;
                                                    default:
                                                        switch (v15_1) {
                                                            case 400:
                                                                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Legacy media search Uri used. Please update your code.");
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            case 401:
                                                            case 402:
                                                                break;
                                                            default:
                                                                switch (v15_1) {
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 701:
                                                                    case 703:
                                                                        v5_4.appendWhere("_id=?");
                                                                        v9_1.add(((String) v14.getPathSegments().get(2)));
                                                                    case 700:
                                                                    case 702:
                                                                        break;
                                                                    case 704:
                                                                        return this.getObjectReferences(v8_1, v7_1, Integer.parseInt(((String) v14.getPathSegments().get(2))));
                                                                    default:
                                                                        String v1_65 = new StringBuilder();
                                                                        v1_65.append("Unknown URL: ");
                                                                        v1_65.append(v14.toString());
                                                                        throw new IllegalStateException(v1_65.toString());
                                                                }
                                                                v5_4.setTables("files");
                                                                v24 = v7_1;
                                                                v15_0 = v9_1;
                                                                v9_0 = v5_4;
                                                        }
                                                        String v15 = v9_1;
                                                        return this.doAudioSearch(v7_1, v5_4, v14, p29, p30, this.combine(v9_1, p31), p32, v15_1, v17);
                                                }
                                                if (this.queryThumbnail(v23_0, v14, "videothumbnails", "video_id", v22)) {
                                                    v9_0 = v23_0;
                                                } else {
                                                    return 0;
                                                }
                                        }
                                }
                                if (!this.queryThumbnail(v9_0, v14, "thumbnails", "image_id", v22)) {
                                    return 0;
                                }
                            }
                        } else {
                            return 0;
                        }
                    } else {
                        return 0;
                    }
                } else {
                    int v2_59 = new android.database.MatrixCursor(new String[] {"version"}));
                    String v1_71 = new Integer[1];
                    v1_71[0] = Integer.valueOf(com.android.providers.media.MediaProvider.getDatabaseVersion(this.getContext()));
                    v2_59.addRow(v1_71);
                    return v2_59;
                }
            } else {
                int v2_61 = new android.database.MatrixCursor(new String[] {"fsid"}));
                String v1_72 = new Integer[1];
                v1_72[0] = Integer.valueOf(this.mVolumeId);
                v2_61.addRow(v1_72);
                return v2_61;
            }
        } else {
            if (this.mMediaScannerVolume != null) {
                int v2_64 = new android.database.MatrixCursor(new String[] {"volume"}));
                String v1_73 = new String[1];
                v1_73[0] = this.mMediaScannerVolume;
                v2_64.addRow(v1_73);
                return v2_64;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.openFile() calling method android.database.sqlite.SQLiteQueryBuilder.query()


    public android.os.ParcelFileDescriptor openFile(android.net.Uri p24, String p25)
    {
        android.net.Uri v10 = this.safeUncanonicalize(p24);
        android.os.ParcelFileDescriptor v11 = 0;
        if (com.android.providers.media.MediaProvider.URI_MATCHER.match(v10) != 121) {
            try {
                Throwable v0_0 = this.openFileAndEnforcePathPermissionsHelper(v10, p25);
            } catch (Throwable v0_9) {
                java.io.FileNotFoundException v12_1 = v0_9;
                if (p25.contains("w")) {
                    throw v12_1;
                } else {
                    if (com.android.providers.media.MediaProvider.URI_MATCHER.match(v10) == 120) {
                        com.android.providers.media.MediaProvider$DatabaseHelper v13_2 = this.getDatabaseForUri(v10);
                        if (v13_2 == null) {
                            throw v12_1;
                        } else {
                            android.database.sqlite.SQLiteDatabase v22 = v13_2.getReadableDatabase();
                            if (v22 == null) {
                                com.android.providers.media.MediaProvider v1_10 = new StringBuilder();
                                v1_10.append("Couldn\'t open database for ");
                                v1_10.append(v10);
                                throw new IllegalStateException(v1_10.toString());
                            } else {
                                android.net.Uri v7_2 = new android.database.sqlite.SQLiteQueryBuilder();
                                long v5_2 = Integer.parseInt(((String) v10.getPathSegments().get(3)));
                                v7_2.setTables("audio_meta");
                                Throwable v0_39 = new StringBuilder();
                                v0_39.append("album_id=");
                                v0_39.append(v5_2);
                                v7_2.appendWhere(v0_39.toString());
                                android.database.Cursor v14_3 = v7_2.query(v22, new String[] {"_data"}), 0, 0, 0, 0, "track");
                                try {
                                    if (!v14_3.moveToFirst()) {
                                        android.net.Uri v15 = v7_2;
                                    } else {
                                        try {
                                            v11 = this.getThumb(v13_2, v22, v14_3.getString(0), ((long) v5_2), v10);
                                        } catch (Throwable v0_45) {
                                            libcore.io.IoUtils.closeQuietly(v14_3);
                                            throw v0_45;
                                        }
                                    }
                                } catch (Throwable v0_45) {
                                    v15 = v7_2;
                                }
                                libcore.io.IoUtils.closeQuietly(v14_3);
                            }
                        }
                    }
                    v0_0 = v11;
                    if (v0_0 == null) {
                        throw v12_1;
                    } else {
                    }
                }
            }
            return v0_0;
        } else {
            java.io.FileNotFoundException v12_0 = this.getDatabaseForUri(v10);
            if (v12_0 == null) {
                com.android.providers.media.MediaProvider v1_1 = new StringBuilder();
                v1_1.append("Couldn\'t open database for ");
                v1_1.append(v10);
                throw new IllegalStateException(v1_1.toString());
            } else {
                String v21_0 = v12_0.getReadableDatabase();
                if (v21_0 == null) {
                    com.android.providers.media.MediaProvider v1_4 = new StringBuilder();
                    v1_4.append("Couldn\'t open database for ");
                    v1_4.append(v10);
                    throw new IllegalStateException(v1_4.toString());
                } else {
                    android.net.Uri v7_0 = new android.database.sqlite.SQLiteQueryBuilder();
                    long v5_0 = Integer.parseInt(((String) v10.getPathSegments().get(3)));
                    v7_0.setTables("audio_meta");
                    Throwable v0_13 = new StringBuilder();
                    v0_13.append("_id=");
                    v0_13.append(v5_0);
                    v7_0.appendWhere(v0_13.toString());
                    com.android.providers.media.MediaProvider$DatabaseHelper v13_1 = v7_0.query(v21_0, new String[] {"_data", "album_id"}), 0, 0, 0, 0, 0);
                    try {
                        if (!v13_1.moveToFirst()) {
                            long v17 = v7_0;
                        } else {
                            String v4_0 = v13_1.getString(0);
                            android.database.Cursor v14_1 = v13_1.getInt(1);
                            try {
                                v11 = this.openFileAndEnforcePathPermissionsHelper(android.content.ContentUris.withAppendedId(com.android.providers.media.MediaProvider.ALBUMART_URI, ((long) v14_1)), p25);
                                v17 = v7_0;
                            } catch (Throwable v0_19) {
                                v17 = v7_0;
                                libcore.io.IoUtils.closeQuietly(v13_1);
                                throw v0_19;
                            } catch (Throwable v0_26) {
                                try {
                                    v11 = this.getThumb(v12_0, v21_0, v4_0, ((long) v14_1), 0);
                                } catch (Throwable v0_19) {
                                }
                            }
                        }
                    } catch (Throwable v0_19) {
                        v17 = v7_0;
                    }
                    libcore.io.IoUtils.closeQuietly(v13_1);
                    return v11;
                }
            }
        }
    }

Method com.android.providers.media.MediaProvider.doAudioSearch() calling method android.database.sqlite.SQLiteQueryBuilder.query()


    private android.database.Cursor doAudioSearch(android.database.sqlite.SQLiteDatabase p17, android.database.sqlite.SQLiteQueryBuilder p18, android.net.Uri p19, String[] p20, String p21, String[] p22, String p23, int p24, String p25)
    {
        String v2_0;
        if (!p19.getPath().endsWith("/")) {
            v2_0 = p19.getLastPathSegment();
        } else {
            v2_0 = "";
        }
        String[] v3_4;
        String v2_1 = v2_0.replaceAll("  ", " ").trim().toLowerCase();
        String v4_1 = 0;
        if (v2_1.length() <= 0) {
            v3_4 = new String[0];
        } else {
            v3_4 = v2_1.split(" ");
        }
        String[] v5_1 = new String[v3_4.length];
        int v15 = v3_4.length;
        android.database.Cursor v6_0 = 0;
        while (v6_0 < v15) {
            int v8_3;
            android.database.sqlite.SQLiteDatabase v7_6 = android.provider.MediaStore$Audio.keyFor(v3_4[v6_0]).replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
            if ((!v3_4[v6_0].equals("a")) && ((!v3_4[v6_0].equals("an")) && (!v3_4[v6_0].equals("the")))) {
                int v8_2 = new StringBuilder();
                v8_2.append("%");
                v8_2.append(v7_6);
                v8_2.append("%");
                v8_3 = v8_2.toString();
            } else {
                v8_3 = "%";
            }
            v5_1[v6_0] = v8_3;
            v6_0++;
        }
        String v14_0 = "";
        while (v4_1 < v3_4.length) {
            android.database.Cursor v6_7;
            if (v4_1 != null) {
                android.database.Cursor v6_6 = new StringBuilder();
                v6_6.append(v14_0);
                v6_6.append(" AND match LIKE ? ESCAPE \'\\\'");
                v6_7 = v6_6.toString();
            } else {
                v6_7 = "match LIKE ? ESCAPE \'\\\'";
            }
            v14_0 = v6_7;
            v4_1++;
        }
        String v4_5;
        p18.setTables("search");
        if (p24 != 402) {
            if (p24 != 401) {
                v4_5 = this.mSearchColsLegacy;
            } else {
                v4_5 = this.mSearchColsBasic;
            }
        } else {
            v4_5 = this.mSearchColsFancy;
        }
        return p18.query(p17, v4_5, v14_0, v5_1, 0, 0, 0, p25);
    }

Method com.android.providers.media.MediaProvider.update() calling method android.database.sqlite.SQLiteDatabase.update()


    public int update(android.net.Uri p44, android.content.ContentValues p45, String p46, String[] p47)
    {
        int v14_0 = this;
        String v12_3 = this.safeUncanonicalize(p44);
        int v11_6 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v12_3);
        android.content.ContentValues v10_4 = this.getDatabaseForUri(v12_3);
        if (v10_4 == null) {
            String v4_0 = v12_3;
            void v9 = this;
            String v15 = v11_6;
            long v1_4 = new StringBuilder();
            v1_4.append("Unknown URI: ");
            v1_4.append(v4_0);
            throw new UnsupportedOperationException(v1_4.toString());
        } else {
            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
            String v8_2 = v10_4.getWritableDatabase();
            Throwable v0_27 = 0;
            if (p45 != null) {
                v0_27 = p45.getAsString("genre");
                p45.remove("genre");
            }
            int v23;
            String v8_5;
            String v22_1;
            String v7_8;
            String v7_5 = v0_27;
            android.content.ContentValues v5_7 = this.getTableAndWhere(v12_3, v11_6, p46);
            if (!p45.containsKey("media_type")) {
                v22_1 = v5_7;
                v23 = v7_5;
                v7_8 = v8_2;
                v8_5 = 0;
            } else {
                String v16_6 = p45.getAsLong("media_type").longValue();
                v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                v22_1 = v5_7;
                v23 = v7_5;
                android.content.ContentResolver v24_1 = v8_2;
                Throwable v0_85 = v8_2.query(v5_7.table, com.android.providers.media.MediaProvider.sMediaTableColumns, v5_7.where, p47, 0, 0, 0);
                while(true) {
                    long v1_45 = v0_85;
                    if ((v1_45 == 0) || (!v1_45.moveToNext())) {
                        break;
                    }
                    String v7_16;
                    String v2_31 = v1_45.getLong(1);
                    try {
                        if ((v2_31 != 1) || (v16_6 == 1)) {
                            v7_16 = v24_1;
                            if ((v2_31 == 3) && (v16_6 != 3)) {
                                String v4_30 = new StringBuilder();
                                v4_30.append("need to remove video thumbnail for id ");
                                v4_30.append(v1_45.getString(0));
                                android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_30.toString());
                                v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                            }
                        } else {
                            String v4_34 = new StringBuilder();
                            v4_34.append("need to remove image thumbnail for id ");
                            v4_34.append(v1_45.getString(0));
                            android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_34.toString());
                            v7_16 = v24_1;
                            v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                        }
                        v0_85 = v1_45;
                        v24_1 = v7_16;
                    } catch (Throwable v0_109) {
                        libcore.io.IoUtils.closeQuietly(v1_45);
                        throw v0_109;
                    }
                }
                v7_8 = v24_1;
                v8_5 = 0;
                libcore.io.IoUtils.closeQuietly(v1_45);
            }
            if ((v11_6 != 702) && ((v11_6 != 703) && (v11_6 != 706))) {
                long v1_0 = 5;
                String v17_0 = 1;
                void v9_0 = v22_1;
                String v8_0 = v7_8;
                String v7_0 = 3;
            } else {
                if ((p45 == null) || (((p45.size() != 1) || (!p45.containsKey("_data"))) && ((p45.size() != 2) || ((!p45.containsKey("_data")) || (!p45.containsKey("parent")))))) {
                    v1_0 = 5;
                    v17_0 = 1;
                    v9_0 = v22_1;
                    v8_0 = v7_8;
                    v7_0 = 3;
                } else {
                    String v16_0 = 0;
                    String v2_0 = p45.getAsString("_data");
                    v14_0.mDirectoryCache.remove(v2_0);
                    long v1_1 = new java.io.File(v2_0);
                    if ((v2_0 == null) || (!v1_1.isDirectory())) {
                        v17_0 = 1;
                        v9_0 = v22_1;
                        v8_0 = v7_8;
                        v7_0 = 3;
                        String v6 = v1_1;
                        v1_0 = 5;
                        android.content.ContentValues v5_0 = v2_0;
                        if (v5_0.toLowerCase(java.util.Locale.US).endsWith("/.nomedia")) {
                            v14_0 = v14_0.processNewNoMediaPath(v10_4, v8_0, v5_0);
                        }
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                        v9_0 = v22_1;
                        java.util.HashMap v26 = v1_1;
                        boolean v27 = v2_0;
                        long v28 = v7_8;
                        Throwable v0_17 = v8_5;
                        long v1_5 = v7_8.query(v9_0.table, com.android.providers.media.MediaProvider.PATH_PROJECTION, p46, p47, 0, 0, 0);
                        try {
                            if ((v1_5 != 0) && (v1_5.moveToNext())) {
                                v16_0 = v1_5.getString(1);
                            }
                        } catch (Throwable v0_18) {
                            libcore.io.IoUtils.closeQuietly(v1_5);
                            throw v0_18;
                        }
                        String v2_7 = v16_0;
                        libcore.io.IoUtils.closeQuietly(v1_5);
                        if (v2_7 == null) {
                            android.content.ContentValues v5 = v27;
                            v8_0 = v28;
                            v1_0 = 5;
                            v7_0 = 3;
                            v17_0 = 1;
                        } else {
                            String v6_14;
                            android.content.ContentValues v5_19;
                            v14_0.mDirectoryCache.remove(v2_7);
                            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                            String v8_11 = v28;
                            String v3_38 = v8_11.update(v9_0.table, p45, v9_0.where, p47);
                            if (v3_38 <= null) {
                                v6_14 = v26;
                                v5_19 = v27;
                            } else {
                                String v4_21 = new Object[6];
                                v5_19 = v27;
                                v4_21[v0_17] = v5_19;
                                v4_21[1] = Integer.valueOf((v2_7.length() + 1));
                                Throwable v0_90 = new StringBuilder();
                                v0_90.append(v2_7);
                                v0_90.append("/");
                                v4_21[2] = v0_90.toString();
                                Throwable v0_93 = new StringBuilder();
                                v0_93.append(v2_7);
                                v0_93.append("0");
                                v4_21[3] = v0_93.toString();
                                v6_14 = v26;
                                v4_21[4] = v6_14.getName();
                                v4_21[5] = Integer.valueOf(v6_14.toString().toLowerCase().hashCode());
                                Throwable v0_101 = v4_21;
                                v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                                v8_11.execSQL("UPDATE files SET _data=?1||SUBSTR(_data, ?2),bucket_display_name=?5,bucket_id=?6 WHERE _data >= ?3 AND _data < ?4;", v0_101);
                            }
                            if ((v3_38 > null) && (!v8_11.inTransaction())) {
                                this.getContext().getContentResolver().notifyChange(v12_3, 0);
                            }
                            if (v6_14.getName().startsWith(".")) {
                                v14_0.processNewNoMediaPath(v10_4, v8_11, v5_19);
                            }
                            return v3_38;
                        }
                    }
                }
            }
            Throwable v0_64;
            String v42;
            String v12_0;
            int v11_0;
            int v13_1;
            switch (v11_6) {
                case 1:
                case 2:
                case 200:
                case 201:
                    int v11_5 = v17_0;
                    v13_1 = v8_0;
                    String v8_8 = v12_3;
                    String v12_6 = v9_0;
                    void v9_6 = v14_0;
                    android.content.ContentValues v5_14 = new android.content.ContentValues(p45);
                    v5_14.remove("bucket_id");
                    v5_14.remove("bucket_display_name");
                    String v4_13 = v5_14.getAsString("_data");
                    if (v4_13 != null) {
                        com.android.providers.media.MediaProvider.computeBucketValues(v4_13, v5_14);
                    }
                    com.android.providers.media.MediaProvider.computeTakenTime(v5_14);
                    v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_5);
                    String v16_7 = v13_1.update(v12_6.table, v5_14, v12_6.where, p47);
                    if ((v16_7 <= null) || (v5_14.getAsString("_data") == null)) {
                        v42 = v8_8;
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + v11_5);
                        v42 = v8_8;
                        String v7_11 = v13_1.query(v12_6.table, com.android.providers.media.MediaProvider.READY_FLAG_PROJECTION, v12_6.where, p47, 0, 0, 0);
                        if (v7_11 == null) {
                            v0_64 = v16_7;
                            String v3 = p47;
                        }
                        try {
                            while (v7_11.moveToNext()) {
                                if (v7_11.getLong(2) == 0) {
                                    v9_6.requestMediaThumbnail(v7_11.getString(v11_5), v42, 10, 0);
                                }
                            }
                        } catch (Throwable v0_81) {
                            libcore.io.IoUtils.closeQuietly(v7_11);
                            throw v0_81;
                        }
                        libcore.io.IoUtils.closeQuietly(v7_11);
                    }
                case 100:
                case 101:
                    int v25;
                    int v36;
                    int v13_2;
                    int v31;
                    String v37;
                    int v32;
                    android.content.ContentValues v38;
                    long v34;
                    int v35;
                    String v6_3 = new android.content.ContentValues(p45);
                    android.content.ContentValues v5_3 = v6_3.getAsString("album_artist");
                    String v3_6 = v6_3.getAsString("compilation");
                    v6_3.remove("compilation");
                    String v2_16 = v6_3.getAsString("artist");
                    v6_3.remove("artist");
                    if (v2_16 == null) {
                        v25 = v2_16;
                        v31 = v3_6;
                        v32 = v5_3;
                        v34 = v8_0;
                        v35 = v9_0;
                        v36 = v10_4;
                        v37 = v11_6;
                        v38 = v12_3;
                        v13_2 = v6_3;
                    } else {
                        long v1_20 = v10_4.mArtistCache;
                        try {
                            long v1_21;
                            String v33;
                            Throwable v0_25 = ((Long) v1_20.get(v2_16));
                        } catch (Throwable v0_26) {
                            v25 = v2_16;
                            v32 = v5_3;
                            v35 = v9_0;
                            v37 = v11_6;
                            v15 = p47;
                        }
                        if (v0_25 != null) {
                            v25 = v2_16;
                            v31 = v3_6;
                            v32 = v5_3;
                            v33 = v6_3;
                            v34 = v8_0;
                            v35 = v9_0;
                            v36 = v10_4;
                            v37 = v11_6;
                            v38 = v12_3;
                            try {
                                v1_21 = v0_25.longValue();
                            } catch (Throwable v0_26) {
                            }
                        } else {
                            try {
                                v25 = v2_16;
                                String v2_17 = v10_4;
                                v31 = v3_6;
                                v32 = v5_3;
                                v33 = v6_3;
                                v34 = v8_0;
                                v35 = v9_0;
                                v36 = v10_4;
                                v37 = v11_6;
                                v38 = v12_3;
                                int v13_3 = v38;
                                try {
                                    v1_21 = v14_0.getKeyIdForName(v2_17, v8_0, "artists", "artist_key", "artist", v25, v25, 0, 0, 0, v1_20, v13_3);
                                } catch (Throwable v0_26) {
                                }
                            } catch (Throwable v0_26) {
                                v25 = v2_17;
                                v32 = "artist_key";
                                v35 = 0;
                                v37 = 0;
                                v15 = v13_3;
                            }
                        }
                        v13_2 = v33;
                        v13_2.put("artist_id", Integer.toString(((int) v1_21)));
                    }
                    int v14_1;
                    String v40;
                    String v41;
                    String v39;
                    String v12_2 = v13_2.getAsString("album");
                    v13_2.remove("album");
                    if (v12_2 == null) {
                        v14_1 = v13_2;
                        int v21 = v32;
                        v39 = v36;
                        v41 = v37;
                        v40 = v38;
                    } else {
                        String v16_5;
                        void v9_3;
                        android.content.ContentValues v5_5;
                        String v7_6 = v13_2.getAsString("_data");
                        String v8_4 = 0;
                        int v11_2 = v32;
                        if (v11_2 == 0) {
                            android.content.ContentValues v10_1 = v31;
                            if ((v10_1 == null) || (!v10_1.equals("1"))) {
                                if (v7_6 != null) {
                                    v9_3 = v37;
                                    v5_5 = v38;
                                } else {
                                    v9_3 = v37;
                                    if (v9_3 != 100) {
                                        long v1_26 = v14_0.query(v38, new String[] {"_data"}), 0, 0, 0);
                                        if (v1_26 == 0) {
                                            v5_5 = v38;
                                        } else {
                                            try {
                                                Throwable v0_36 = v1_26.getCount();
                                            } catch (Throwable v0_38) {
                                                libcore.io.IoUtils.closeQuietly(v1_26);
                                                throw v0_38;
                                            }
                                            if (v0_36 != 1) {
                                                String v3_12 = new StringBuilder();
                                                v3_12.append("");
                                                v3_12.append(v0_36);
                                                v3_12.append(" rows for ");
                                                v5_5 = v38;
                                                try {
                                                    v3_12.append(v5_5);
                                                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v3_12.toString());
                                                } catch (Throwable v0_38) {
                                                }
                                            } else {
                                                try {
                                                    v1_26.moveToFirst();
                                                    v7_6 = v1_26.getString(0);
                                                    v5_5 = v38;
                                                } catch (Throwable v0_38) {
                                                }
                                            }
                                            libcore.io.IoUtils.closeQuietly(v1_26);
                                        }
                                    } else {
                                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Possible multi row album name update without path could give wrong album key");
                                        v5_5 = v38;
                                    }
                                }
                                if (v7_6 != null) {
                                    v8_4 = v7_6.substring(0, v7_6.lastIndexOf(47)).hashCode();
                                }
                                v16_5 = v7_6;
                            } else {
                                v16_5 = v7_6;
                                v9_3 = v37;
                                v5_5 = v38;
                            }
                        } else {
                            v8_4 = v11_2.hashCode();
                            v16_5 = v7_6;
                        }
                        String v7_7 = v12_2.toString();
                        String v4_9 = v36;
                        String v3_15 = v4_9.mAlbumCache;
                        try {
                            long v1_31;
                            Throwable v0_47 = new StringBuilder();
                            v0_47.append(v7_7);
                            v0_47.append(v8_4);
                            Throwable v0_48 = v0_47.toString();
                            String v2_23 = ((Long) v3_15.get(v0_48));
                        } catch (Throwable v0_49) {
                            v39 = v4_9;
                            String v17 = v7_7;
                            v41 = v9_3;
                            v21 = v11_2;
                            int v14 = v13_2;
                            throw v0_49;
                        } catch (Throwable v0_49) {
                        }
                        if (v2_23 != null) {
                            v39 = v4_9;
                            v40 = v5_5;
                            Throwable v18 = v8_4;
                            v41 = v9_3;
                            v21 = v11_2;
                            v14_1 = v13_2;
                            v1_31 = v2_23.longValue();
                        } else {
                            v39 = v4_9;
                            v40 = v5_5;
                            v41 = v9_3;
                            v14_1 = v13_2;
                            v1_31 = v14_0.getKeyIdForName(v4_9, v34, "albums", "album_key", "album", v7_7, v0_48, v16_5, v8_4, v25, v3_15, v40);
                        }
                        v14_1.put("album_id", Integer.toString(((int) v1_31)));
                    }
                    String v2_26;
                    void v9_5;
                    v14_1.remove("title_key");
                    long v1_33 = v14_1.getAsString("title");
                    if (v1_33 == 0) {
                        v2_26 = v14_1;
                        v9_5 = this;
                    } else {
                        v2_26 = v14_1;
                        v9_5 = this;
                        try {
                            Throwable v0_56 = this.getLocalizedTitle(v1_33);
                        } catch (Throwable v0) {
                            v2_26.put("title_resource_uri", v1_33);
                            v2_26.put("title_key", android.provider.MediaStore$Audio.keyFor(v1_33));
                            v2_26.put("title", v1_33.trim());
                        }
                        if (v0_56 == null) {
                            v2_26.putNull("title_resource_uri");
                        } else {
                            v2_26.put("title_resource_uri", v1_33);
                            v1_33 = v0_56;
                        }
                    }
                    String v8_7;
                    android.content.ContentValues v10_3 = v39;
                    v10_3.mNumUpdates = (v10_3.mNumUpdates + 1);
                    String v12_5 = v35;
                    v13_1 = v34;
                    v0_64 = v13_1.update(v12_5.table, v2_26, v12_5.where, p47);
                    int v14_2 = v23;
                    if (v14_2 == 0) {
                        v8_7 = v40;
                    } else {
                        String v15_2;
                        if (v0_64 != 1) {
                            v8_7 = v40;
                            v15_2 = v41;
                        } else {
                            v15_2 = v41;
                            if (v15_2 != 101) {
                                v8_7 = v40;
                            } else {
                                v8_7 = v40;
                                v9_5.updateGenre(Long.parseLong(((String) v8_7.getPathSegments().get(3))), v14_2);
                                v42 = v8_7;
                            }
                        }
                        android.content.ContentValues v5_10 = new StringBuilder();
                        v5_10.append("ignoring genre in update: count = ");
                        v5_10.append(v0_64);
                        v5_10.append(" match = ");
                        v5_10.append(v15_2);
                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v5_10.toString());
                    }
                    break;
                case 113:
                    if (v12_3.getQueryParameter("move") == null) {
                        v13_1 = v8_0;
                        v42 = v12_3;
                        v11_0 = v17_0;
                        v12_0 = v9_0;
                        v14 = v23;
                        v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_0);
                        v0_64 = v13_1.update(v12_0.table, p45, v12_0.where, p47);
                    } else {
                        if (!p45.containsKey("play_order")) {
                            String v2_10 = new StringBuilder();
                            v2_10.append("Need to specify ");
                            v2_10.append("play_order");
                            v2_10.append(" when using \'move\' parameter");
                            throw new IllegalArgumentException(v2_10.toString());
                        } else {
                            String v16_1 = p45.getAsInteger("play_order").intValue();
                            String v4_2 = v12_3.getPathSegments();
                            v0 = "play_order";
                            return v14_0.movePlaylistEntry(v10_4, v8_0, Long.parseLong(((String) v4_2.get(v7_0))), Integer.parseInt(((String) v4_2.get(v1_0))), v16_1);
                        }
                    }
                default:
                    v13_1 = v8_0;
                    v42 = v12_3;
                    v11_0 = v17_0;
                    v12_0 = v9_0;
                    v14 = v23;
            }
            if ((v0_64 > null) && (!v13_1.inTransaction())) {
                this.getContext().getContentResolver().notifyChange(v42, 0);
            }
            return v0_64;
        }
    }

Method com.android.providers.media.MediaProvider.update() calling method android.database.sqlite.SQLiteDatabase.update()


    public int update(android.net.Uri p44, android.content.ContentValues p45, String p46, String[] p47)
    {
        int v14_0 = this;
        String v12_3 = this.safeUncanonicalize(p44);
        int v11_6 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v12_3);
        android.content.ContentValues v10_4 = this.getDatabaseForUri(v12_3);
        if (v10_4 == null) {
            String v4_0 = v12_3;
            void v9 = this;
            String v15 = v11_6;
            long v1_4 = new StringBuilder();
            v1_4.append("Unknown URI: ");
            v1_4.append(v4_0);
            throw new UnsupportedOperationException(v1_4.toString());
        } else {
            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
            String v8_2 = v10_4.getWritableDatabase();
            Throwable v0_27 = 0;
            if (p45 != null) {
                v0_27 = p45.getAsString("genre");
                p45.remove("genre");
            }
            int v23;
            String v8_5;
            String v22_1;
            String v7_8;
            String v7_5 = v0_27;
            android.content.ContentValues v5_7 = this.getTableAndWhere(v12_3, v11_6, p46);
            if (!p45.containsKey("media_type")) {
                v22_1 = v5_7;
                v23 = v7_5;
                v7_8 = v8_2;
                v8_5 = 0;
            } else {
                String v16_6 = p45.getAsLong("media_type").longValue();
                v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                v22_1 = v5_7;
                v23 = v7_5;
                android.content.ContentResolver v24_1 = v8_2;
                Throwable v0_85 = v8_2.query(v5_7.table, com.android.providers.media.MediaProvider.sMediaTableColumns, v5_7.where, p47, 0, 0, 0);
                while(true) {
                    long v1_45 = v0_85;
                    if ((v1_45 == 0) || (!v1_45.moveToNext())) {
                        break;
                    }
                    String v7_16;
                    String v2_31 = v1_45.getLong(1);
                    try {
                        if ((v2_31 != 1) || (v16_6 == 1)) {
                            v7_16 = v24_1;
                            if ((v2_31 == 3) && (v16_6 != 3)) {
                                String v4_30 = new StringBuilder();
                                v4_30.append("need to remove video thumbnail for id ");
                                v4_30.append(v1_45.getString(0));
                                android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_30.toString());
                                v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                            }
                        } else {
                            String v4_34 = new StringBuilder();
                            v4_34.append("need to remove image thumbnail for id ");
                            v4_34.append(v1_45.getString(0));
                            android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_34.toString());
                            v7_16 = v24_1;
                            v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                        }
                        v0_85 = v1_45;
                        v24_1 = v7_16;
                    } catch (Throwable v0_109) {
                        libcore.io.IoUtils.closeQuietly(v1_45);
                        throw v0_109;
                    }
                }
                v7_8 = v24_1;
                v8_5 = 0;
                libcore.io.IoUtils.closeQuietly(v1_45);
            }
            if ((v11_6 != 702) && ((v11_6 != 703) && (v11_6 != 706))) {
                long v1_0 = 5;
                String v17_0 = 1;
                void v9_0 = v22_1;
                String v8_0 = v7_8;
                String v7_0 = 3;
            } else {
                if ((p45 == null) || (((p45.size() != 1) || (!p45.containsKey("_data"))) && ((p45.size() != 2) || ((!p45.containsKey("_data")) || (!p45.containsKey("parent")))))) {
                    v1_0 = 5;
                    v17_0 = 1;
                    v9_0 = v22_1;
                    v8_0 = v7_8;
                    v7_0 = 3;
                } else {
                    String v16_0 = 0;
                    String v2_0 = p45.getAsString("_data");
                    v14_0.mDirectoryCache.remove(v2_0);
                    long v1_1 = new java.io.File(v2_0);
                    if ((v2_0 == null) || (!v1_1.isDirectory())) {
                        v17_0 = 1;
                        v9_0 = v22_1;
                        v8_0 = v7_8;
                        v7_0 = 3;
                        String v6 = v1_1;
                        v1_0 = 5;
                        android.content.ContentValues v5_0 = v2_0;
                        if (v5_0.toLowerCase(java.util.Locale.US).endsWith("/.nomedia")) {
                            v14_0 = v14_0.processNewNoMediaPath(v10_4, v8_0, v5_0);
                        }
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                        v9_0 = v22_1;
                        java.util.HashMap v26 = v1_1;
                        boolean v27 = v2_0;
                        long v28 = v7_8;
                        Throwable v0_17 = v8_5;
                        long v1_5 = v7_8.query(v9_0.table, com.android.providers.media.MediaProvider.PATH_PROJECTION, p46, p47, 0, 0, 0);
                        try {
                            if ((v1_5 != 0) && (v1_5.moveToNext())) {
                                v16_0 = v1_5.getString(1);
                            }
                        } catch (Throwable v0_18) {
                            libcore.io.IoUtils.closeQuietly(v1_5);
                            throw v0_18;
                        }
                        String v2_7 = v16_0;
                        libcore.io.IoUtils.closeQuietly(v1_5);
                        if (v2_7 == null) {
                            android.content.ContentValues v5 = v27;
                            v8_0 = v28;
                            v1_0 = 5;
                            v7_0 = 3;
                            v17_0 = 1;
                        } else {
                            String v6_14;
                            android.content.ContentValues v5_19;
                            v14_0.mDirectoryCache.remove(v2_7);
                            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                            String v8_11 = v28;
                            String v3_38 = v8_11.update(v9_0.table, p45, v9_0.where, p47);
                            if (v3_38 <= null) {
                                v6_14 = v26;
                                v5_19 = v27;
                            } else {
                                String v4_21 = new Object[6];
                                v5_19 = v27;
                                v4_21[v0_17] = v5_19;
                                v4_21[1] = Integer.valueOf((v2_7.length() + 1));
                                Throwable v0_90 = new StringBuilder();
                                v0_90.append(v2_7);
                                v0_90.append("/");
                                v4_21[2] = v0_90.toString();
                                Throwable v0_93 = new StringBuilder();
                                v0_93.append(v2_7);
                                v0_93.append("0");
                                v4_21[3] = v0_93.toString();
                                v6_14 = v26;
                                v4_21[4] = v6_14.getName();
                                v4_21[5] = Integer.valueOf(v6_14.toString().toLowerCase().hashCode());
                                Throwable v0_101 = v4_21;
                                v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                                v8_11.execSQL("UPDATE files SET _data=?1||SUBSTR(_data, ?2),bucket_display_name=?5,bucket_id=?6 WHERE _data >= ?3 AND _data < ?4;", v0_101);
                            }
                            if ((v3_38 > null) && (!v8_11.inTransaction())) {
                                this.getContext().getContentResolver().notifyChange(v12_3, 0);
                            }
                            if (v6_14.getName().startsWith(".")) {
                                v14_0.processNewNoMediaPath(v10_4, v8_11, v5_19);
                            }
                            return v3_38;
                        }
                    }
                }
            }
            int v11_0;
            int v13_1;
            String v42;
            Throwable v0_64;
            String v12_0;
            switch (v11_6) {
                case 1:
                case 2:
                case 200:
                case 201:
                    int v11_5 = v17_0;
                    v13_1 = v8_0;
                    String v8_8 = v12_3;
                    String v12_6 = v9_0;
                    void v9_6 = v14_0;
                    android.content.ContentValues v5_14 = new android.content.ContentValues(p45);
                    v5_14.remove("bucket_id");
                    v5_14.remove("bucket_display_name");
                    String v4_13 = v5_14.getAsString("_data");
                    if (v4_13 != null) {
                        com.android.providers.media.MediaProvider.computeBucketValues(v4_13, v5_14);
                    }
                    com.android.providers.media.MediaProvider.computeTakenTime(v5_14);
                    v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_5);
                    String v16_7 = v13_1.update(v12_6.table, v5_14, v12_6.where, p47);
                    if ((v16_7 <= null) || (v5_14.getAsString("_data") == null)) {
                        v42 = v8_8;
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + v11_5);
                        v42 = v8_8;
                        String v7_11 = v13_1.query(v12_6.table, com.android.providers.media.MediaProvider.READY_FLAG_PROJECTION, v12_6.where, p47, 0, 0, 0);
                        if (v7_11 == null) {
                            v0_64 = v16_7;
                            String v3 = p47;
                        }
                        try {
                            while (v7_11.moveToNext()) {
                                if (v7_11.getLong(2) == 0) {
                                    v9_6.requestMediaThumbnail(v7_11.getString(v11_5), v42, 10, 0);
                                }
                            }
                        } catch (Throwable v0_81) {
                            libcore.io.IoUtils.closeQuietly(v7_11);
                            throw v0_81;
                        }
                        libcore.io.IoUtils.closeQuietly(v7_11);
                    }
                case 100:
                case 101:
                    int v35;
                    int v13_2;
                    int v25;
                    int v36;
                    int v31;
                    String v37;
                    int v32;
                    android.content.ContentValues v38;
                    long v34;
                    String v6_3 = new android.content.ContentValues(p45);
                    android.content.ContentValues v5_3 = v6_3.getAsString("album_artist");
                    String v3_6 = v6_3.getAsString("compilation");
                    v6_3.remove("compilation");
                    String v2_16 = v6_3.getAsString("artist");
                    v6_3.remove("artist");
                    if (v2_16 == null) {
                        v25 = v2_16;
                        v31 = v3_6;
                        v32 = v5_3;
                        v34 = v8_0;
                        v35 = v9_0;
                        v36 = v10_4;
                        v37 = v11_6;
                        v38 = v12_3;
                        v13_2 = v6_3;
                    } else {
                        long v1_20 = v10_4.mArtistCache;
                        try {
                            long v1_21;
                            String v33;
                            Throwable v0_25 = ((Long) v1_20.get(v2_16));
                        } catch (Throwable v0_26) {
                            v25 = v2_16;
                            v32 = v5_3;
                            v35 = v9_0;
                            v37 = v11_6;
                            v15 = p47;
                        }
                        if (v0_25 != null) {
                            v25 = v2_16;
                            v31 = v3_6;
                            v32 = v5_3;
                            v33 = v6_3;
                            v34 = v8_0;
                            v35 = v9_0;
                            v36 = v10_4;
                            v37 = v11_6;
                            v38 = v12_3;
                            try {
                                v1_21 = v0_25.longValue();
                            } catch (Throwable v0_26) {
                            }
                        } else {
                            try {
                                v25 = v2_16;
                                String v2_17 = v10_4;
                                v31 = v3_6;
                                v32 = v5_3;
                                v33 = v6_3;
                                v34 = v8_0;
                                v35 = v9_0;
                                v36 = v10_4;
                                v37 = v11_6;
                                v38 = v12_3;
                                int v13_3 = v38;
                                try {
                                    v1_21 = v14_0.getKeyIdForName(v2_17, v8_0, "artists", "artist_key", "artist", v25, v25, 0, 0, 0, v1_20, v13_3);
                                } catch (Throwable v0_26) {
                                }
                            } catch (Throwable v0_26) {
                                v25 = v2_17;
                                v32 = "artist_key";
                                v35 = 0;
                                v37 = 0;
                                v15 = v13_3;
                            }
                        }
                        v13_2 = v33;
                        v13_2.put("artist_id", Integer.toString(((int) v1_21)));
                    }
                    int v14_1;
                    String v40;
                    String v41;
                    String v39;
                    String v12_2 = v13_2.getAsString("album");
                    v13_2.remove("album");
                    if (v12_2 == null) {
                        v14_1 = v13_2;
                        int v21 = v32;
                        v39 = v36;
                        v41 = v37;
                        v40 = v38;
                    } else {
                        String v16_5;
                        void v9_3;
                        android.content.ContentValues v5_5;
                        String v7_6 = v13_2.getAsString("_data");
                        String v8_4 = 0;
                        int v11_2 = v32;
                        if (v11_2 == 0) {
                            android.content.ContentValues v10_1 = v31;
                            if ((v10_1 == null) || (!v10_1.equals("1"))) {
                                if (v7_6 != null) {
                                    v9_3 = v37;
                                    v5_5 = v38;
                                } else {
                                    v9_3 = v37;
                                    if (v9_3 != 100) {
                                        long v1_26 = v14_0.query(v38, new String[] {"_data"}), 0, 0, 0);
                                        if (v1_26 == 0) {
                                            v5_5 = v38;
                                        } else {
                                            try {
                                                Throwable v0_36 = v1_26.getCount();
                                            } catch (Throwable v0_38) {
                                                libcore.io.IoUtils.closeQuietly(v1_26);
                                                throw v0_38;
                                            }
                                            if (v0_36 != 1) {
                                                String v3_12 = new StringBuilder();
                                                v3_12.append("");
                                                v3_12.append(v0_36);
                                                v3_12.append(" rows for ");
                                                v5_5 = v38;
                                                try {
                                                    v3_12.append(v5_5);
                                                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v3_12.toString());
                                                } catch (Throwable v0_38) {
                                                }
                                            } else {
                                                try {
                                                    v1_26.moveToFirst();
                                                    v7_6 = v1_26.getString(0);
                                                    v5_5 = v38;
                                                } catch (Throwable v0_38) {
                                                }
                                            }
                                            libcore.io.IoUtils.closeQuietly(v1_26);
                                        }
                                    } else {
                                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Possible multi row album name update without path could give wrong album key");
                                        v5_5 = v38;
                                    }
                                }
                                if (v7_6 != null) {
                                    v8_4 = v7_6.substring(0, v7_6.lastIndexOf(47)).hashCode();
                                }
                                v16_5 = v7_6;
                            } else {
                                v16_5 = v7_6;
                                v9_3 = v37;
                                v5_5 = v38;
                            }
                        } else {
                            v8_4 = v11_2.hashCode();
                            v16_5 = v7_6;
                        }
                        String v7_7 = v12_2.toString();
                        String v4_9 = v36;
                        String v3_15 = v4_9.mAlbumCache;
                        try {
                            long v1_31;
                            Throwable v0_47 = new StringBuilder();
                            v0_47.append(v7_7);
                            v0_47.append(v8_4);
                            Throwable v0_48 = v0_47.toString();
                            String v2_23 = ((Long) v3_15.get(v0_48));
                        } catch (Throwable v0_49) {
                            v39 = v4_9;
                            String v17 = v7_7;
                            v41 = v9_3;
                            v21 = v11_2;
                            int v14 = v13_2;
                            throw v0_49;
                        } catch (Throwable v0_49) {
                        }
                        if (v2_23 != null) {
                            v39 = v4_9;
                            v40 = v5_5;
                            Throwable v18 = v8_4;
                            v41 = v9_3;
                            v21 = v11_2;
                            v14_1 = v13_2;
                            v1_31 = v2_23.longValue();
                        } else {
                            v39 = v4_9;
                            v40 = v5_5;
                            v41 = v9_3;
                            v14_1 = v13_2;
                            v1_31 = v14_0.getKeyIdForName(v4_9, v34, "albums", "album_key", "album", v7_7, v0_48, v16_5, v8_4, v25, v3_15, v40);
                        }
                        v14_1.put("album_id", Integer.toString(((int) v1_31)));
                    }
                    String v2_26;
                    void v9_5;
                    v14_1.remove("title_key");
                    long v1_33 = v14_1.getAsString("title");
                    if (v1_33 == 0) {
                        v2_26 = v14_1;
                        v9_5 = this;
                    } else {
                        v2_26 = v14_1;
                        v9_5 = this;
                        try {
                            Throwable v0_56 = this.getLocalizedTitle(v1_33);
                        } catch (Throwable v0) {
                            v2_26.put("title_resource_uri", v1_33);
                            v2_26.put("title_key", android.provider.MediaStore$Audio.keyFor(v1_33));
                            v2_26.put("title", v1_33.trim());
                        }
                        if (v0_56 == null) {
                            v2_26.putNull("title_resource_uri");
                        } else {
                            v2_26.put("title_resource_uri", v1_33);
                            v1_33 = v0_56;
                        }
                    }
                    String v8_7;
                    android.content.ContentValues v10_3 = v39;
                    v10_3.mNumUpdates = (v10_3.mNumUpdates + 1);
                    String v12_5 = v35;
                    v13_1 = v34;
                    v0_64 = v13_1.update(v12_5.table, v2_26, v12_5.where, p47);
                    int v14_2 = v23;
                    if (v14_2 == 0) {
                        v8_7 = v40;
                    } else {
                        String v15_2;
                        if (v0_64 != 1) {
                            v8_7 = v40;
                            v15_2 = v41;
                        } else {
                            v15_2 = v41;
                            if (v15_2 != 101) {
                                v8_7 = v40;
                            } else {
                                v8_7 = v40;
                                v9_5.updateGenre(Long.parseLong(((String) v8_7.getPathSegments().get(3))), v14_2);
                                v42 = v8_7;
                            }
                        }
                        android.content.ContentValues v5_10 = new StringBuilder();
                        v5_10.append("ignoring genre in update: count = ");
                        v5_10.append(v0_64);
                        v5_10.append(" match = ");
                        v5_10.append(v15_2);
                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v5_10.toString());
                    }
                    break;
                case 113:
                    if (v12_3.getQueryParameter("move") == null) {
                        v13_1 = v8_0;
                        v42 = v12_3;
                        v11_0 = v17_0;
                        v12_0 = v9_0;
                        v14 = v23;
                        v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_0);
                        v0_64 = v13_1.update(v12_0.table, p45, v12_0.where, p47);
                    } else {
                        if (!p45.containsKey("play_order")) {
                            String v2_10 = new StringBuilder();
                            v2_10.append("Need to specify ");
                            v2_10.append("play_order");
                            v2_10.append(" when using \'move\' parameter");
                            throw new IllegalArgumentException(v2_10.toString());
                        } else {
                            String v16_1 = p45.getAsInteger("play_order").intValue();
                            String v4_2 = v12_3.getPathSegments();
                            v0 = "play_order";
                            return v14_0.movePlaylistEntry(v10_4, v8_0, Long.parseLong(((String) v4_2.get(v7_0))), Integer.parseInt(((String) v4_2.get(v1_0))), v16_1);
                        }
                    }
                default:
                    v13_1 = v8_0;
                    v42 = v12_3;
                    v11_0 = v17_0;
                    v12_0 = v9_0;
                    v14 = v23;
            }
            if ((v0_64 > null) && (!v13_1.inTransaction())) {
                this.getContext().getContentResolver().notifyChange(v42, 0);
            }
            return v0_64;
        }
    }

Method com.android.providers.media.MediaProvider.update() calling method android.database.sqlite.SQLiteDatabase.update()


    public int update(android.net.Uri p44, android.content.ContentValues p45, String p46, String[] p47)
    {
        int v14_0 = this;
        String v12_3 = this.safeUncanonicalize(p44);
        int v11_6 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v12_3);
        android.content.ContentValues v10_4 = this.getDatabaseForUri(v12_3);
        if (v10_4 == null) {
            String v4_0 = v12_3;
            void v9 = this;
            String v15 = v11_6;
            long v1_4 = new StringBuilder();
            v1_4.append("Unknown URI: ");
            v1_4.append(v4_0);
            throw new UnsupportedOperationException(v1_4.toString());
        } else {
            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
            String v8_2 = v10_4.getWritableDatabase();
            Throwable v0_27 = 0;
            if (p45 != null) {
                v0_27 = p45.getAsString("genre");
                p45.remove("genre");
            }
            int v23;
            String v8_5;
            String v7_8;
            String v22_1;
            String v7_5 = v0_27;
            android.content.ContentValues v5_7 = this.getTableAndWhere(v12_3, v11_6, p46);
            if (!p45.containsKey("media_type")) {
                v22_1 = v5_7;
                v23 = v7_5;
                v7_8 = v8_2;
                v8_5 = 0;
            } else {
                String v16_6 = p45.getAsLong("media_type").longValue();
                v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                v22_1 = v5_7;
                v23 = v7_5;
                android.content.ContentResolver v24_1 = v8_2;
                Throwable v0_85 = v8_2.query(v5_7.table, com.android.providers.media.MediaProvider.sMediaTableColumns, v5_7.where, p47, 0, 0, 0);
                while(true) {
                    long v1_45 = v0_85;
                    if ((v1_45 == 0) || (!v1_45.moveToNext())) {
                        break;
                    }
                    String v7_16;
                    String v2_31 = v1_45.getLong(1);
                    try {
                        if ((v2_31 != 1) || (v16_6 == 1)) {
                            v7_16 = v24_1;
                            if ((v2_31 == 3) && (v16_6 != 3)) {
                                String v4_30 = new StringBuilder();
                                v4_30.append("need to remove video thumbnail for id ");
                                v4_30.append(v1_45.getString(0));
                                android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_30.toString());
                                v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                            }
                        } else {
                            String v4_34 = new StringBuilder();
                            v4_34.append("need to remove image thumbnail for id ");
                            v4_34.append(v1_45.getString(0));
                            android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_34.toString());
                            v7_16 = v24_1;
                            v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                        }
                        v0_85 = v1_45;
                        v24_1 = v7_16;
                    } catch (Throwable v0_109) {
                        libcore.io.IoUtils.closeQuietly(v1_45);
                        throw v0_109;
                    }
                }
                v7_8 = v24_1;
                v8_5 = 0;
                libcore.io.IoUtils.closeQuietly(v1_45);
            }
            if ((v11_6 != 702) && ((v11_6 != 703) && (v11_6 != 706))) {
                long v1_0 = 5;
                String v17_0 = 1;
                void v9_0 = v22_1;
                String v8_0 = v7_8;
                String v7_0 = 3;
            } else {
                if ((p45 == null) || (((p45.size() != 1) || (!p45.containsKey("_data"))) && ((p45.size() != 2) || ((!p45.containsKey("_data")) || (!p45.containsKey("parent")))))) {
                    v1_0 = 5;
                    v17_0 = 1;
                    v9_0 = v22_1;
                    v8_0 = v7_8;
                    v7_0 = 3;
                } else {
                    String v16_0 = 0;
                    String v2_0 = p45.getAsString("_data");
                    v14_0.mDirectoryCache.remove(v2_0);
                    long v1_1 = new java.io.File(v2_0);
                    if ((v2_0 == null) || (!v1_1.isDirectory())) {
                        v17_0 = 1;
                        v9_0 = v22_1;
                        v8_0 = v7_8;
                        v7_0 = 3;
                        String v6 = v1_1;
                        v1_0 = 5;
                        android.content.ContentValues v5_0 = v2_0;
                        if (v5_0.toLowerCase(java.util.Locale.US).endsWith("/.nomedia")) {
                            v14_0 = v14_0.processNewNoMediaPath(v10_4, v8_0, v5_0);
                        }
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                        v9_0 = v22_1;
                        java.util.HashMap v26 = v1_1;
                        boolean v27 = v2_0;
                        long v28 = v7_8;
                        Throwable v0_17 = v8_5;
                        long v1_5 = v7_8.query(v9_0.table, com.android.providers.media.MediaProvider.PATH_PROJECTION, p46, p47, 0, 0, 0);
                        try {
                            if ((v1_5 != 0) && (v1_5.moveToNext())) {
                                v16_0 = v1_5.getString(1);
                            }
                        } catch (Throwable v0_18) {
                            libcore.io.IoUtils.closeQuietly(v1_5);
                            throw v0_18;
                        }
                        String v2_7 = v16_0;
                        libcore.io.IoUtils.closeQuietly(v1_5);
                        if (v2_7 == null) {
                            android.content.ContentValues v5 = v27;
                            v8_0 = v28;
                            v1_0 = 5;
                            v7_0 = 3;
                            v17_0 = 1;
                        } else {
                            android.content.ContentValues v5_19;
                            String v6_14;
                            v14_0.mDirectoryCache.remove(v2_7);
                            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                            String v8_11 = v28;
                            String v3_38 = v8_11.update(v9_0.table, p45, v9_0.where, p47);
                            if (v3_38 <= null) {
                                v6_14 = v26;
                                v5_19 = v27;
                            } else {
                                String v4_21 = new Object[6];
                                v5_19 = v27;
                                v4_21[v0_17] = v5_19;
                                v4_21[1] = Integer.valueOf((v2_7.length() + 1));
                                Throwable v0_90 = new StringBuilder();
                                v0_90.append(v2_7);
                                v0_90.append("/");
                                v4_21[2] = v0_90.toString();
                                Throwable v0_93 = new StringBuilder();
                                v0_93.append(v2_7);
                                v0_93.append("0");
                                v4_21[3] = v0_93.toString();
                                v6_14 = v26;
                                v4_21[4] = v6_14.getName();
                                v4_21[5] = Integer.valueOf(v6_14.toString().toLowerCase().hashCode());
                                Throwable v0_101 = v4_21;
                                v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                                v8_11.execSQL("UPDATE files SET _data=?1||SUBSTR(_data, ?2),bucket_display_name=?5,bucket_id=?6 WHERE _data >= ?3 AND _data < ?4;", v0_101);
                            }
                            if ((v3_38 > null) && (!v8_11.inTransaction())) {
                                this.getContext().getContentResolver().notifyChange(v12_3, 0);
                            }
                            if (v6_14.getName().startsWith(".")) {
                                v14_0.processNewNoMediaPath(v10_4, v8_11, v5_19);
                            }
                            return v3_38;
                        }
                    }
                }
            }
            int v13_1;
            String v12_0;
            Throwable v0_64;
            int v11_0;
            String v42;
            switch (v11_6) {
                case 1:
                case 2:
                case 200:
                case 201:
                    int v11_5 = v17_0;
                    v13_1 = v8_0;
                    String v8_8 = v12_3;
                    String v12_6 = v9_0;
                    void v9_6 = v14_0;
                    android.content.ContentValues v5_14 = new android.content.ContentValues(p45);
                    v5_14.remove("bucket_id");
                    v5_14.remove("bucket_display_name");
                    String v4_13 = v5_14.getAsString("_data");
                    if (v4_13 != null) {
                        com.android.providers.media.MediaProvider.computeBucketValues(v4_13, v5_14);
                    }
                    com.android.providers.media.MediaProvider.computeTakenTime(v5_14);
                    v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_5);
                    String v16_7 = v13_1.update(v12_6.table, v5_14, v12_6.where, p47);
                    if ((v16_7 <= null) || (v5_14.getAsString("_data") == null)) {
                        v42 = v8_8;
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + v11_5);
                        v42 = v8_8;
                        String v7_11 = v13_1.query(v12_6.table, com.android.providers.media.MediaProvider.READY_FLAG_PROJECTION, v12_6.where, p47, 0, 0, 0);
                        if (v7_11 == null) {
                            v0_64 = v16_7;
                            String v3 = p47;
                        }
                        try {
                            while (v7_11.moveToNext()) {
                                if (v7_11.getLong(2) == 0) {
                                    v9_6.requestMediaThumbnail(v7_11.getString(v11_5), v42, 10, 0);
                                }
                            }
                        } catch (Throwable v0_81) {
                            libcore.io.IoUtils.closeQuietly(v7_11);
                            throw v0_81;
                        }
                        libcore.io.IoUtils.closeQuietly(v7_11);
                    }
                case 100:
                case 101:
                    int v32;
                    android.content.ContentValues v38;
                    long v34;
                    int v35;
                    int v13_2;
                    int v36;
                    int v25;
                    int v31;
                    String v37;
                    String v6_3 = new android.content.ContentValues(p45);
                    android.content.ContentValues v5_3 = v6_3.getAsString("album_artist");
                    String v3_6 = v6_3.getAsString("compilation");
                    v6_3.remove("compilation");
                    String v2_16 = v6_3.getAsString("artist");
                    v6_3.remove("artist");
                    if (v2_16 == null) {
                        v25 = v2_16;
                        v31 = v3_6;
                        v32 = v5_3;
                        v34 = v8_0;
                        v35 = v9_0;
                        v36 = v10_4;
                        v37 = v11_6;
                        v38 = v12_3;
                        v13_2 = v6_3;
                    } else {
                        long v1_20 = v10_4.mArtistCache;
                        try {
                            long v1_21;
                            String v33;
                            Throwable v0_25 = ((Long) v1_20.get(v2_16));
                        } catch (Throwable v0_26) {
                            v25 = v2_16;
                            v32 = v5_3;
                            v35 = v9_0;
                            v37 = v11_6;
                            v15 = p47;
                        }
                        if (v0_25 != null) {
                            v25 = v2_16;
                            v31 = v3_6;
                            v32 = v5_3;
                            v33 = v6_3;
                            v34 = v8_0;
                            v35 = v9_0;
                            v36 = v10_4;
                            v37 = v11_6;
                            v38 = v12_3;
                            try {
                                v1_21 = v0_25.longValue();
                            } catch (Throwable v0_26) {
                            }
                        } else {
                            try {
                                v25 = v2_16;
                                String v2_17 = v10_4;
                                v31 = v3_6;
                                v32 = v5_3;
                                v33 = v6_3;
                                v34 = v8_0;
                                v35 = v9_0;
                                v36 = v10_4;
                                v37 = v11_6;
                                v38 = v12_3;
                                int v13_3 = v38;
                                try {
                                    v1_21 = v14_0.getKeyIdForName(v2_17, v8_0, "artists", "artist_key", "artist", v25, v25, 0, 0, 0, v1_20, v13_3);
                                } catch (Throwable v0_26) {
                                }
                            } catch (Throwable v0_26) {
                                v25 = v2_17;
                                v32 = "artist_key";
                                v35 = 0;
                                v37 = 0;
                                v15 = v13_3;
                            }
                        }
                        v13_2 = v33;
                        v13_2.put("artist_id", Integer.toString(((int) v1_21)));
                    }
                    String v39;
                    int v14_1;
                    String v40;
                    String v41;
                    String v12_2 = v13_2.getAsString("album");
                    v13_2.remove("album");
                    if (v12_2 == null) {
                        v14_1 = v13_2;
                        int v21 = v32;
                        v39 = v36;
                        v41 = v37;
                        v40 = v38;
                    } else {
                        String v16_5;
                        void v9_3;
                        android.content.ContentValues v5_5;
                        String v7_6 = v13_2.getAsString("_data");
                        String v8_4 = 0;
                        int v11_2 = v32;
                        if (v11_2 == 0) {
                            android.content.ContentValues v10_1 = v31;
                            if ((v10_1 == null) || (!v10_1.equals("1"))) {
                                if (v7_6 != null) {
                                    v9_3 = v37;
                                    v5_5 = v38;
                                } else {
                                    v9_3 = v37;
                                    if (v9_3 != 100) {
                                        long v1_26 = v14_0.query(v38, new String[] {"_data"}), 0, 0, 0);
                                        if (v1_26 == 0) {
                                            v5_5 = v38;
                                        } else {
                                            try {
                                                Throwable v0_36 = v1_26.getCount();
                                            } catch (Throwable v0_38) {
                                                libcore.io.IoUtils.closeQuietly(v1_26);
                                                throw v0_38;
                                            }
                                            if (v0_36 != 1) {
                                                String v3_12 = new StringBuilder();
                                                v3_12.append("");
                                                v3_12.append(v0_36);
                                                v3_12.append(" rows for ");
                                                v5_5 = v38;
                                                try {
                                                    v3_12.append(v5_5);
                                                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v3_12.toString());
                                                } catch (Throwable v0_38) {
                                                }
                                            } else {
                                                try {
                                                    v1_26.moveToFirst();
                                                    v7_6 = v1_26.getString(0);
                                                    v5_5 = v38;
                                                } catch (Throwable v0_38) {
                                                }
                                            }
                                            libcore.io.IoUtils.closeQuietly(v1_26);
                                        }
                                    } else {
                                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Possible multi row album name update without path could give wrong album key");
                                        v5_5 = v38;
                                    }
                                }
                                if (v7_6 != null) {
                                    v8_4 = v7_6.substring(0, v7_6.lastIndexOf(47)).hashCode();
                                }
                                v16_5 = v7_6;
                            } else {
                                v16_5 = v7_6;
                                v9_3 = v37;
                                v5_5 = v38;
                            }
                        } else {
                            v8_4 = v11_2.hashCode();
                            v16_5 = v7_6;
                        }
                        String v7_7 = v12_2.toString();
                        String v4_9 = v36;
                        String v3_15 = v4_9.mAlbumCache;
                        try {
                            long v1_31;
                            Throwable v0_47 = new StringBuilder();
                            v0_47.append(v7_7);
                            v0_47.append(v8_4);
                            Throwable v0_48 = v0_47.toString();
                            String v2_23 = ((Long) v3_15.get(v0_48));
                        } catch (Throwable v0_49) {
                            v39 = v4_9;
                            String v17 = v7_7;
                            v41 = v9_3;
                            v21 = v11_2;
                            int v14 = v13_2;
                            throw v0_49;
                        } catch (Throwable v0_49) {
                        }
                        if (v2_23 != null) {
                            v39 = v4_9;
                            v40 = v5_5;
                            Throwable v18 = v8_4;
                            v41 = v9_3;
                            v21 = v11_2;
                            v14_1 = v13_2;
                            v1_31 = v2_23.longValue();
                        } else {
                            v39 = v4_9;
                            v40 = v5_5;
                            v41 = v9_3;
                            v14_1 = v13_2;
                            v1_31 = v14_0.getKeyIdForName(v4_9, v34, "albums", "album_key", "album", v7_7, v0_48, v16_5, v8_4, v25, v3_15, v40);
                        }
                        v14_1.put("album_id", Integer.toString(((int) v1_31)));
                    }
                    void v9_5;
                    String v2_26;
                    v14_1.remove("title_key");
                    long v1_33 = v14_1.getAsString("title");
                    if (v1_33 == 0) {
                        v2_26 = v14_1;
                        v9_5 = this;
                    } else {
                        v2_26 = v14_1;
                        v9_5 = this;
                        try {
                            Throwable v0_56 = this.getLocalizedTitle(v1_33);
                        } catch (Throwable v0) {
                            v2_26.put("title_resource_uri", v1_33);
                            v2_26.put("title_key", android.provider.MediaStore$Audio.keyFor(v1_33));
                            v2_26.put("title", v1_33.trim());
                        }
                        if (v0_56 == null) {
                            v2_26.putNull("title_resource_uri");
                        } else {
                            v2_26.put("title_resource_uri", v1_33);
                            v1_33 = v0_56;
                        }
                    }
                    String v8_7;
                    android.content.ContentValues v10_3 = v39;
                    v10_3.mNumUpdates = (v10_3.mNumUpdates + 1);
                    String v12_5 = v35;
                    v13_1 = v34;
                    v0_64 = v13_1.update(v12_5.table, v2_26, v12_5.where, p47);
                    int v14_2 = v23;
                    if (v14_2 == 0) {
                        v8_7 = v40;
                    } else {
                        String v15_2;
                        if (v0_64 != 1) {
                            v8_7 = v40;
                            v15_2 = v41;
                        } else {
                            v15_2 = v41;
                            if (v15_2 != 101) {
                                v8_7 = v40;
                            } else {
                                v8_7 = v40;
                                v9_5.updateGenre(Long.parseLong(((String) v8_7.getPathSegments().get(3))), v14_2);
                                v42 = v8_7;
                            }
                        }
                        android.content.ContentValues v5_10 = new StringBuilder();
                        v5_10.append("ignoring genre in update: count = ");
                        v5_10.append(v0_64);
                        v5_10.append(" match = ");
                        v5_10.append(v15_2);
                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v5_10.toString());
                    }
                    break;
                case 113:
                    if (v12_3.getQueryParameter("move") == null) {
                        v13_1 = v8_0;
                        v42 = v12_3;
                        v11_0 = v17_0;
                        v12_0 = v9_0;
                        v14 = v23;
                        v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_0);
                        v0_64 = v13_1.update(v12_0.table, p45, v12_0.where, p47);
                    } else {
                        if (!p45.containsKey("play_order")) {
                            String v2_10 = new StringBuilder();
                            v2_10.append("Need to specify ");
                            v2_10.append("play_order");
                            v2_10.append(" when using \'move\' parameter");
                            throw new IllegalArgumentException(v2_10.toString());
                        } else {
                            String v16_1 = p45.getAsInteger("play_order").intValue();
                            String v4_2 = v12_3.getPathSegments();
                            v0 = "play_order";
                            return v14_0.movePlaylistEntry(v10_4, v8_0, Long.parseLong(((String) v4_2.get(v7_0))), Integer.parseInt(((String) v4_2.get(v1_0))), v16_1);
                        }
                    }
                default:
                    v13_1 = v8_0;
                    v42 = v12_3;
                    v11_0 = v17_0;
                    v12_0 = v9_0;
                    v14 = v23;
            }
            if ((v0_64 > null) && (!v13_1.inTransaction())) {
                this.getContext().getContentResolver().notifyChange(v42, 0);
            }
            return v0_64;
        }
    }

Method com.android.providers.media.MediaProvider.update() calling method android.database.sqlite.SQLiteDatabase.update()


    public int update(android.net.Uri p44, android.content.ContentValues p45, String p46, String[] p47)
    {
        int v14_0 = this;
        String v12_3 = this.safeUncanonicalize(p44);
        int v11_6 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v12_3);
        android.content.ContentValues v10_4 = this.getDatabaseForUri(v12_3);
        if (v10_4 == null) {
            String v4_0 = v12_3;
            void v9 = this;
            String v15 = v11_6;
            long v1_4 = new StringBuilder();
            v1_4.append("Unknown URI: ");
            v1_4.append(v4_0);
            throw new UnsupportedOperationException(v1_4.toString());
        } else {
            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
            String v8_2 = v10_4.getWritableDatabase();
            Throwable v0_27 = 0;
            if (p45 != null) {
                v0_27 = p45.getAsString("genre");
                p45.remove("genre");
            }
            String v8_5;
            String v22_1;
            String v7_8;
            int v23;
            String v7_5 = v0_27;
            android.content.ContentValues v5_7 = this.getTableAndWhere(v12_3, v11_6, p46);
            if (!p45.containsKey("media_type")) {
                v22_1 = v5_7;
                v23 = v7_5;
                v7_8 = v8_2;
                v8_5 = 0;
            } else {
                String v16_6 = p45.getAsLong("media_type").longValue();
                v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                v22_1 = v5_7;
                v23 = v7_5;
                android.content.ContentResolver v24_1 = v8_2;
                Throwable v0_85 = v8_2.query(v5_7.table, com.android.providers.media.MediaProvider.sMediaTableColumns, v5_7.where, p47, 0, 0, 0);
                while(true) {
                    long v1_45 = v0_85;
                    if ((v1_45 == 0) || (!v1_45.moveToNext())) {
                        break;
                    }
                    String v7_16;
                    String v2_31 = v1_45.getLong(1);
                    try {
                        if ((v2_31 != 1) || (v16_6 == 1)) {
                            v7_16 = v24_1;
                            if ((v2_31 == 3) && (v16_6 != 3)) {
                                String v4_30 = new StringBuilder();
                                v4_30.append("need to remove video thumbnail for id ");
                                v4_30.append(v1_45.getString(0));
                                android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_30.toString());
                                v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                            }
                        } else {
                            String v4_34 = new StringBuilder();
                            v4_34.append("need to remove image thumbnail for id ");
                            v4_34.append(v1_45.getString(0));
                            android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_34.toString());
                            v7_16 = v24_1;
                            v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                        }
                        v0_85 = v1_45;
                        v24_1 = v7_16;
                    } catch (Throwable v0_109) {
                        libcore.io.IoUtils.closeQuietly(v1_45);
                        throw v0_109;
                    }
                }
                v7_8 = v24_1;
                v8_5 = 0;
                libcore.io.IoUtils.closeQuietly(v1_45);
            }
            if ((v11_6 != 702) && ((v11_6 != 703) && (v11_6 != 706))) {
                long v1_0 = 5;
                String v17_0 = 1;
                void v9_0 = v22_1;
                String v8_0 = v7_8;
                String v7_0 = 3;
            } else {
                if ((p45 == null) || (((p45.size() != 1) || (!p45.containsKey("_data"))) && ((p45.size() != 2) || ((!p45.containsKey("_data")) || (!p45.containsKey("parent")))))) {
                    v1_0 = 5;
                    v17_0 = 1;
                    v9_0 = v22_1;
                    v8_0 = v7_8;
                    v7_0 = 3;
                } else {
                    String v16_0 = 0;
                    String v2_0 = p45.getAsString("_data");
                    v14_0.mDirectoryCache.remove(v2_0);
                    long v1_1 = new java.io.File(v2_0);
                    if ((v2_0 == null) || (!v1_1.isDirectory())) {
                        v17_0 = 1;
                        v9_0 = v22_1;
                        v8_0 = v7_8;
                        v7_0 = 3;
                        String v6 = v1_1;
                        v1_0 = 5;
                        android.content.ContentValues v5_0 = v2_0;
                        if (v5_0.toLowerCase(java.util.Locale.US).endsWith("/.nomedia")) {
                            v14_0 = v14_0.processNewNoMediaPath(v10_4, v8_0, v5_0);
                        }
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                        v9_0 = v22_1;
                        java.util.HashMap v26 = v1_1;
                        boolean v27 = v2_0;
                        long v28 = v7_8;
                        Throwable v0_17 = v8_5;
                        long v1_5 = v7_8.query(v9_0.table, com.android.providers.media.MediaProvider.PATH_PROJECTION, p46, p47, 0, 0, 0);
                        try {
                            if ((v1_5 != 0) && (v1_5.moveToNext())) {
                                v16_0 = v1_5.getString(1);
                            }
                        } catch (Throwable v0_18) {
                            libcore.io.IoUtils.closeQuietly(v1_5);
                            throw v0_18;
                        }
                        String v2_7 = v16_0;
                        libcore.io.IoUtils.closeQuietly(v1_5);
                        if (v2_7 == null) {
                            android.content.ContentValues v5 = v27;
                            v8_0 = v28;
                            v1_0 = 5;
                            v7_0 = 3;
                            v17_0 = 1;
                        } else {
                            String v6_14;
                            android.content.ContentValues v5_19;
                            v14_0.mDirectoryCache.remove(v2_7);
                            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                            String v8_11 = v28;
                            String v3_38 = v8_11.update(v9_0.table, p45, v9_0.where, p47);
                            if (v3_38 <= null) {
                                v6_14 = v26;
                                v5_19 = v27;
                            } else {
                                String v4_21 = new Object[6];
                                v5_19 = v27;
                                v4_21[v0_17] = v5_19;
                                v4_21[1] = Integer.valueOf((v2_7.length() + 1));
                                Throwable v0_90 = new StringBuilder();
                                v0_90.append(v2_7);
                                v0_90.append("/");
                                v4_21[2] = v0_90.toString();
                                Throwable v0_93 = new StringBuilder();
                                v0_93.append(v2_7);
                                v0_93.append("0");
                                v4_21[3] = v0_93.toString();
                                v6_14 = v26;
                                v4_21[4] = v6_14.getName();
                                v4_21[5] = Integer.valueOf(v6_14.toString().toLowerCase().hashCode());
                                Throwable v0_101 = v4_21;
                                v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                                v8_11.execSQL("UPDATE files SET _data=?1||SUBSTR(_data, ?2),bucket_display_name=?5,bucket_id=?6 WHERE _data >= ?3 AND _data < ?4;", v0_101);
                            }
                            if ((v3_38 > null) && (!v8_11.inTransaction())) {
                                this.getContext().getContentResolver().notifyChange(v12_3, 0);
                            }
                            if (v6_14.getName().startsWith(".")) {
                                v14_0.processNewNoMediaPath(v10_4, v8_11, v5_19);
                            }
                            return v3_38;
                        }
                    }
                }
            }
            Throwable v0_64;
            String v12_0;
            int v11_0;
            String v42;
            int v13_1;
            switch (v11_6) {
                case 1:
                case 2:
                case 200:
                case 201:
                    int v11_5 = v17_0;
                    v13_1 = v8_0;
                    String v8_8 = v12_3;
                    String v12_6 = v9_0;
                    void v9_6 = v14_0;
                    android.content.ContentValues v5_14 = new android.content.ContentValues(p45);
                    v5_14.remove("bucket_id");
                    v5_14.remove("bucket_display_name");
                    String v4_13 = v5_14.getAsString("_data");
                    if (v4_13 != null) {
                        com.android.providers.media.MediaProvider.computeBucketValues(v4_13, v5_14);
                    }
                    com.android.providers.media.MediaProvider.computeTakenTime(v5_14);
                    v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_5);
                    String v16_7 = v13_1.update(v12_6.table, v5_14, v12_6.where, p47);
                    if ((v16_7 <= null) || (v5_14.getAsString("_data") == null)) {
                        v42 = v8_8;
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + v11_5);
                        v42 = v8_8;
                        String v7_11 = v13_1.query(v12_6.table, com.android.providers.media.MediaProvider.READY_FLAG_PROJECTION, v12_6.where, p47, 0, 0, 0);
                        if (v7_11 == null) {
                            v0_64 = v16_7;
                            String v3 = p47;
                        }
                        try {
                            while (v7_11.moveToNext()) {
                                if (v7_11.getLong(2) == 0) {
                                    v9_6.requestMediaThumbnail(v7_11.getString(v11_5), v42, 10, 0);
                                }
                            }
                        } catch (Throwable v0_81) {
                            libcore.io.IoUtils.closeQuietly(v7_11);
                            throw v0_81;
                        }
                        libcore.io.IoUtils.closeQuietly(v7_11);
                    }
                case 100:
                case 101:
                    int v32;
                    String v37;
                    int v25;
                    int v35;
                    int v13_2;
                    int v36;
                    android.content.ContentValues v38;
                    long v34;
                    int v31;
                    String v6_3 = new android.content.ContentValues(p45);
                    android.content.ContentValues v5_3 = v6_3.getAsString("album_artist");
                    String v3_6 = v6_3.getAsString("compilation");
                    v6_3.remove("compilation");
                    String v2_16 = v6_3.getAsString("artist");
                    v6_3.remove("artist");
                    if (v2_16 == null) {
                        v25 = v2_16;
                        v31 = v3_6;
                        v32 = v5_3;
                        v34 = v8_0;
                        v35 = v9_0;
                        v36 = v10_4;
                        v37 = v11_6;
                        v38 = v12_3;
                        v13_2 = v6_3;
                    } else {
                        long v1_20 = v10_4.mArtistCache;
                        try {
                            long v1_21;
                            String v33;
                            Throwable v0_25 = ((Long) v1_20.get(v2_16));
                        } catch (Throwable v0_26) {
                            v25 = v2_16;
                            v32 = v5_3;
                            v35 = v9_0;
                            v37 = v11_6;
                            v15 = p47;
                        }
                        if (v0_25 != null) {
                            v25 = v2_16;
                            v31 = v3_6;
                            v32 = v5_3;
                            v33 = v6_3;
                            v34 = v8_0;
                            v35 = v9_0;
                            v36 = v10_4;
                            v37 = v11_6;
                            v38 = v12_3;
                            try {
                                v1_21 = v0_25.longValue();
                            } catch (Throwable v0_26) {
                            }
                        } else {
                            try {
                                v25 = v2_16;
                                String v2_17 = v10_4;
                                v31 = v3_6;
                                v32 = v5_3;
                                v33 = v6_3;
                                v34 = v8_0;
                                v35 = v9_0;
                                v36 = v10_4;
                                v37 = v11_6;
                                v38 = v12_3;
                                int v13_3 = v38;
                                try {
                                    v1_21 = v14_0.getKeyIdForName(v2_17, v8_0, "artists", "artist_key", "artist", v25, v25, 0, 0, 0, v1_20, v13_3);
                                } catch (Throwable v0_26) {
                                }
                            } catch (Throwable v0_26) {
                                v25 = v2_17;
                                v32 = "artist_key";
                                v35 = 0;
                                v37 = 0;
                                v15 = v13_3;
                            }
                        }
                        v13_2 = v33;
                        v13_2.put("artist_id", Integer.toString(((int) v1_21)));
                    }
                    String v39;
                    int v14_1;
                    String v40;
                    String v41;
                    String v12_2 = v13_2.getAsString("album");
                    v13_2.remove("album");
                    if (v12_2 == null) {
                        v14_1 = v13_2;
                        int v21 = v32;
                        v39 = v36;
                        v41 = v37;
                        v40 = v38;
                    } else {
                        android.content.ContentValues v5_5;
                        void v9_3;
                        String v16_5;
                        String v7_6 = v13_2.getAsString("_data");
                        String v8_4 = 0;
                        int v11_2 = v32;
                        if (v11_2 == 0) {
                            android.content.ContentValues v10_1 = v31;
                            if ((v10_1 == null) || (!v10_1.equals("1"))) {
                                if (v7_6 != null) {
                                    v9_3 = v37;
                                    v5_5 = v38;
                                } else {
                                    v9_3 = v37;
                                    if (v9_3 != 100) {
                                        long v1_26 = v14_0.query(v38, new String[] {"_data"}), 0, 0, 0);
                                        if (v1_26 == 0) {
                                            v5_5 = v38;
                                        } else {
                                            try {
                                                Throwable v0_36 = v1_26.getCount();
                                            } catch (Throwable v0_38) {
                                                libcore.io.IoUtils.closeQuietly(v1_26);
                                                throw v0_38;
                                            }
                                            if (v0_36 != 1) {
                                                String v3_12 = new StringBuilder();
                                                v3_12.append("");
                                                v3_12.append(v0_36);
                                                v3_12.append(" rows for ");
                                                v5_5 = v38;
                                                try {
                                                    v3_12.append(v5_5);
                                                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v3_12.toString());
                                                } catch (Throwable v0_38) {
                                                }
                                            } else {
                                                try {
                                                    v1_26.moveToFirst();
                                                    v7_6 = v1_26.getString(0);
                                                    v5_5 = v38;
                                                } catch (Throwable v0_38) {
                                                }
                                            }
                                            libcore.io.IoUtils.closeQuietly(v1_26);
                                        }
                                    } else {
                                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Possible multi row album name update without path could give wrong album key");
                                        v5_5 = v38;
                                    }
                                }
                                if (v7_6 != null) {
                                    v8_4 = v7_6.substring(0, v7_6.lastIndexOf(47)).hashCode();
                                }
                                v16_5 = v7_6;
                            } else {
                                v16_5 = v7_6;
                                v9_3 = v37;
                                v5_5 = v38;
                            }
                        } else {
                            v8_4 = v11_2.hashCode();
                            v16_5 = v7_6;
                        }
                        String v7_7 = v12_2.toString();
                        String v4_9 = v36;
                        String v3_15 = v4_9.mAlbumCache;
                        try {
                            long v1_31;
                            Throwable v0_47 = new StringBuilder();
                            v0_47.append(v7_7);
                            v0_47.append(v8_4);
                            Throwable v0_48 = v0_47.toString();
                            String v2_23 = ((Long) v3_15.get(v0_48));
                        } catch (Throwable v0_49) {
                            v39 = v4_9;
                            String v17 = v7_7;
                            v41 = v9_3;
                            v21 = v11_2;
                            int v14 = v13_2;
                            throw v0_49;
                        } catch (Throwable v0_49) {
                        }
                        if (v2_23 != null) {
                            v39 = v4_9;
                            v40 = v5_5;
                            Throwable v18 = v8_4;
                            v41 = v9_3;
                            v21 = v11_2;
                            v14_1 = v13_2;
                            v1_31 = v2_23.longValue();
                        } else {
                            v39 = v4_9;
                            v40 = v5_5;
                            v41 = v9_3;
                            v14_1 = v13_2;
                            v1_31 = v14_0.getKeyIdForName(v4_9, v34, "albums", "album_key", "album", v7_7, v0_48, v16_5, v8_4, v25, v3_15, v40);
                        }
                        v14_1.put("album_id", Integer.toString(((int) v1_31)));
                    }
                    void v9_5;
                    String v2_26;
                    v14_1.remove("title_key");
                    long v1_33 = v14_1.getAsString("title");
                    if (v1_33 == 0) {
                        v2_26 = v14_1;
                        v9_5 = this;
                    } else {
                        v2_26 = v14_1;
                        v9_5 = this;
                        try {
                            Throwable v0_56 = this.getLocalizedTitle(v1_33);
                        } catch (Throwable v0) {
                            v2_26.put("title_resource_uri", v1_33);
                            v2_26.put("title_key", android.provider.MediaStore$Audio.keyFor(v1_33));
                            v2_26.put("title", v1_33.trim());
                        }
                        if (v0_56 == null) {
                            v2_26.putNull("title_resource_uri");
                        } else {
                            v2_26.put("title_resource_uri", v1_33);
                            v1_33 = v0_56;
                        }
                    }
                    String v8_7;
                    android.content.ContentValues v10_3 = v39;
                    v10_3.mNumUpdates = (v10_3.mNumUpdates + 1);
                    String v12_5 = v35;
                    v13_1 = v34;
                    v0_64 = v13_1.update(v12_5.table, v2_26, v12_5.where, p47);
                    int v14_2 = v23;
                    if (v14_2 == 0) {
                        v8_7 = v40;
                    } else {
                        String v15_2;
                        if (v0_64 != 1) {
                            v8_7 = v40;
                            v15_2 = v41;
                        } else {
                            v15_2 = v41;
                            if (v15_2 != 101) {
                                v8_7 = v40;
                            } else {
                                v8_7 = v40;
                                v9_5.updateGenre(Long.parseLong(((String) v8_7.getPathSegments().get(3))), v14_2);
                                v42 = v8_7;
                            }
                        }
                        android.content.ContentValues v5_10 = new StringBuilder();
                        v5_10.append("ignoring genre in update: count = ");
                        v5_10.append(v0_64);
                        v5_10.append(" match = ");
                        v5_10.append(v15_2);
                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v5_10.toString());
                    }
                    break;
                case 113:
                    if (v12_3.getQueryParameter("move") == null) {
                        v13_1 = v8_0;
                        v42 = v12_3;
                        v11_0 = v17_0;
                        v12_0 = v9_0;
                        v14 = v23;
                        v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_0);
                        v0_64 = v13_1.update(v12_0.table, p45, v12_0.where, p47);
                    } else {
                        if (!p45.containsKey("play_order")) {
                            String v2_10 = new StringBuilder();
                            v2_10.append("Need to specify ");
                            v2_10.append("play_order");
                            v2_10.append(" when using \'move\' parameter");
                            throw new IllegalArgumentException(v2_10.toString());
                        } else {
                            String v16_1 = p45.getAsInteger("play_order").intValue();
                            String v4_2 = v12_3.getPathSegments();
                            v0 = "play_order";
                            return v14_0.movePlaylistEntry(v10_4, v8_0, Long.parseLong(((String) v4_2.get(v7_0))), Integer.parseInt(((String) v4_2.get(v1_0))), v16_1);
                        }
                    }
                default:
                    v13_1 = v8_0;
                    v42 = v12_3;
                    v11_0 = v17_0;
                    v12_0 = v9_0;
                    v14 = v23;
            }
            if ((v0_64 > null) && (!v13_1.inTransaction())) {
                this.getContext().getContentResolver().notifyChange(v42, 0);
            }
            return v0_64;
        }
    }

Method com.android.providers.media.MediaProvider.localizeTitles() calling method android.database.sqlite.SQLiteDatabase.update()


    private void localizeTitles()
    {
        Throwable v0_2 = this.mDatabases.values().iterator();
        while (v0_2.hasNext()) {
            android.database.sqlite.SQLiteDatabase v10 = ((com.android.providers.media.MediaProvider$DatabaseHelper) v0_2.next()).getWritableDatabase();
            android.database.Cursor v2_2 = v10.query("files", new String[] {"_id", "title_resource_uri"}), "title_resource_uri IS NOT NULL", 0, 0, 0, 0);
            Throwable v3_1 = 0;
            try {
                while (v2_2.moveToNext()) {
                    String v5_1 = v2_2.getString(0);
                    String v7_1 = v2_2.getString(1);
                    android.content.ContentValues v8_2 = new android.content.ContentValues();
                    try {
                        String v9_1 = this.getLocalizedTitle(v7_1);
                        v8_2.put("title_key", android.provider.MediaStore$Audio.keyFor(v9_1));
                        v8_2.put("title", v9_1.trim());
                        String v6_2 = new String[1];
                        v6_2[0] = v5_1;
                        v10.update("files", v8_2, "_id=?", v6_2);
                    } catch (Exception v4) {
                        String v9_3 = new StringBuilder();
                        v9_3.append("Error updating localized title for ");
                        v9_3.append(v7_1);
                        v9_3.append(", keeping old localization");
                        android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v9_3.toString());
                    }
                }
            } catch (Throwable v0_4) {
                if (v2_2 != null) {
                    com.android.providers.media.MediaProvider.$closeResource(v3_1, v2_2);
                }
                throw v0_4;
            } catch (Throwable v0_3) {
                v3_1 = v0_3;
                throw v3_1;
            }
            if (v2_2 != null) {
                com.android.providers.media.MediaProvider.$closeResource(0, v2_2);
            }
        }
        return;
    }

Method com.android.providers.media.MediaProvider.insertFile() calling method android.database.sqlite.SQLiteDatabase.update()


    private long insertFile(com.android.providers.media.MediaProvider$DatabaseHelper p36, android.net.Uri p37, android.content.ContentValues p38, int p39, boolean p40, java.util.ArrayList p41)
    {
        Long v5_2;
        com.android.providers.media.MediaProvider$DatabaseHelper v1_18;
        Long v21_0;
        int v29;
        com.android.providers.media.MediaProvider v7_2;
        int v11_3 = p36.getWritableDatabase();
        int v0_5 = 0;
        switch (p39) {
            case 1:
                v21_0 = 0;
                v29 = v11_3;
                v7_2 = this;
                v1_18 = p36;
                v5_2 = p38;
                v0_5 = this.ensureFile(p36.mInternal, p38, ".jpg", android.os.Environment.DIRECTORY_PICTURES);
                v0_5.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                android.content.ContentValues v2_6 = v0_5.getAsString("_data");
                if (!v0_5.containsKey("_display_name")) {
                    com.android.providers.media.MediaProvider.computeDisplayName(v2_6, v0_5);
                }
                com.android.providers.media.MediaProvider.computeTakenTime(v0_5);
                break;
            case 2:
                int v0_25;
                android.database.sqlite.SQLiteDatabase v9_2 = new android.content.ContentValues(p38);
                long v8_7 = v9_2.getAsString("album_artist");
                com.android.providers.media.MediaProvider v7_3 = v9_2.getAsString("compilation");
                v9_2.remove("compilation");
                java.util.ArrayList v6_5 = v9_2.get("artist");
                if (v6_5 != null) {
                    v0_25 = v6_5.toString();
                } else {
                    v0_25 = "";
                }
                Long v5_8 = v0_25;
                v9_2.remove("artist");
                int v4_5 = p36.mArtistCache;
                java.util.HashMap v3_13 = v9_2.getAsString("_data");
                try {
                    int v14_1;
                    long v18_8;
                    com.android.providers.media.MediaProvider$DatabaseHelper v1_1;
                    String v23_1;
                    String v26;
                    int v27;
                    String v25;
                    int v0_48 = ((Long) v4_5.get(v5_8));
                } catch (int v0_0) {
                    Throwable v24 = v4_5;
                    String v19 = v6_5;
                    v26 = v8_7;
                    v29 = v11_3;
                }
                if (v0_48 != 0) {
                    v23_1 = v3_13;
                    v18_8 = v5_8;
                    v25 = v7_3;
                    v26 = v8_7;
                    v27 = v9_2;
                    v14_1 = 0;
                    v29 = v11_3;
                    try {
                        v1_1 = v0_48.longValue();
                    } catch (int v0_0) {
                        com.android.providers.media.MediaProvider v7 = this;
                    }
                } else {
                    try {
                        v23_1 = v3_13;
                        v18_8 = v5_8;
                        v25 = v7_3;
                        com.android.providers.media.MediaProvider v7_4 = v18_8;
                        v26 = v8_7;
                        v27 = v9_2;
                        android.database.sqlite.SQLiteDatabase v9_3 = v23_1;
                        v14_1 = 0;
                        v29 = v11_3;
                        try {
                            v1_1 = this.getKeyIdForName(p36, v11_3, "artists", "artist_key", "artist", v7_4, v18_8, v9_3, 0, 0, v4_5, p37);
                        } catch (int v0_0) {
                            v7 = this;
                        }
                    } catch (int v0_0) {
                        long v18 = "artist_key";
                        v29 = 0;
                        v25 = v7_4;
                        Throwable v15 = v9_3;
                    }
                }
                int v0_2;
                Long v12_1 = v1_1;
                int v11_1 = v18_8;
                Throwable v10_1 = v27;
                android.database.sqlite.SQLiteDatabase v9_0 = v10_1.get("album");
                if (v9_0 != null) {
                    v0_2 = v9_0.toString();
                } else {
                    v0_2 = "";
                }
                int v4_0;
                long v8_0 = v0_2;
                v10_1.remove("album");
                com.android.providers.media.MediaProvider v7_0 = p36.mAlbumCache;
                int v0_4 = 0;
                java.util.ArrayList v6_0 = v26;
                if (v6_0 == null) {
                    Long v5_0 = v25;
                    try {
                        if ((v5_0 == null) || (!v5_0.equals("1"))) {
                            v4_0 = v23_1;
                            try {
                                v0_4 = v4_0.substring(v14_1, v4_0.lastIndexOf(47)).hashCode();
                            } catch (int v0_6) {
                                v25 = v5_0;
                                com.android.providers.media.MediaProvider v20 = v7_0;
                                android.database.sqlite.SQLiteDatabase v28 = v9_0;
                                java.util.HashMap v3 = v12_1;
                            }
                            java.util.HashMap v30;
                            Throwable v15_1;
                            com.android.providers.media.MediaProvider$DatabaseHelper v1_16;
                            com.android.providers.media.MediaProvider$DatabaseHelper v1_12 = new StringBuilder();
                            v1_12.append(v8_0);
                            v1_12.append(v0_4);
                            java.util.HashMap v3_1 = v1_12.toString();
                            android.content.ContentValues v2_1 = ((Long) v7_0.get(v3_1));
                            if (v2_1 != null) {
                                String v23 = v4_0;
                                v26 = v6_0;
                                v27 = v8_0;
                                v15_1 = v10_1;
                                v30 = v12_1;
                                v21_0 = v14_1;
                                try {
                                    v1_16 = v2_1.longValue();
                                } catch (int v0_6) {
                                    v7 = this;
                                }
                            } else {
                                try {
                                    v21_0 = v14_1;
                                    com.android.providers.media.MediaProvider v7_1 = v8_0;
                                    android.database.sqlite.SQLiteDatabase v9_1 = v4_0;
                                    v15_1 = v10_1;
                                    v30 = v12_1;
                                    Long v12_2 = v7_0;
                                    try {
                                        v1_16 = this.getKeyIdForName(p36, v29, "albums", "album_key", "album", v7_1, v3_1, v9_1, v0_4, v11_1, v12_2, p37);
                                    } catch (int v0_6) {
                                    }
                                } catch (int v0_6) {
                                    v25 = "album_key";
                                    v20 = v7_1;
                                    v28 = v9_1;
                                    v3 = v12_2;
                                }
                            }
                            int v0_10;
                            v15_1.put("artist_id", Integer.toString(((int) v30)));
                            v15_1.put("album_id", Integer.toString(((int) v1_16)));
                            Long v5_7 = v15_1.getAsString("title");
                            if (v5_7 != null) {
                                v0_10 = v5_7.toString();
                            } else {
                                v0_10 = "";
                            }
                            java.util.ArrayList v6_2 = v0_10;
                            v7_2 = this;
                            try {
                                int v0_11 = this.getLocalizedTitle(v6_2);
                            } catch (int v0) {
                                v15_1.put("title_resource_uri", v6_2);
                                v15_1.put("title_key", android.provider.MediaStore$Audio.keyFor(v6_2));
                                v15_1.put("title", v6_2.trim());
                                com.android.providers.media.MediaProvider.computeDisplayName(v15_1.getAsString("_data"), v15_1);
                                v0_5 = v15_1;
                                v1_18 = p36;
                                v5_2 = p38;
                            }
                            if (v0_11 == 0) {
                                v15_1.putNull("title_resource_uri");
                            } else {
                                v15_1.put("title_resource_uri", v6_2);
                                v6_2 = v0_11;
                            }
                        } else {
                            v4_0 = v23_1;
                        }
                    } catch (int v0_6) {
                        v20 = v7_0;
                        v28 = v9_0;
                        v3 = v12_1;
                    }
                    while(true) {
                        throw v0_6;
                    }
                } else {
                    try {
                        v0_4 = v6_0.hashCode();
                        v4_0 = v23_1;
                    } catch (int v0_6) {
                    }
                }
                try {
                } catch (int v0_6) {
                }
                break;
            case 3:
                v0_5 = this.ensureFile(p36.mInternal, p38, ".3gp", "video");
                com.android.providers.media.MediaProvider.computeDisplayName(v0_5.getAsString("_data"), v0_5);
                com.android.providers.media.MediaProvider.computeTakenTime(v0_5);
                v21_0 = 0;
                v29 = v11_3;
                v5_2 = p38;
                v7_2 = this;
                v1_18 = p36;
                break;
            default:
                v21_0 = 0;
                v29 = v11_3;
                v5_2 = p38;
                v7_2 = this;
                v1_18 = p36;
        }
        if (v0_5 == 0) {
            v0_5 = new android.content.ContentValues(v5_2);
        }
        android.content.ContentValues v2_10 = v0_5.getAsString("_data");
        if (v2_10 != null) {
            com.android.providers.media.MediaProvider.computeBucketValues(v2_10, v0_5);
        }
        v0_5.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
        java.util.HashMap v3_11 = 0;
        java.util.ArrayList v6_4 = v0_5.getAsInteger("media_scanner_new_object_id");
        if (v6_4 != null) {
            v3_11 = ((long) v6_4.intValue());
            v0_5 = new android.content.ContentValues(v0_5);
            v0_5.remove("media_scanner_new_object_id");
        }
        long v8_14 = v3_11;
        java.util.HashMap v3_12 = v0_5;
        int v0_20 = v3_12.getAsString("title");
        if ((v0_20 == 0) && (v2_10 != null)) {
            v0_20 = android.media.MediaFile.getFileTitle(v2_10);
        }
        int v11_2;
        v3_12.put("title", v0_20);
        int v0_24 = v3_12.getAsString("mime_type");
        Throwable v10_4 = v3_12.getAsInteger("format");
        if (v10_4 != null) {
            v11_2 = v10_4.intValue();
        } else {
            v11_2 = v21_0;
        }
        Throwable v15_2;
        if (v11_2 != 0) {
            v15_2 = v29;
        } else {
            if (!android.text.TextUtils.isEmpty(v2_10)) {
                v15_2 = v29;
                v11_2 = android.media.MediaFile.getFormatCode(v2_10, v0_24);
            } else {
                if (p39 != 4) {
                    v15_2 = v29;
                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, "path is empty in insertFile()");
                } else {
                    v3_12.put("format", Integer.valueOf(47621));
                    int v14_6 = new StringBuilder();
                    v14_6.append(v7_2.mExternalStoragePaths[v21_0]);
                    v14_6.append("/Playlists/");
                    v14_6.append(v3_12.getAsString("name"));
                    v2_10 = v14_6.toString();
                    v3_12.put("_data", v2_10);
                    v15_2 = v29;
                    v3_12.put("parent", Long.valueOf(v7_2.getParent(v1_18, v15_2, v2_10)));
                }
            }
        }
        if ((v2_10 == null) || (!v2_10.endsWith("/"))) {
            if (v11_2 != 0) {
                v3_12.put("format", Integer.valueOf(v11_2));
                if (v0_24 == 0) {
                    v0_24 = android.media.MediaFile.getMimeTypeForFormatCode(v11_2);
                }
            }
            if ((v0_24 == 0) && ((v2_10 != null) && (v11_2 != 12289))) {
                v0_24 = android.media.MediaFile.getMimeTypeForFile(v2_10);
            }
            int v14_11;
            String v13_7 = v0_24;
            if (v13_7 == null) {
                v14_11 = p39;
            } else {
                v3_12.put("mime_type", v13_7);
                if (v3_12.containsKey("media_type")) {
                } else {
                    v14_11 = p39;
                    if ((p39 == 0) && (!android.media.MediaScanner.isNoMediaPath(v2_10))) {
                        int v0_31 = android.media.MediaFile.getFileTypeForMimeType(v13_7);
                        if (!android.media.MediaFile.isAudioFileType(v0_31)) {
                            if (!android.media.MediaFile.isVideoFileType(v0_31)) {
                                if (!android.media.MediaFile.isImageFileType(v0_31)) {
                                    if (android.media.MediaFile.isPlayListFileType(v0_31)) {
                                        v14_11 = 4;
                                    }
                                } else {
                                    v14_11 = 1;
                                }
                            } else {
                                v14_11 = 3;
                            }
                        } else {
                            v14_11 = 2;
                        }
                    }
                }
            }
            v3_12.put("media_type", Integer.valueOf(v14_11));
            if (v8_14 != 0) {
                Exception v34 = v6_4;
                v1_18.mNumUpdates = (v1_18.mNumUpdates + 1);
                Long v5_10 = new String[1];
                v5_10[v21_0] = Long.toString(v8_14);
                v15_2.update("files", v3_12, "_id=?", v5_10);
            } else {
                if (v14_11 != 4) {
                    if (v2_10 == null) {
                        v34 = v6_4;
                        throw new IllegalArgumentException("no path was provided when inserting new file");
                    }
                } else {
                    if ((v3_12.getAsString("name") == null) && (v2_10 == null)) {
                        throw new IllegalArgumentException("no name was provided when inserting abstract playlist");
                    }
                }
                if (v2_10 == null) {
                    v34 = v6_4;
                } else {
                    int v0_46 = new java.io.File(v2_10);
                    if (!v0_46.exists()) {
                    } else {
                        v3_12.put("date_modified", Long.valueOf((v0_46.lastModified() / 1000)));
                        if (!v3_12.containsKey("_size")) {
                            v3_12.put("_size", Long.valueOf(v0_46.length()));
                        }
                        if ((v14_11 == 1) || (v14_11 == 3)) {
                            com.android.providers.media.MediaProvider.computeTakenTime(v3_12);
                        }
                    }
                }
                if ((v3_12.getAsLong("parent") == null) && (v2_10 != null)) {
                    v3_12.put("parent", Long.valueOf(v7_2.getParent(v1_18, v15_2, v2_10)));
                }
                v1_18.mNumInserts = (v1_18.mNumInserts + 1);
                v8_14 = v15_2.insert("files", "date_modified", v3_12);
                if ((v8_14 != -1) && (p40)) {
                    p41.add(Long.valueOf(v8_14));
                }
            }
            if (v11_2 == 12289) {
                try {
                    v7_2.mDirectoryCache.put(v2_10, Long.valueOf(v8_14));
                } catch (int v0_53) {
                    throw v0_53;
                }
            }
            return v8_14;
        } else {
            Long v12_18 = new StringBuilder();
            v12_18.append("directory has trailing slash: ");
            v12_18.append(v2_10);
            android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v12_18.toString());
            return 0;
        }
    }

Method com.android.providers.media.MediaProvider.hidePath() calling method android.database.sqlite.SQLiteDatabase.update()


    private void hidePath(com.android.providers.media.MediaProvider$DatabaseHelper p19, android.database.sqlite.SQLiteDatabase p20, String p21)
    {
        android.database.Cursor v1_1;
        int v10_4 = 1;
        android.media.MediaScanner.clearMediaPathCache(1, 0);
        java.io.File v13 = new java.io.File(p21);
        if (!v13.isDirectory()) {
            v1_1 = v13.getParent();
        } else {
            v1_1 = p21;
        }
        String v14 = v1_1;
        android.net.Uri v5_1 = new String[2];
        android.database.Cursor v1_4 = new StringBuilder();
        v1_4.append(v14);
        v1_4.append("/");
        v5_1[0] = v1_4.toString();
        android.database.Cursor v1_7 = new StringBuilder();
        v1_7.append(v14);
        v1_7.append("0");
        v5_1[1] = v1_7.toString();
        android.database.Cursor v1_10 = p20.query("files", new String[] {"_id", "media_type"}), "_data >= ? AND _data < ? AND (media_type=1 OR media_type=3) AND mini_thumb_magic IS NOT NULL", v5_1, 0, 0, 0);
        if (v1_10 != null) {
            if (v1_10.getCount() != 0) {
                android.content.ContentValues v2_3 = android.net.Uri.parse("content://media/external/images/media");
                int v3_3 = android.net.Uri.parse("content://media/external/videos/media");
                while (v1_10.moveToNext()) {
                    int v8_2;
                    long v4_0 = v1_10.getLong(0);
                    long v6_1 = v1_10.getLong(v10_4);
                    int v10_1 = new StringBuilder();
                    v10_1.append("hiding image ");
                    v10_1.append(v4_0);
                    v10_1.append(", removing thumbnail");
                    android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v10_1.toString());
                    if (v6_1 != 1) {
                        v8_2 = v3_3;
                    } else {
                        v8_2 = v2_3;
                    }
                    this.removeThumbnailFor(v8_2, p20, v4_0);
                    v10_4 = 1;
                }
            }
            libcore.io.IoUtils.closeQuietly(v1_10);
        }
        android.content.ContentValues v2_5 = new android.content.ContentValues();
        v2_5.put("media_type", Integer.valueOf(0));
        android.net.Uri v5_3 = new String[2];
        long v6_6 = new StringBuilder();
        v6_6.append(v14);
        v6_6.append("/");
        v5_3[0] = v6_6.toString();
        long v6_9 = new StringBuilder();
        v6_9.append(v14);
        v6_9.append("0");
        v5_3[1] = v6_9.toString();
        p19.mNumUpdates = (p19.mNumUpdates + p20.update("files", v2_5, "_data >= ? AND _data < ?", v5_3));
        this.getContext().getContentResolver().notifyChange(android.net.Uri.parse("content://media/"), 0);
        return;
    }

Method com.android.providers.media.MediaProvider.getKeyIdForName() calling method android.database.sqlite.SQLiteDatabase.update()


    private long getKeyIdForName(com.android.providers.media.MediaProvider$DatabaseHelper p31, android.database.sqlite.SQLiteDatabase p32, String p33, String p34, String p35, String p36, String p37, String p38, int p39, String p40, java.util.HashMap p41, android.net.Uri p42)
    {
        if ((p36 != null) && (p36.length() != 0)) {
            void v1_0 = p36;
        } else {
            v1_0 = "<unknown>";
        }
        Throwable v0_7 = android.provider.MediaStore$Audio.keyFor(v1_0);
        if (v0_7 != null) {
            boolean v18 = p33.equals("albums");
            boolean v19 = "<unknown>".equals(v1_0);
            if (v18) {
                android.database.Cursor v8_3 = new StringBuilder();
                v8_3.append(v0_7);
                v8_3.append(p39);
                v0_7 = v8_3.toString();
                if (v19) {
                    android.database.Cursor v8_6 = new StringBuilder();
                    v8_6.append(v0_7);
                    v8_6.append(p40);
                    v0_7 = v8_6.toString();
                }
            }
            android.content.ContentResolver v13_12 = v0_7;
            java.util.HashMap v12_1 = new String[1];
            v12_1[0] = v13_12;
            p31.mNumQueries = (p31.mNumQueries + 1);
            android.database.Cursor v8_10 = new StringBuilder();
            v8_10.append(p34);
            v8_10.append("=?");
            String v24 = v13_12;
            android.database.Cursor v8_12 = p32.query(p33, 0, v8_10.toString(), v12_1, 0, 0, 0);
            try {
                android.content.ContentResolver v13_11;
                java.util.HashMap v12_0;
                switch (v8_12.getCount()) {
                    case 0:
                        Throwable v0_11 = new android.content.ContentValues();
                        String v7_1;
                        v0_11.put(p34, v24);
                        v0_11.put(p35, v1_0);
                        p31.mNumInserts = (p31.mNumInserts + 1);
                        v13_11 = p32.insert(p33, "duration", v0_11);
                        if ((p38 == null) || ((!v18) || (v19))) {
                            v7_1 = p33;
                            v12_0 = p41;
                        } else {
                            v12_0 = p41;
                            v7_1 = p33;
                            this.makeThumbAsync(p31, p32, p38, v13_11);
                        }
                        if (v13_11 > 0) {
                            void v1_5 = p42.toString().substring(16, 24);
                            android.net.Uri v2_11 = new StringBuilder();
                            v2_11.append("content://media/");
                            v2_11.append(v1_5);
                            v2_11.append("/audio/");
                            v2_11.append(v7_1);
                            v2_11.append("/");
                            v2_11.append(v13_11);
                            this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_11.toString()), 0);
                        }
                        break;
                    case 1:
                        try {
                            v8_12.moveToFirst();
                            long v14_2 = v8_12.getLong(0);
                            Throwable v0_17 = v8_12.getString(2);
                            try {
                                String v10_5 = this.makeBestName(v1_0, v0_17);
                            } catch (Throwable v0_9) {
                                long v15 = v1_0;
                                java.util.HashMap v28 = v12_1;
                                java.util.HashMap v12 = p41;
                                libcore.io.IoUtils.closeQuietly(v8_12);
                                throw v0_9;
                            }
                            if (!v10_5.equals(v0_17)) {
                                android.content.ContentValues v11_1 = new android.content.ContentValues();
                                v11_1.put(p35, v10_5);
                                p31.mNumUpdates = (p31.mNumUpdates + 1);
                                android.content.ContentResolver v13_3 = new StringBuilder();
                                v13_3.append("rowid=");
                                v13_3.append(Integer.toString(((int) v14_2)));
                                p32.update(p33, v11_1, v13_3.toString(), 0);
                                try {
                                    Throwable v0_6 = p42.toString().substring(16, 24);
                                    android.net.Uri v2_2 = new StringBuilder();
                                    v2_2.append("content://media/");
                                    v2_2.append(v0_6);
                                    v2_2.append("/audio/");
                                    v2_2.append(p33);
                                    v2_2.append("/");
                                    v2_2.append(v14_2);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_2.toString()), 0);
                                } catch (Throwable v0_9) {
                                    v15 = v1_0;
                                    v28 = v12_1;
                                    v12 = p41;
                                }
                            }
                            v28 = v12_1;
                            v13_11 = v14_2;
                            v12_0 = p41;
                        } catch (Throwable v0_9) {
                        }
                        break;
                    default:
                        v15 = v1_0;
                        String v10_1 = v24;
                        v12_0 = p41;
                        void v1_7 = new StringBuilder();
                        v1_7.append("Multiple entries in table ");
                        v1_7.append(p33);
                        v1_7.append(" for key ");
                        v1_7.append(v10_1);
                        android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v1_7.toString());
                        v13_11 = -1;
                }
            } catch (Throwable v0_9) {
                android.content.ContentResolver v3 = p37;
                String v7 = p33;
                String v10 = v24;
            } catch (Throwable v0_9) {
            }
            Throwable v0_13 = v13_11;
            libcore.io.IoUtils.closeQuietly(v8_12);
            if ((v12_0 != null) && (!v19)) {
                v12_0.put(p37, Long.valueOf(v0_13));
            }
            return v0_13;
        } else {
            android.util.Log.e(com.android.providers.media.MediaProvider.TAG, "null key", new Exception());
            return -1;
        }
    }

Method com.android.providers.media.MediaProvider.fixParentIdIfNeeded() calling method android.database.sqlite.SQLiteDatabase.update()


    private void fixParentIdIfNeeded()
    {
        com.android.providers.media.MediaProvider$DatabaseHelper v2 = this.getDatabaseForUri(android.net.Uri.parse("content://media/external/file"));
        if (v2 != null) {
            android.database.sqlite.SQLiteDatabase v12 = v2.getWritableDatabase();
            int v11_0 = 0;
            long v14 = -1;
            int v10_0 = 0;
            String v0_9 = 1;
            while(true) {
                android.net.Uri v3_9;
                int v16 = v0_9;
                String v0_11 = new StringBuilder();
                v0_11.append("parent != 0 AND parent NOT IN (SELECT _id FROM files)");
                if (v14 >= 0) {
                    android.net.Uri v3_8 = new StringBuilder();
                    v3_8.append(" AND _id > ");
                    v3_8.append(v14);
                    v3_9 = v3_8.toString();
                } else {
                    v3_9 = "";
                }
                v0_11.append(v3_9);
                int v18 = v10_0;
                int v13_4 = v11_0;
                android.net.Uri v3_11 = v12.query("files", com.android.providers.media.MediaProvider.sDataId, v0_11.toString(), 0, 0, 0, "_id ASC", "500");
                if (v3_11 != null) {
                    try {
                        if (v3_11.getCount() == 0) {
                            break;
                        }
                        v11_0 = (v13_4 + v3_11.getCount());
                        if (v16 != 0) {
                            try {
                            } catch (String v0_5) {
                                libcore.io.IoUtils.closeQuietly(v3_11);
                                throw v0_5;
                            }
                            this.mDirectoryCache.clear();
                            v16 = 0;
                        }
                        v10_0 = v18;
                        try {
                            while (v3_11.moveToNext()) {
                                String v4_9 = v3_11.getString(0);
                                v14 = v3_11.getLong(1);
                                if (!new java.io.File(v4_9).exists()) {
                                    String v5_10 = new StringBuilder();
                                    v5_10.append("_id=");
                                    v5_10.append(v14);
                                    v12.delete("files", v5_10.toString(), 0);
                                } else {
                                    int v7_4 = this.getParent(v2, v12, v4_9);
                                    android.content.ContentValues v9_2 = new android.content.ContentValues();
                                    v9_2.put("parent", Long.valueOf(v7_4));
                                    int v13_2 = new StringBuilder();
                                    v13_2.append("_id=");
                                    v13_2.append(v14);
                                    String v0_4 = v12.update("files", v9_2, v13_2.toString(), 0);
                                    v2.mNumUpdates = (v2.mNumUpdates + v0_4);
                                    v10_0 += v0_4;
                                }
                            }
                        } catch (String v0_5) {
                        }
                        libcore.io.IoUtils.closeQuietly(v3_11);
                        v0_9 = v16;
                    } catch (String v0_5) {
                    }
                }
                String v5_5;
                libcore.io.IoUtils.closeQuietly(v3_11);
                if (v13_4 <= 0) {
                    v5_5 = v18;
                } else {
                    android.net.Uri v3_1 = new StringBuilder();
                    v3_1.append("fixParentIdIfNeeded: found: ");
                    v3_1.append(v13_4);
                    v3_1.append(", fixed: ");
                    v5_5 = v18;
                    v3_1.append(v5_5);
                    android.util.Log.d(com.android.providers.media.MediaProvider.TAG, v3_1.toString());
                }
                if (v5_5 > null) {
                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse("content://media/"), 0);
                }
                return;
            }
        } else {
            return;
        }
    }

Method com.android.providers.media.MediaProvider.removeThumbnailFor() calling method android.database.sqlite.SQLiteDatabase.rawQuery()


    private void removeThumbnailFor(android.net.Uri p4, android.database.sqlite.SQLiteDatabase p5, long p6)
    {
        android.database.Cursor v0_1 = new StringBuilder();
        v0_1.append("select _data from thumbnails where image_id=");
        v0_1.append(p6);
        v0_1.append(" union all select _data from videothumbnails where video_id=");
        v0_1.append(p6);
        android.database.Cursor v0_2 = p5.rawQuery(v0_1.toString(), 0);
        if (v0_2 != null) {
            while (v0_2.moveToNext()) {
                this.deleteIfAllowed(p4, v0_2.getString(0));
            }
            libcore.io.IoUtils.closeQuietly(v0_2);
            String v1_3 = new StringBuilder();
            v1_3.append("delete from thumbnails where image_id=");
            v1_3.append(p6);
            p5.execSQL(v1_3.toString());
            String v1_7 = new StringBuilder();
            v1_7.append("delete from videothumbnails where video_id=");
            v1_7.append(p6);
            p5.execSQL(v1_7.toString());
        }
        String v1_9 = android.media.MiniThumbFile.instance(p4);
        v1_9.eraseMiniThumb(p6);
        v1_9.deactivate();
        return;
    }

Method com.android.providers.media.MediaProvider.getObjectReferences() calling method android.database.sqlite.SQLiteDatabase.rawQuery()


    private android.database.Cursor getObjectReferences(com.android.providers.media.MediaProvider$DatabaseHelper p12, android.database.sqlite.SQLiteDatabase p13, int p14)
    {
        p12.mNumQueries = (p12.mNumQueries + 1);
        String v6_2 = new String[1];
        v6_2[0] = Integer.toString(p14);
        android.database.Cursor v0_1 = p13.query("files", com.android.providers.media.MediaProvider.sMediaTableColumns, "_id=?", v6_2, 0, 0, 0);
        try {
            if ((v0_1 == null) || (!v0_1.moveToNext())) {
                libcore.io.IoUtils.closeQuietly(v0_1);
                return 0;
            } else {
                long v3_1 = v0_1.getLong(0);
                if (v0_1.getInt(1) == 4) {
                    p12.mNumQueries = (p12.mNumQueries + 1);
                    android.database.Cursor v1_1 = new String[1];
                    v1_1[0] = Long.toString(v3_1);
                    android.database.Cursor v1_2 = p13.rawQuery("SELECT audio_id FROM audio_playlists_map WHERE playlist_id=? ORDER BY play_order", v1_1);
                    libcore.io.IoUtils.closeQuietly(v0_1);
                    return v1_2;
                } else {
                    libcore.io.IoUtils.closeQuietly(v0_1);
                    return 0;
                }
            }
        } catch (android.database.Cursor v1_3) {
            libcore.io.IoUtils.closeQuietly(v0_1);
            throw v1_3;
        }
    }

Method com.android.providers.media.MediaProvider.getAlbumArtOutputUri() calling method android.database.sqlite.SQLiteDatabase.insert()


    android.net.Uri getAlbumArtOutputUri(com.android.providers.media.MediaProvider$DatabaseHelper p10, android.database.sqlite.SQLiteDatabase p11, long p12, android.net.Uri p14)
    {
        android.net.Uri v0 = 0;
        if (p14 != 0) {
            android.content.ContentValues v2_0 = this.query(p14, new String[] {"_data"}), 0, 0, 0);
            try {
                if ((v2_0 == null) || (!v2_0.moveToFirst())) {
                    p14 = 0;
                } else {
                    if (this.ensureFileExists(p14, v2_0.getString(0))) {
                        v0 = p14;
                    }
                }
            } catch (IllegalStateException v1_1) {
                libcore.io.IoUtils.closeQuietly(v2_0);
                throw v1_1;
            }
            libcore.io.IoUtils.closeQuietly(v2_0);
        }
        if (p14 == 0) {
            android.content.ContentValues v2_3 = new android.content.ContentValues();
            v2_3.put("album_id", Long.valueOf(p12));
            try {
                IllegalStateException v1_2 = this.ensureFile(0, v2_3, "", "Android/data/com.android.providers.media/albumthumbs");
                p10.mNumInserts = (p10.mNumInserts + 1);
                String v3_7 = p11.insert("album_art", "_data", v1_2);
            } catch (IllegalStateException v1) {
                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, "error creating album thumb file");
            }
            if (v3_7 > 0) {
                v0 = android.content.ContentUris.withAppendedId(com.android.providers.media.MediaProvider.ALBUMART_URI, v3_7);
                this.ensureFileExists(v0, v1_2.getAsString("_data"));
            }
        }
        return v0;
    }

Method com.android.providers.media.MediaProvider.insertInternal() calling method android.database.sqlite.SQLiteDatabase.insert()


    private android.net.Uri insertInternal(android.net.Uri p26, int p27, android.content.ContentValues p28, java.util.ArrayList p29)
    {
        void v8 = this;
        String v12 = com.android.providers.media.MediaProvider.getVolumeName(p26);
        if (p27 != 500) {
            int v0_4 = 0;
            long v1_7 = 0;
            if (p28 != null) {
                v0_4 = p28.getAsString("genre");
                p28.remove("genre");
                v1_7 = p28.getAsString("_data");
            }
            String v13 = v0_4;
            String v14 = v1_7;
            java.util.ArrayList v7_2 = this.getDatabaseForUri(p26);
            if ((v7_2 == null) && ((p27 != 300) && (p27 != 705))) {
                long v1_22 = new StringBuilder();
                v1_22.append("Unknown URI: ");
                v1_22.append(p26);
                throw new UnsupportedOperationException(v1_22.toString());
            } else {
                if ((p27 != 300) && (p27 != 705)) {
                    int v0_44 = v7_2.getWritableDatabase();
                } else {
                    v0_44 = 0;
                }
                java.util.ArrayList v19;
                android.net.Uri v23;
                int v0_1;
                android.net.Uri v15_0;
                int v10_0;
                android.net.Uri v15_1;
                android.net.Uri v15_2;
                int v18_1;
                int v6_1 = v0_44;
                switch (p27) {
                    case 1:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_45 = this.insertFile(v15_0, p26, p28, 1, 1, p29);
                        if (v0_45 <= 0) {
                            v0_1 = v23;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 1, v0_45);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Media.getContentUri(v12), v0_45);
                        }
                        break;
                    case 3:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_43 = this.ensureFile(v15_0.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v15_0.mNumInserts = (v15_0.mNumInserts + 1);
                        long v1_37 = v10_0.insert("thumbnails", "name", v0_43);
                        if (v1_37 <= 0) {
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Thumbnails.getContentUri(v12), v1_37);
                        }
                        break;
                    case 100:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        long v1_32 = this.insertFile(v7_2, p26, p28, 2, 1, p29);
                        if (v1_32 <= 0) {
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 2, v1_32);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Media.getContentUri(v12), v1_32);
                            if (v13 == null) {
                            } else {
                                v8 = this.updateGenre(v1_32, v13);
                            }
                        }
                        break;
                    case 102:
                        v10_0 = v6_1;
                        int v0_39 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_30 = new android.content.ContentValues(p28);
                        v1_30.put("audio_id", v0_39);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_42 = v10_0.insert("audio_genres_map", "genre_id", v1_30);
                        if (v2_42 <= 0) {
                            v23 = 0;
                            v15_0 = v7_2;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_42);
                            v0_1 = v15_2;
                            v15_0 = v7_2;
                        }
                        break;
                    case 104:
                        v10_0 = v6_1;
                        int v0_35 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_26 = new android.content.ContentValues(p28);
                        v1_26.put("audio_id", v0_35);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_37 = v10_0.insert("audio_playlists_map", "playlist_id", v1_26);
                        if (v2_37 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_37);
                        }
                        break;
                    case 106:
                        v10_0 = v6_1;
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        int v0_31 = v10_0.insert("audio_genres", "audio_id", p28);
                        if (v0_31 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Genres.getContentUri(v12), v0_31);
                        }
                        break;
                    case 108:
                        int v22_1 = v6_1;
                        int v0_27 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_20 = new android.content.ContentValues(p28);
                        v1_20.put("genre_id", v0_27);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        v10_0 = v22_1;
                        String v2_29 = v10_0.insert("audio_genres_map", "genre_id", v1_20);
                        if (v2_29 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_29);
                        }
                        break;
                    case 110:
                        int v0_21 = new android.content.ContentValues(p28);
                        v0_21.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                        int v22_0 = v6_1;
                        int v10_5 = v7_2;
                        long v1_18 = this.insertFile(v7_2, p26, v0_21, 4, 1, p29);
                        if (v1_18 <= 0) {
                            v23 = 0;
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Playlists.getContentUri(v12), v1_18);
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        }
                        break;
                    case 111:
                    case 112:
                        int v0_18 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_14 = new android.content.ContentValues(p28);
                        v1_14.put("playlist_id", v0_18);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_20 = v6_1.insert("audio_playlists_map", "playlist_id", v1_14);
                        if (v2_20 <= 0) {
                            v10_0 = v6_1;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_20);
                            v10_0 = v6_1;
                        }
                        break;
                    case 119:
                        int v20_1 = v6_1;
                        if (v7_2.mInternal) {
                            throw new UnsupportedOperationException("no internal album art allowed");
                        } else {
                            try {
                                int v0_13 = this.ensureFile(0, p28, "", "Android/data/com.android.providers.media/albumthumbs");
                            } catch (int v0) {
                                v0_13 = p28;
                            }
                            v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                            v6_1 = v20_1;
                            long v1_12 = v6_1.insert("album_art", "_data", v0_13);
                            if (v1_12 <= 0) {
                            } else {
                                v15_2 = android.content.ContentUris.withAppendedId(p26, v1_12);
                            }
                        }
                        break;
                    case 200:
                        int v20_0 = v6_1;
                        java.util.ArrayList v21 = v7_2;
                        int v0_8 = this.insertFile(v7_2, p26, p28, 3, 1, p29);
                        if (v0_8 <= 0) {
                            v23 = 0;
                            v10_0 = v20_0;
                            v15_0 = v21;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 3, v0_8);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Media.getContentUri(v12), v0_8);
                            v10_0 = v20_0;
                            v15_0 = v21;
                        }
                        break;
                    case 202:
                        v19 = v7_2;
                        int v0_6 = this.ensureFile(v7_2.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        long v1_5 = v6_1.insert("videothumbnails", "name", v0_6);
                        if (v1_5 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Thumbnails.getContentUri(v12), v1_5);
                        }
                        break;
                    case 300:
                        v19 = v7_2;
                        int v0_3 = p28.getAsString("name");
                        long v1_0 = this.attachVolume(v0_3);
                        if ((this.mMediaScannerVolume != null) && (this.mMediaScannerVolume.equals(v0_3))) {
                            String v2_5 = this.getDatabaseForUri(v1_0);
                            if (v2_5 != null) {
                                v2_5.mScanStartTime = android.os.SystemClock.currentTimeMicro();
                            } else {
                                String v4_1 = new StringBuilder();
                                v4_1.append("no database for attached volume ");
                                v4_1.append(v1_0);
                                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v4_1.toString());
                            }
                        }
                        return v1_0;
                    case 700:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_0 = this.insertFile(v19, p26, p28, 0, 1, p29);
                        if (v0_0 <= 0) {
                            v23 = 0;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getContentUri(v12, v0_0);
                            v0_1 = v15_1;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        }
                        break;
                    case 702:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_63 = this.insertFile(v7_2, p26, p28, 0, 0, p29);
                        if (v0_63 <= 0) {
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getMtpObjectsUri(v12, v0_63);
                        }
                        break;
                    case 705:
                        if (this.mMtpService == null) {
                            int v0_60 = this.getContext();
                            v0_60.bindService(new android.content.Intent(v0_60, com.android.providers.media.MtpService), this.mMtpServiceConnection, 1);
                        }
                        this.fixParentIdIfNeeded();
                        break;
                    case 706:
                        int v0_57 = this.insertDirectory(v7_2, v7_2.getWritableDatabase(), p28.getAsString("_data"));
                        if (v0_57 <= 0) {
                        } else {
                            v15_2 = android.provider.MediaStore$Files.getContentUri(v12, v0_57);
                        }
                        break;
                    default:
                        v23 = 0;
                        long v1_43 = new StringBuilder();
                        v1_43.append("Invalid URI ");
                        v1_43.append(p26);
                        throw new UnsupportedOperationException(v1_43.toString());
                }
                if ((v14 != null) && (v14.toLowerCase(java.util.Locale.US).endsWith("/.nomedia"))) {
                    v8.processNewNoMediaPath(v15_0, v10_0, v14);
                }
                return v0_1;
            }
        } else {
            this.mMediaScannerVolume = p28.getAsString("volume");
            int v0_52 = new StringBuilder();
            v0_52.append("content://media/");
            v0_52.append(this.mMediaScannerVolume);
            v0_52.append("/audio");
            int v0_55 = this.getDatabaseForUri(android.net.Uri.parse(v0_52.toString()));
            if (v0_55 != 0) {
                v0_55.mScanStartTime = android.os.SystemClock.currentTimeMicro();
            } else {
                String v2_55 = new StringBuilder();
                v2_55.append("no database for scanned volume ");
                v2_55.append(this.mMediaScannerVolume);
                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v2_55.toString());
            }
            return android.provider.MediaStore.getMediaScannerUri();
        }
    }

Method com.android.providers.media.MediaProvider.insertInternal() calling method android.database.sqlite.SQLiteDatabase.insert()


    private android.net.Uri insertInternal(android.net.Uri p26, int p27, android.content.ContentValues p28, java.util.ArrayList p29)
    {
        void v8 = this;
        String v12 = com.android.providers.media.MediaProvider.getVolumeName(p26);
        if (p27 != 500) {
            int v0_4 = 0;
            long v1_7 = 0;
            if (p28 != null) {
                v0_4 = p28.getAsString("genre");
                p28.remove("genre");
                v1_7 = p28.getAsString("_data");
            }
            String v13 = v0_4;
            String v14 = v1_7;
            java.util.ArrayList v7_2 = this.getDatabaseForUri(p26);
            if ((v7_2 == null) && ((p27 != 300) && (p27 != 705))) {
                long v1_22 = new StringBuilder();
                v1_22.append("Unknown URI: ");
                v1_22.append(p26);
                throw new UnsupportedOperationException(v1_22.toString());
            } else {
                if ((p27 != 300) && (p27 != 705)) {
                    int v0_44 = v7_2.getWritableDatabase();
                } else {
                    v0_44 = 0;
                }
                int v10_0;
                android.net.Uri v15_1;
                int v0_1;
                android.net.Uri v15_0;
                android.net.Uri v15_2;
                int v18_1;
                java.util.ArrayList v19;
                android.net.Uri v23;
                int v6_1 = v0_44;
                switch (p27) {
                    case 1:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_45 = this.insertFile(v15_0, p26, p28, 1, 1, p29);
                        if (v0_45 <= 0) {
                            v0_1 = v23;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 1, v0_45);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Media.getContentUri(v12), v0_45);
                        }
                        break;
                    case 3:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_43 = this.ensureFile(v15_0.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v15_0.mNumInserts = (v15_0.mNumInserts + 1);
                        long v1_37 = v10_0.insert("thumbnails", "name", v0_43);
                        if (v1_37 <= 0) {
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Thumbnails.getContentUri(v12), v1_37);
                        }
                        break;
                    case 100:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        long v1_32 = this.insertFile(v7_2, p26, p28, 2, 1, p29);
                        if (v1_32 <= 0) {
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 2, v1_32);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Media.getContentUri(v12), v1_32);
                            if (v13 == null) {
                            } else {
                                v8 = this.updateGenre(v1_32, v13);
                            }
                        }
                        break;
                    case 102:
                        v10_0 = v6_1;
                        int v0_39 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_30 = new android.content.ContentValues(p28);
                        v1_30.put("audio_id", v0_39);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_42 = v10_0.insert("audio_genres_map", "genre_id", v1_30);
                        if (v2_42 <= 0) {
                            v23 = 0;
                            v15_0 = v7_2;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_42);
                            v0_1 = v15_2;
                            v15_0 = v7_2;
                        }
                        break;
                    case 104:
                        v10_0 = v6_1;
                        int v0_35 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_26 = new android.content.ContentValues(p28);
                        v1_26.put("audio_id", v0_35);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_37 = v10_0.insert("audio_playlists_map", "playlist_id", v1_26);
                        if (v2_37 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_37);
                        }
                        break;
                    case 106:
                        v10_0 = v6_1;
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        int v0_31 = v10_0.insert("audio_genres", "audio_id", p28);
                        if (v0_31 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Genres.getContentUri(v12), v0_31);
                        }
                        break;
                    case 108:
                        int v22_1 = v6_1;
                        int v0_27 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_20 = new android.content.ContentValues(p28);
                        v1_20.put("genre_id", v0_27);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        v10_0 = v22_1;
                        String v2_29 = v10_0.insert("audio_genres_map", "genre_id", v1_20);
                        if (v2_29 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_29);
                        }
                        break;
                    case 110:
                        int v0_21 = new android.content.ContentValues(p28);
                        v0_21.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                        int v22_0 = v6_1;
                        int v10_5 = v7_2;
                        long v1_18 = this.insertFile(v7_2, p26, v0_21, 4, 1, p29);
                        if (v1_18 <= 0) {
                            v23 = 0;
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Playlists.getContentUri(v12), v1_18);
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        }
                        break;
                    case 111:
                    case 112:
                        int v0_18 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_14 = new android.content.ContentValues(p28);
                        v1_14.put("playlist_id", v0_18);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_20 = v6_1.insert("audio_playlists_map", "playlist_id", v1_14);
                        if (v2_20 <= 0) {
                            v10_0 = v6_1;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_20);
                            v10_0 = v6_1;
                        }
                        break;
                    case 119:
                        int v20_1 = v6_1;
                        if (v7_2.mInternal) {
                            throw new UnsupportedOperationException("no internal album art allowed");
                        } else {
                            try {
                                int v0_13 = this.ensureFile(0, p28, "", "Android/data/com.android.providers.media/albumthumbs");
                            } catch (int v0) {
                                v0_13 = p28;
                            }
                            v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                            v6_1 = v20_1;
                            long v1_12 = v6_1.insert("album_art", "_data", v0_13);
                            if (v1_12 <= 0) {
                            } else {
                                v15_2 = android.content.ContentUris.withAppendedId(p26, v1_12);
                            }
                        }
                        break;
                    case 200:
                        int v20_0 = v6_1;
                        java.util.ArrayList v21 = v7_2;
                        int v0_8 = this.insertFile(v7_2, p26, p28, 3, 1, p29);
                        if (v0_8 <= 0) {
                            v23 = 0;
                            v10_0 = v20_0;
                            v15_0 = v21;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 3, v0_8);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Media.getContentUri(v12), v0_8);
                            v10_0 = v20_0;
                            v15_0 = v21;
                        }
                        break;
                    case 202:
                        v19 = v7_2;
                        int v0_6 = this.ensureFile(v7_2.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        long v1_5 = v6_1.insert("videothumbnails", "name", v0_6);
                        if (v1_5 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Thumbnails.getContentUri(v12), v1_5);
                        }
                        break;
                    case 300:
                        v19 = v7_2;
                        int v0_3 = p28.getAsString("name");
                        long v1_0 = this.attachVolume(v0_3);
                        if ((this.mMediaScannerVolume != null) && (this.mMediaScannerVolume.equals(v0_3))) {
                            String v2_5 = this.getDatabaseForUri(v1_0);
                            if (v2_5 != null) {
                                v2_5.mScanStartTime = android.os.SystemClock.currentTimeMicro();
                            } else {
                                String v4_1 = new StringBuilder();
                                v4_1.append("no database for attached volume ");
                                v4_1.append(v1_0);
                                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v4_1.toString());
                            }
                        }
                        return v1_0;
                    case 700:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_0 = this.insertFile(v19, p26, p28, 0, 1, p29);
                        if (v0_0 <= 0) {
                            v23 = 0;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getContentUri(v12, v0_0);
                            v0_1 = v15_1;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        }
                        break;
                    case 702:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_63 = this.insertFile(v7_2, p26, p28, 0, 0, p29);
                        if (v0_63 <= 0) {
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getMtpObjectsUri(v12, v0_63);
                        }
                        break;
                    case 705:
                        if (this.mMtpService == null) {
                            int v0_60 = this.getContext();
                            v0_60.bindService(new android.content.Intent(v0_60, com.android.providers.media.MtpService), this.mMtpServiceConnection, 1);
                        }
                        this.fixParentIdIfNeeded();
                        break;
                    case 706:
                        int v0_57 = this.insertDirectory(v7_2, v7_2.getWritableDatabase(), p28.getAsString("_data"));
                        if (v0_57 <= 0) {
                        } else {
                            v15_2 = android.provider.MediaStore$Files.getContentUri(v12, v0_57);
                        }
                        break;
                    default:
                        v23 = 0;
                        long v1_43 = new StringBuilder();
                        v1_43.append("Invalid URI ");
                        v1_43.append(p26);
                        throw new UnsupportedOperationException(v1_43.toString());
                }
                if ((v14 != null) && (v14.toLowerCase(java.util.Locale.US).endsWith("/.nomedia"))) {
                    v8.processNewNoMediaPath(v15_0, v10_0, v14);
                }
                return v0_1;
            }
        } else {
            this.mMediaScannerVolume = p28.getAsString("volume");
            int v0_52 = new StringBuilder();
            v0_52.append("content://media/");
            v0_52.append(this.mMediaScannerVolume);
            v0_52.append("/audio");
            int v0_55 = this.getDatabaseForUri(android.net.Uri.parse(v0_52.toString()));
            if (v0_55 != 0) {
                v0_55.mScanStartTime = android.os.SystemClock.currentTimeMicro();
            } else {
                String v2_55 = new StringBuilder();
                v2_55.append("no database for scanned volume ");
                v2_55.append(this.mMediaScannerVolume);
                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v2_55.toString());
            }
            return android.provider.MediaStore.getMediaScannerUri();
        }
    }

Method com.android.providers.media.MediaProvider.insertInternal() calling method android.database.sqlite.SQLiteDatabase.insert()


    private android.net.Uri insertInternal(android.net.Uri p26, int p27, android.content.ContentValues p28, java.util.ArrayList p29)
    {
        void v8 = this;
        String v12 = com.android.providers.media.MediaProvider.getVolumeName(p26);
        if (p27 != 500) {
            int v0_4 = 0;
            long v1_7 = 0;
            if (p28 != null) {
                v0_4 = p28.getAsString("genre");
                p28.remove("genre");
                v1_7 = p28.getAsString("_data");
            }
            String v13 = v0_4;
            String v14 = v1_7;
            java.util.ArrayList v7_2 = this.getDatabaseForUri(p26);
            if ((v7_2 == null) && ((p27 != 300) && (p27 != 705))) {
                long v1_22 = new StringBuilder();
                v1_22.append("Unknown URI: ");
                v1_22.append(p26);
                throw new UnsupportedOperationException(v1_22.toString());
            } else {
                if ((p27 != 300) && (p27 != 705)) {
                    int v0_44 = v7_2.getWritableDatabase();
                } else {
                    v0_44 = 0;
                }
                int v10_0;
                android.net.Uri v15_1;
                int v0_1;
                android.net.Uri v15_2;
                int v18_1;
                java.util.ArrayList v19;
                android.net.Uri v23;
                android.net.Uri v15_0;
                int v6_1 = v0_44;
                switch (p27) {
                    case 1:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_45 = this.insertFile(v15_0, p26, p28, 1, 1, p29);
                        if (v0_45 <= 0) {
                            v0_1 = v23;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 1, v0_45);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Media.getContentUri(v12), v0_45);
                        }
                        break;
                    case 3:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_43 = this.ensureFile(v15_0.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v15_0.mNumInserts = (v15_0.mNumInserts + 1);
                        long v1_37 = v10_0.insert("thumbnails", "name", v0_43);
                        if (v1_37 <= 0) {
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Thumbnails.getContentUri(v12), v1_37);
                        }
                        break;
                    case 100:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        long v1_32 = this.insertFile(v7_2, p26, p28, 2, 1, p29);
                        if (v1_32 <= 0) {
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 2, v1_32);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Media.getContentUri(v12), v1_32);
                            if (v13 == null) {
                            } else {
                                v8 = this.updateGenre(v1_32, v13);
                            }
                        }
                        break;
                    case 102:
                        v10_0 = v6_1;
                        int v0_39 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_30 = new android.content.ContentValues(p28);
                        v1_30.put("audio_id", v0_39);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_42 = v10_0.insert("audio_genres_map", "genre_id", v1_30);
                        if (v2_42 <= 0) {
                            v23 = 0;
                            v15_0 = v7_2;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_42);
                            v0_1 = v15_2;
                            v15_0 = v7_2;
                        }
                        break;
                    case 104:
                        v10_0 = v6_1;
                        int v0_35 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_26 = new android.content.ContentValues(p28);
                        v1_26.put("audio_id", v0_35);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_37 = v10_0.insert("audio_playlists_map", "playlist_id", v1_26);
                        if (v2_37 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_37);
                        }
                        break;
                    case 106:
                        v10_0 = v6_1;
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        int v0_31 = v10_0.insert("audio_genres", "audio_id", p28);
                        if (v0_31 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Genres.getContentUri(v12), v0_31);
                        }
                        break;
                    case 108:
                        int v22_1 = v6_1;
                        int v0_27 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_20 = new android.content.ContentValues(p28);
                        v1_20.put("genre_id", v0_27);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        v10_0 = v22_1;
                        String v2_29 = v10_0.insert("audio_genres_map", "genre_id", v1_20);
                        if (v2_29 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_29);
                        }
                        break;
                    case 110:
                        int v0_21 = new android.content.ContentValues(p28);
                        v0_21.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                        int v22_0 = v6_1;
                        int v10_5 = v7_2;
                        long v1_18 = this.insertFile(v7_2, p26, v0_21, 4, 1, p29);
                        if (v1_18 <= 0) {
                            v23 = 0;
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Playlists.getContentUri(v12), v1_18);
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        }
                        break;
                    case 111:
                    case 112:
                        int v0_18 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_14 = new android.content.ContentValues(p28);
                        v1_14.put("playlist_id", v0_18);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_20 = v6_1.insert("audio_playlists_map", "playlist_id", v1_14);
                        if (v2_20 <= 0) {
                            v10_0 = v6_1;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_20);
                            v10_0 = v6_1;
                        }
                        break;
                    case 119:
                        int v20_1 = v6_1;
                        if (v7_2.mInternal) {
                            throw new UnsupportedOperationException("no internal album art allowed");
                        } else {
                            try {
                                int v0_13 = this.ensureFile(0, p28, "", "Android/data/com.android.providers.media/albumthumbs");
                            } catch (int v0) {
                                v0_13 = p28;
                            }
                            v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                            v6_1 = v20_1;
                            long v1_12 = v6_1.insert("album_art", "_data", v0_13);
                            if (v1_12 <= 0) {
                            } else {
                                v15_2 = android.content.ContentUris.withAppendedId(p26, v1_12);
                            }
                        }
                        break;
                    case 200:
                        int v20_0 = v6_1;
                        java.util.ArrayList v21 = v7_2;
                        int v0_8 = this.insertFile(v7_2, p26, p28, 3, 1, p29);
                        if (v0_8 <= 0) {
                            v23 = 0;
                            v10_0 = v20_0;
                            v15_0 = v21;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 3, v0_8);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Media.getContentUri(v12), v0_8);
                            v10_0 = v20_0;
                            v15_0 = v21;
                        }
                        break;
                    case 202:
                        v19 = v7_2;
                        int v0_6 = this.ensureFile(v7_2.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        long v1_5 = v6_1.insert("videothumbnails", "name", v0_6);
                        if (v1_5 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Thumbnails.getContentUri(v12), v1_5);
                        }
                        break;
                    case 300:
                        v19 = v7_2;
                        int v0_3 = p28.getAsString("name");
                        long v1_0 = this.attachVolume(v0_3);
                        if ((this.mMediaScannerVolume != null) && (this.mMediaScannerVolume.equals(v0_3))) {
                            String v2_5 = this.getDatabaseForUri(v1_0);
                            if (v2_5 != null) {
                                v2_5.mScanStartTime = android.os.SystemClock.currentTimeMicro();
                            } else {
                                String v4_1 = new StringBuilder();
                                v4_1.append("no database for attached volume ");
                                v4_1.append(v1_0);
                                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v4_1.toString());
                            }
                        }
                        return v1_0;
                    case 700:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_0 = this.insertFile(v19, p26, p28, 0, 1, p29);
                        if (v0_0 <= 0) {
                            v23 = 0;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getContentUri(v12, v0_0);
                            v0_1 = v15_1;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        }
                        break;
                    case 702:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_63 = this.insertFile(v7_2, p26, p28, 0, 0, p29);
                        if (v0_63 <= 0) {
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getMtpObjectsUri(v12, v0_63);
                        }
                        break;
                    case 705:
                        if (this.mMtpService == null) {
                            int v0_60 = this.getContext();
                            v0_60.bindService(new android.content.Intent(v0_60, com.android.providers.media.MtpService), this.mMtpServiceConnection, 1);
                        }
                        this.fixParentIdIfNeeded();
                        break;
                    case 706:
                        int v0_57 = this.insertDirectory(v7_2, v7_2.getWritableDatabase(), p28.getAsString("_data"));
                        if (v0_57 <= 0) {
                        } else {
                            v15_2 = android.provider.MediaStore$Files.getContentUri(v12, v0_57);
                        }
                        break;
                    default:
                        v23 = 0;
                        long v1_43 = new StringBuilder();
                        v1_43.append("Invalid URI ");
                        v1_43.append(p26);
                        throw new UnsupportedOperationException(v1_43.toString());
                }
                if ((v14 != null) && (v14.toLowerCase(java.util.Locale.US).endsWith("/.nomedia"))) {
                    v8.processNewNoMediaPath(v15_0, v10_0, v14);
                }
                return v0_1;
            }
        } else {
            this.mMediaScannerVolume = p28.getAsString("volume");
            int v0_52 = new StringBuilder();
            v0_52.append("content://media/");
            v0_52.append(this.mMediaScannerVolume);
            v0_52.append("/audio");
            int v0_55 = this.getDatabaseForUri(android.net.Uri.parse(v0_52.toString()));
            if (v0_55 != 0) {
                v0_55.mScanStartTime = android.os.SystemClock.currentTimeMicro();
            } else {
                String v2_55 = new StringBuilder();
                v2_55.append("no database for scanned volume ");
                v2_55.append(this.mMediaScannerVolume);
                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v2_55.toString());
            }
            return android.provider.MediaStore.getMediaScannerUri();
        }
    }

Method com.android.providers.media.MediaProvider.insertInternal() calling method android.database.sqlite.SQLiteDatabase.insert()


    private android.net.Uri insertInternal(android.net.Uri p26, int p27, android.content.ContentValues p28, java.util.ArrayList p29)
    {
        void v8 = this;
        String v12 = com.android.providers.media.MediaProvider.getVolumeName(p26);
        if (p27 != 500) {
            int v0_4 = 0;
            long v1_7 = 0;
            if (p28 != null) {
                v0_4 = p28.getAsString("genre");
                p28.remove("genre");
                v1_7 = p28.getAsString("_data");
            }
            String v13 = v0_4;
            String v14 = v1_7;
            java.util.ArrayList v7_2 = this.getDatabaseForUri(p26);
            if ((v7_2 == null) && ((p27 != 300) && (p27 != 705))) {
                long v1_22 = new StringBuilder();
                v1_22.append("Unknown URI: ");
                v1_22.append(p26);
                throw new UnsupportedOperationException(v1_22.toString());
            } else {
                if ((p27 != 300) && (p27 != 705)) {
                    int v0_44 = v7_2.getWritableDatabase();
                } else {
                    v0_44 = 0;
                }
                android.net.Uri v15_1;
                android.net.Uri v15_2;
                int v18_1;
                android.net.Uri v23;
                java.util.ArrayList v19;
                int v10_0;
                android.net.Uri v15_0;
                int v0_1;
                int v6_1 = v0_44;
                switch (p27) {
                    case 1:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_45 = this.insertFile(v15_0, p26, p28, 1, 1, p29);
                        if (v0_45 <= 0) {
                            v0_1 = v23;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 1, v0_45);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Media.getContentUri(v12), v0_45);
                        }
                        break;
                    case 3:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_43 = this.ensureFile(v15_0.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v15_0.mNumInserts = (v15_0.mNumInserts + 1);
                        long v1_37 = v10_0.insert("thumbnails", "name", v0_43);
                        if (v1_37 <= 0) {
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Thumbnails.getContentUri(v12), v1_37);
                        }
                        break;
                    case 100:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        long v1_32 = this.insertFile(v7_2, p26, p28, 2, 1, p29);
                        if (v1_32 <= 0) {
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 2, v1_32);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Media.getContentUri(v12), v1_32);
                            if (v13 == null) {
                            } else {
                                v8 = this.updateGenre(v1_32, v13);
                            }
                        }
                        break;
                    case 102:
                        v10_0 = v6_1;
                        int v0_39 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_30 = new android.content.ContentValues(p28);
                        v1_30.put("audio_id", v0_39);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_42 = v10_0.insert("audio_genres_map", "genre_id", v1_30);
                        if (v2_42 <= 0) {
                            v23 = 0;
                            v15_0 = v7_2;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_42);
                            v0_1 = v15_2;
                            v15_0 = v7_2;
                        }
                        break;
                    case 104:
                        v10_0 = v6_1;
                        int v0_35 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_26 = new android.content.ContentValues(p28);
                        v1_26.put("audio_id", v0_35);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_37 = v10_0.insert("audio_playlists_map", "playlist_id", v1_26);
                        if (v2_37 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_37);
                        }
                        break;
                    case 106:
                        v10_0 = v6_1;
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        int v0_31 = v10_0.insert("audio_genres", "audio_id", p28);
                        if (v0_31 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Genres.getContentUri(v12), v0_31);
                        }
                        break;
                    case 108:
                        int v22_1 = v6_1;
                        int v0_27 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_20 = new android.content.ContentValues(p28);
                        v1_20.put("genre_id", v0_27);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        v10_0 = v22_1;
                        String v2_29 = v10_0.insert("audio_genres_map", "genre_id", v1_20);
                        if (v2_29 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_29);
                        }
                        break;
                    case 110:
                        int v0_21 = new android.content.ContentValues(p28);
                        v0_21.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                        int v22_0 = v6_1;
                        int v10_5 = v7_2;
                        long v1_18 = this.insertFile(v7_2, p26, v0_21, 4, 1, p29);
                        if (v1_18 <= 0) {
                            v23 = 0;
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Playlists.getContentUri(v12), v1_18);
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        }
                        break;
                    case 111:
                    case 112:
                        int v0_18 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_14 = new android.content.ContentValues(p28);
                        v1_14.put("playlist_id", v0_18);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_20 = v6_1.insert("audio_playlists_map", "playlist_id", v1_14);
                        if (v2_20 <= 0) {
                            v10_0 = v6_1;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_20);
                            v10_0 = v6_1;
                        }
                        break;
                    case 119:
                        int v20_1 = v6_1;
                        if (v7_2.mInternal) {
                            throw new UnsupportedOperationException("no internal album art allowed");
                        } else {
                            try {
                                int v0_13 = this.ensureFile(0, p28, "", "Android/data/com.android.providers.media/albumthumbs");
                            } catch (int v0) {
                                v0_13 = p28;
                            }
                            v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                            v6_1 = v20_1;
                            long v1_12 = v6_1.insert("album_art", "_data", v0_13);
                            if (v1_12 <= 0) {
                            } else {
                                v15_2 = android.content.ContentUris.withAppendedId(p26, v1_12);
                            }
                        }
                        break;
                    case 200:
                        int v20_0 = v6_1;
                        java.util.ArrayList v21 = v7_2;
                        int v0_8 = this.insertFile(v7_2, p26, p28, 3, 1, p29);
                        if (v0_8 <= 0) {
                            v23 = 0;
                            v10_0 = v20_0;
                            v15_0 = v21;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 3, v0_8);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Media.getContentUri(v12), v0_8);
                            v10_0 = v20_0;
                            v15_0 = v21;
                        }
                        break;
                    case 202:
                        v19 = v7_2;
                        int v0_6 = this.ensureFile(v7_2.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        long v1_5 = v6_1.insert("videothumbnails", "name", v0_6);
                        if (v1_5 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Thumbnails.getContentUri(v12), v1_5);
                        }
                        break;
                    case 300:
                        v19 = v7_2;
                        int v0_3 = p28.getAsString("name");
                        long v1_0 = this.attachVolume(v0_3);
                        if ((this.mMediaScannerVolume != null) && (this.mMediaScannerVolume.equals(v0_3))) {
                            String v2_5 = this.getDatabaseForUri(v1_0);
                            if (v2_5 != null) {
                                v2_5.mScanStartTime = android.os.SystemClock.currentTimeMicro();
                            } else {
                                String v4_1 = new StringBuilder();
                                v4_1.append("no database for attached volume ");
                                v4_1.append(v1_0);
                                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v4_1.toString());
                            }
                        }
                        return v1_0;
                    case 700:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_0 = this.insertFile(v19, p26, p28, 0, 1, p29);
                        if (v0_0 <= 0) {
                            v23 = 0;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getContentUri(v12, v0_0);
                            v0_1 = v15_1;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        }
                        break;
                    case 702:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_63 = this.insertFile(v7_2, p26, p28, 0, 0, p29);
                        if (v0_63 <= 0) {
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getMtpObjectsUri(v12, v0_63);
                        }
                        break;
                    case 705:
                        if (this.mMtpService == null) {
                            int v0_60 = this.getContext();
                            v0_60.bindService(new android.content.Intent(v0_60, com.android.providers.media.MtpService), this.mMtpServiceConnection, 1);
                        }
                        this.fixParentIdIfNeeded();
                        break;
                    case 706:
                        int v0_57 = this.insertDirectory(v7_2, v7_2.getWritableDatabase(), p28.getAsString("_data"));
                        if (v0_57 <= 0) {
                        } else {
                            v15_2 = android.provider.MediaStore$Files.getContentUri(v12, v0_57);
                        }
                        break;
                    default:
                        v23 = 0;
                        long v1_43 = new StringBuilder();
                        v1_43.append("Invalid URI ");
                        v1_43.append(p26);
                        throw new UnsupportedOperationException(v1_43.toString());
                }
                if ((v14 != null) && (v14.toLowerCase(java.util.Locale.US).endsWith("/.nomedia"))) {
                    v8.processNewNoMediaPath(v15_0, v10_0, v14);
                }
                return v0_1;
            }
        } else {
            this.mMediaScannerVolume = p28.getAsString("volume");
            int v0_52 = new StringBuilder();
            v0_52.append("content://media/");
            v0_52.append(this.mMediaScannerVolume);
            v0_52.append("/audio");
            int v0_55 = this.getDatabaseForUri(android.net.Uri.parse(v0_52.toString()));
            if (v0_55 != 0) {
                v0_55.mScanStartTime = android.os.SystemClock.currentTimeMicro();
            } else {
                String v2_55 = new StringBuilder();
                v2_55.append("no database for scanned volume ");
                v2_55.append(this.mMediaScannerVolume);
                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v2_55.toString());
            }
            return android.provider.MediaStore.getMediaScannerUri();
        }
    }

Method com.android.providers.media.MediaProvider.insertInternal() calling method android.database.sqlite.SQLiteDatabase.insert()


    private android.net.Uri insertInternal(android.net.Uri p26, int p27, android.content.ContentValues p28, java.util.ArrayList p29)
    {
        void v8 = this;
        String v12 = com.android.providers.media.MediaProvider.getVolumeName(p26);
        if (p27 != 500) {
            int v0_4 = 0;
            long v1_7 = 0;
            if (p28 != null) {
                v0_4 = p28.getAsString("genre");
                p28.remove("genre");
                v1_7 = p28.getAsString("_data");
            }
            String v13 = v0_4;
            String v14 = v1_7;
            java.util.ArrayList v7_2 = this.getDatabaseForUri(p26);
            if ((v7_2 == null) && ((p27 != 300) && (p27 != 705))) {
                long v1_22 = new StringBuilder();
                v1_22.append("Unknown URI: ");
                v1_22.append(p26);
                throw new UnsupportedOperationException(v1_22.toString());
            } else {
                if ((p27 != 300) && (p27 != 705)) {
                    int v0_44 = v7_2.getWritableDatabase();
                } else {
                    v0_44 = 0;
                }
                int v18_1;
                android.net.Uri v23;
                java.util.ArrayList v19;
                android.net.Uri v15_0;
                int v10_0;
                android.net.Uri v15_1;
                int v0_1;
                android.net.Uri v15_2;
                int v6_1 = v0_44;
                switch (p27) {
                    case 1:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_45 = this.insertFile(v15_0, p26, p28, 1, 1, p29);
                        if (v0_45 <= 0) {
                            v0_1 = v23;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 1, v0_45);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Media.getContentUri(v12), v0_45);
                        }
                        break;
                    case 3:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_43 = this.ensureFile(v15_0.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v15_0.mNumInserts = (v15_0.mNumInserts + 1);
                        long v1_37 = v10_0.insert("thumbnails", "name", v0_43);
                        if (v1_37 <= 0) {
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Thumbnails.getContentUri(v12), v1_37);
                        }
                        break;
                    case 100:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        long v1_32 = this.insertFile(v7_2, p26, p28, 2, 1, p29);
                        if (v1_32 <= 0) {
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 2, v1_32);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Media.getContentUri(v12), v1_32);
                            if (v13 == null) {
                            } else {
                                v8 = this.updateGenre(v1_32, v13);
                            }
                        }
                        break;
                    case 102:
                        v10_0 = v6_1;
                        int v0_39 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_30 = new android.content.ContentValues(p28);
                        v1_30.put("audio_id", v0_39);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_42 = v10_0.insert("audio_genres_map", "genre_id", v1_30);
                        if (v2_42 <= 0) {
                            v23 = 0;
                            v15_0 = v7_2;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_42);
                            v0_1 = v15_2;
                            v15_0 = v7_2;
                        }
                        break;
                    case 104:
                        v10_0 = v6_1;
                        int v0_35 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_26 = new android.content.ContentValues(p28);
                        v1_26.put("audio_id", v0_35);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_37 = v10_0.insert("audio_playlists_map", "playlist_id", v1_26);
                        if (v2_37 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_37);
                        }
                        break;
                    case 106:
                        v10_0 = v6_1;
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        int v0_31 = v10_0.insert("audio_genres", "audio_id", p28);
                        if (v0_31 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Genres.getContentUri(v12), v0_31);
                        }
                        break;
                    case 108:
                        int v22_1 = v6_1;
                        int v0_27 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_20 = new android.content.ContentValues(p28);
                        v1_20.put("genre_id", v0_27);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        v10_0 = v22_1;
                        String v2_29 = v10_0.insert("audio_genres_map", "genre_id", v1_20);
                        if (v2_29 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_29);
                        }
                        break;
                    case 110:
                        int v0_21 = new android.content.ContentValues(p28);
                        v0_21.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                        int v22_0 = v6_1;
                        int v10_5 = v7_2;
                        long v1_18 = this.insertFile(v7_2, p26, v0_21, 4, 1, p29);
                        if (v1_18 <= 0) {
                            v23 = 0;
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Playlists.getContentUri(v12), v1_18);
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        }
                        break;
                    case 111:
                    case 112:
                        int v0_18 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_14 = new android.content.ContentValues(p28);
                        v1_14.put("playlist_id", v0_18);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_20 = v6_1.insert("audio_playlists_map", "playlist_id", v1_14);
                        if (v2_20 <= 0) {
                            v10_0 = v6_1;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_20);
                            v10_0 = v6_1;
                        }
                        break;
                    case 119:
                        int v20_1 = v6_1;
                        if (v7_2.mInternal) {
                            throw new UnsupportedOperationException("no internal album art allowed");
                        } else {
                            try {
                                int v0_13 = this.ensureFile(0, p28, "", "Android/data/com.android.providers.media/albumthumbs");
                            } catch (int v0) {
                                v0_13 = p28;
                            }
                            v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                            v6_1 = v20_1;
                            long v1_12 = v6_1.insert("album_art", "_data", v0_13);
                            if (v1_12 <= 0) {
                            } else {
                                v15_2 = android.content.ContentUris.withAppendedId(p26, v1_12);
                            }
                        }
                        break;
                    case 200:
                        int v20_0 = v6_1;
                        java.util.ArrayList v21 = v7_2;
                        int v0_8 = this.insertFile(v7_2, p26, p28, 3, 1, p29);
                        if (v0_8 <= 0) {
                            v23 = 0;
                            v10_0 = v20_0;
                            v15_0 = v21;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 3, v0_8);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Media.getContentUri(v12), v0_8);
                            v10_0 = v20_0;
                            v15_0 = v21;
                        }
                        break;
                    case 202:
                        v19 = v7_2;
                        int v0_6 = this.ensureFile(v7_2.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        long v1_5 = v6_1.insert("videothumbnails", "name", v0_6);
                        if (v1_5 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Thumbnails.getContentUri(v12), v1_5);
                        }
                        break;
                    case 300:
                        v19 = v7_2;
                        int v0_3 = p28.getAsString("name");
                        long v1_0 = this.attachVolume(v0_3);
                        if ((this.mMediaScannerVolume != null) && (this.mMediaScannerVolume.equals(v0_3))) {
                            String v2_5 = this.getDatabaseForUri(v1_0);
                            if (v2_5 != null) {
                                v2_5.mScanStartTime = android.os.SystemClock.currentTimeMicro();
                            } else {
                                String v4_1 = new StringBuilder();
                                v4_1.append("no database for attached volume ");
                                v4_1.append(v1_0);
                                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v4_1.toString());
                            }
                        }
                        return v1_0;
                    case 700:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_0 = this.insertFile(v19, p26, p28, 0, 1, p29);
                        if (v0_0 <= 0) {
                            v23 = 0;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getContentUri(v12, v0_0);
                            v0_1 = v15_1;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        }
                        break;
                    case 702:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_63 = this.insertFile(v7_2, p26, p28, 0, 0, p29);
                        if (v0_63 <= 0) {
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getMtpObjectsUri(v12, v0_63);
                        }
                        break;
                    case 705:
                        if (this.mMtpService == null) {
                            int v0_60 = this.getContext();
                            v0_60.bindService(new android.content.Intent(v0_60, com.android.providers.media.MtpService), this.mMtpServiceConnection, 1);
                        }
                        this.fixParentIdIfNeeded();
                        break;
                    case 706:
                        int v0_57 = this.insertDirectory(v7_2, v7_2.getWritableDatabase(), p28.getAsString("_data"));
                        if (v0_57 <= 0) {
                        } else {
                            v15_2 = android.provider.MediaStore$Files.getContentUri(v12, v0_57);
                        }
                        break;
                    default:
                        v23 = 0;
                        long v1_43 = new StringBuilder();
                        v1_43.append("Invalid URI ");
                        v1_43.append(p26);
                        throw new UnsupportedOperationException(v1_43.toString());
                }
                if ((v14 != null) && (v14.toLowerCase(java.util.Locale.US).endsWith("/.nomedia"))) {
                    v8.processNewNoMediaPath(v15_0, v10_0, v14);
                }
                return v0_1;
            }
        } else {
            this.mMediaScannerVolume = p28.getAsString("volume");
            int v0_52 = new StringBuilder();
            v0_52.append("content://media/");
            v0_52.append(this.mMediaScannerVolume);
            v0_52.append("/audio");
            int v0_55 = this.getDatabaseForUri(android.net.Uri.parse(v0_52.toString()));
            if (v0_55 != 0) {
                v0_55.mScanStartTime = android.os.SystemClock.currentTimeMicro();
            } else {
                String v2_55 = new StringBuilder();
                v2_55.append("no database for scanned volume ");
                v2_55.append(this.mMediaScannerVolume);
                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v2_55.toString());
            }
            return android.provider.MediaStore.getMediaScannerUri();
        }
    }

Method com.android.providers.media.MediaProvider.insertInternal() calling method android.database.sqlite.SQLiteDatabase.insert()


    private android.net.Uri insertInternal(android.net.Uri p26, int p27, android.content.ContentValues p28, java.util.ArrayList p29)
    {
        void v8 = this;
        String v12 = com.android.providers.media.MediaProvider.getVolumeName(p26);
        if (p27 != 500) {
            int v0_4 = 0;
            long v1_7 = 0;
            if (p28 != null) {
                v0_4 = p28.getAsString("genre");
                p28.remove("genre");
                v1_7 = p28.getAsString("_data");
            }
            String v13 = v0_4;
            String v14 = v1_7;
            java.util.ArrayList v7_2 = this.getDatabaseForUri(p26);
            if ((v7_2 == null) && ((p27 != 300) && (p27 != 705))) {
                long v1_22 = new StringBuilder();
                v1_22.append("Unknown URI: ");
                v1_22.append(p26);
                throw new UnsupportedOperationException(v1_22.toString());
            } else {
                if ((p27 != 300) && (p27 != 705)) {
                    int v0_44 = v7_2.getWritableDatabase();
                } else {
                    v0_44 = 0;
                }
                java.util.ArrayList v19;
                android.net.Uri v15_0;
                int v0_1;
                int v10_0;
                android.net.Uri v15_1;
                android.net.Uri v15_2;
                int v18_1;
                android.net.Uri v23;
                int v6_1 = v0_44;
                switch (p27) {
                    case 1:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_45 = this.insertFile(v15_0, p26, p28, 1, 1, p29);
                        if (v0_45 <= 0) {
                            v0_1 = v23;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 1, v0_45);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Media.getContentUri(v12), v0_45);
                        }
                        break;
                    case 3:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_43 = this.ensureFile(v15_0.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v15_0.mNumInserts = (v15_0.mNumInserts + 1);
                        long v1_37 = v10_0.insert("thumbnails", "name", v0_43);
                        if (v1_37 <= 0) {
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Thumbnails.getContentUri(v12), v1_37);
                        }
                        break;
                    case 100:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        long v1_32 = this.insertFile(v7_2, p26, p28, 2, 1, p29);
                        if (v1_32 <= 0) {
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 2, v1_32);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Media.getContentUri(v12), v1_32);
                            if (v13 == null) {
                            } else {
                                v8 = this.updateGenre(v1_32, v13);
                            }
                        }
                        break;
                    case 102:
                        v10_0 = v6_1;
                        int v0_39 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_30 = new android.content.ContentValues(p28);
                        v1_30.put("audio_id", v0_39);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_42 = v10_0.insert("audio_genres_map", "genre_id", v1_30);
                        if (v2_42 <= 0) {
                            v23 = 0;
                            v15_0 = v7_2;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_42);
                            v0_1 = v15_2;
                            v15_0 = v7_2;
                        }
                        break;
                    case 104:
                        v10_0 = v6_1;
                        int v0_35 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_26 = new android.content.ContentValues(p28);
                        v1_26.put("audio_id", v0_35);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_37 = v10_0.insert("audio_playlists_map", "playlist_id", v1_26);
                        if (v2_37 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_37);
                        }
                        break;
                    case 106:
                        v10_0 = v6_1;
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        int v0_31 = v10_0.insert("audio_genres", "audio_id", p28);
                        if (v0_31 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Genres.getContentUri(v12), v0_31);
                        }
                        break;
                    case 108:
                        int v22_1 = v6_1;
                        int v0_27 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_20 = new android.content.ContentValues(p28);
                        v1_20.put("genre_id", v0_27);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        v10_0 = v22_1;
                        String v2_29 = v10_0.insert("audio_genres_map", "genre_id", v1_20);
                        if (v2_29 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_29);
                        }
                        break;
                    case 110:
                        int v0_21 = new android.content.ContentValues(p28);
                        v0_21.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                        int v22_0 = v6_1;
                        int v10_5 = v7_2;
                        long v1_18 = this.insertFile(v7_2, p26, v0_21, 4, 1, p29);
                        if (v1_18 <= 0) {
                            v23 = 0;
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Playlists.getContentUri(v12), v1_18);
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        }
                        break;
                    case 111:
                    case 112:
                        int v0_18 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_14 = new android.content.ContentValues(p28);
                        v1_14.put("playlist_id", v0_18);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_20 = v6_1.insert("audio_playlists_map", "playlist_id", v1_14);
                        if (v2_20 <= 0) {
                            v10_0 = v6_1;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_20);
                            v10_0 = v6_1;
                        }
                        break;
                    case 119:
                        int v20_1 = v6_1;
                        if (v7_2.mInternal) {
                            throw new UnsupportedOperationException("no internal album art allowed");
                        } else {
                            try {
                                int v0_13 = this.ensureFile(0, p28, "", "Android/data/com.android.providers.media/albumthumbs");
                            } catch (int v0) {
                                v0_13 = p28;
                            }
                            v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                            v6_1 = v20_1;
                            long v1_12 = v6_1.insert("album_art", "_data", v0_13);
                            if (v1_12 <= 0) {
                            } else {
                                v15_2 = android.content.ContentUris.withAppendedId(p26, v1_12);
                            }
                        }
                        break;
                    case 200:
                        int v20_0 = v6_1;
                        java.util.ArrayList v21 = v7_2;
                        int v0_8 = this.insertFile(v7_2, p26, p28, 3, 1, p29);
                        if (v0_8 <= 0) {
                            v23 = 0;
                            v10_0 = v20_0;
                            v15_0 = v21;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 3, v0_8);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Media.getContentUri(v12), v0_8);
                            v10_0 = v20_0;
                            v15_0 = v21;
                        }
                        break;
                    case 202:
                        v19 = v7_2;
                        int v0_6 = this.ensureFile(v7_2.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        long v1_5 = v6_1.insert("videothumbnails", "name", v0_6);
                        if (v1_5 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Thumbnails.getContentUri(v12), v1_5);
                        }
                        break;
                    case 300:
                        v19 = v7_2;
                        int v0_3 = p28.getAsString("name");
                        long v1_0 = this.attachVolume(v0_3);
                        if ((this.mMediaScannerVolume != null) && (this.mMediaScannerVolume.equals(v0_3))) {
                            String v2_5 = this.getDatabaseForUri(v1_0);
                            if (v2_5 != null) {
                                v2_5.mScanStartTime = android.os.SystemClock.currentTimeMicro();
                            } else {
                                String v4_1 = new StringBuilder();
                                v4_1.append("no database for attached volume ");
                                v4_1.append(v1_0);
                                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v4_1.toString());
                            }
                        }
                        return v1_0;
                    case 700:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_0 = this.insertFile(v19, p26, p28, 0, 1, p29);
                        if (v0_0 <= 0) {
                            v23 = 0;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getContentUri(v12, v0_0);
                            v0_1 = v15_1;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        }
                        break;
                    case 702:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_63 = this.insertFile(v7_2, p26, p28, 0, 0, p29);
                        if (v0_63 <= 0) {
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getMtpObjectsUri(v12, v0_63);
                        }
                        break;
                    case 705:
                        if (this.mMtpService == null) {
                            int v0_60 = this.getContext();
                            v0_60.bindService(new android.content.Intent(v0_60, com.android.providers.media.MtpService), this.mMtpServiceConnection, 1);
                        }
                        this.fixParentIdIfNeeded();
                        break;
                    case 706:
                        int v0_57 = this.insertDirectory(v7_2, v7_2.getWritableDatabase(), p28.getAsString("_data"));
                        if (v0_57 <= 0) {
                        } else {
                            v15_2 = android.provider.MediaStore$Files.getContentUri(v12, v0_57);
                        }
                        break;
                    default:
                        v23 = 0;
                        long v1_43 = new StringBuilder();
                        v1_43.append("Invalid URI ");
                        v1_43.append(p26);
                        throw new UnsupportedOperationException(v1_43.toString());
                }
                if ((v14 != null) && (v14.toLowerCase(java.util.Locale.US).endsWith("/.nomedia"))) {
                    v8.processNewNoMediaPath(v15_0, v10_0, v14);
                }
                return v0_1;
            }
        } else {
            this.mMediaScannerVolume = p28.getAsString("volume");
            int v0_52 = new StringBuilder();
            v0_52.append("content://media/");
            v0_52.append(this.mMediaScannerVolume);
            v0_52.append("/audio");
            int v0_55 = this.getDatabaseForUri(android.net.Uri.parse(v0_52.toString()));
            if (v0_55 != 0) {
                v0_55.mScanStartTime = android.os.SystemClock.currentTimeMicro();
            } else {
                String v2_55 = new StringBuilder();
                v2_55.append("no database for scanned volume ");
                v2_55.append(this.mMediaScannerVolume);
                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v2_55.toString());
            }
            return android.provider.MediaStore.getMediaScannerUri();
        }
    }

Method com.android.providers.media.MediaProvider.insertInternal() calling method android.database.sqlite.SQLiteDatabase.insert()


    private android.net.Uri insertInternal(android.net.Uri p26, int p27, android.content.ContentValues p28, java.util.ArrayList p29)
    {
        void v8 = this;
        String v12 = com.android.providers.media.MediaProvider.getVolumeName(p26);
        if (p27 != 500) {
            int v0_4 = 0;
            long v1_7 = 0;
            if (p28 != null) {
                v0_4 = p28.getAsString("genre");
                p28.remove("genre");
                v1_7 = p28.getAsString("_data");
            }
            String v13 = v0_4;
            String v14 = v1_7;
            java.util.ArrayList v7_2 = this.getDatabaseForUri(p26);
            if ((v7_2 == null) && ((p27 != 300) && (p27 != 705))) {
                long v1_22 = new StringBuilder();
                v1_22.append("Unknown URI: ");
                v1_22.append(p26);
                throw new UnsupportedOperationException(v1_22.toString());
            } else {
                if ((p27 != 300) && (p27 != 705)) {
                    int v0_44 = v7_2.getWritableDatabase();
                } else {
                    v0_44 = 0;
                }
                int v0_1;
                java.util.ArrayList v19;
                android.net.Uri v15_2;
                android.net.Uri v23;
                int v10_0;
                android.net.Uri v15_1;
                android.net.Uri v15_0;
                int v18_1;
                int v6_1 = v0_44;
                switch (p27) {
                    case 1:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_45 = this.insertFile(v15_0, p26, p28, 1, 1, p29);
                        if (v0_45 <= 0) {
                            v0_1 = v23;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 1, v0_45);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Media.getContentUri(v12), v0_45);
                        }
                        break;
                    case 3:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_43 = this.ensureFile(v15_0.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v15_0.mNumInserts = (v15_0.mNumInserts + 1);
                        long v1_37 = v10_0.insert("thumbnails", "name", v0_43);
                        if (v1_37 <= 0) {
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Thumbnails.getContentUri(v12), v1_37);
                        }
                        break;
                    case 100:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        long v1_32 = this.insertFile(v7_2, p26, p28, 2, 1, p29);
                        if (v1_32 <= 0) {
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 2, v1_32);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Media.getContentUri(v12), v1_32);
                            if (v13 == null) {
                            } else {
                                v8 = this.updateGenre(v1_32, v13);
                            }
                        }
                        break;
                    case 102:
                        v10_0 = v6_1;
                        int v0_39 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_30 = new android.content.ContentValues(p28);
                        v1_30.put("audio_id", v0_39);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_42 = v10_0.insert("audio_genres_map", "genre_id", v1_30);
                        if (v2_42 <= 0) {
                            v23 = 0;
                            v15_0 = v7_2;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_42);
                            v0_1 = v15_2;
                            v15_0 = v7_2;
                        }
                        break;
                    case 104:
                        v10_0 = v6_1;
                        int v0_35 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_26 = new android.content.ContentValues(p28);
                        v1_26.put("audio_id", v0_35);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_37 = v10_0.insert("audio_playlists_map", "playlist_id", v1_26);
                        if (v2_37 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_37);
                        }
                        break;
                    case 106:
                        v10_0 = v6_1;
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        int v0_31 = v10_0.insert("audio_genres", "audio_id", p28);
                        if (v0_31 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Genres.getContentUri(v12), v0_31);
                        }
                        break;
                    case 108:
                        int v22_1 = v6_1;
                        int v0_27 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_20 = new android.content.ContentValues(p28);
                        v1_20.put("genre_id", v0_27);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        v10_0 = v22_1;
                        String v2_29 = v10_0.insert("audio_genres_map", "genre_id", v1_20);
                        if (v2_29 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_29);
                        }
                        break;
                    case 110:
                        int v0_21 = new android.content.ContentValues(p28);
                        v0_21.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                        int v22_0 = v6_1;
                        int v10_5 = v7_2;
                        long v1_18 = this.insertFile(v7_2, p26, v0_21, 4, 1, p29);
                        if (v1_18 <= 0) {
                            v23 = 0;
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Playlists.getContentUri(v12), v1_18);
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        }
                        break;
                    case 111:
                    case 112:
                        int v0_18 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_14 = new android.content.ContentValues(p28);
                        v1_14.put("playlist_id", v0_18);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_20 = v6_1.insert("audio_playlists_map", "playlist_id", v1_14);
                        if (v2_20 <= 0) {
                            v10_0 = v6_1;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_20);
                            v10_0 = v6_1;
                        }
                        break;
                    case 119:
                        int v20_1 = v6_1;
                        if (v7_2.mInternal) {
                            throw new UnsupportedOperationException("no internal album art allowed");
                        } else {
                            try {
                                int v0_13 = this.ensureFile(0, p28, "", "Android/data/com.android.providers.media/albumthumbs");
                            } catch (int v0) {
                                v0_13 = p28;
                            }
                            v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                            v6_1 = v20_1;
                            long v1_12 = v6_1.insert("album_art", "_data", v0_13);
                            if (v1_12 <= 0) {
                            } else {
                                v15_2 = android.content.ContentUris.withAppendedId(p26, v1_12);
                            }
                        }
                        break;
                    case 200:
                        int v20_0 = v6_1;
                        java.util.ArrayList v21 = v7_2;
                        int v0_8 = this.insertFile(v7_2, p26, p28, 3, 1, p29);
                        if (v0_8 <= 0) {
                            v23 = 0;
                            v10_0 = v20_0;
                            v15_0 = v21;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 3, v0_8);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Media.getContentUri(v12), v0_8);
                            v10_0 = v20_0;
                            v15_0 = v21;
                        }
                        break;
                    case 202:
                        v19 = v7_2;
                        int v0_6 = this.ensureFile(v7_2.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        long v1_5 = v6_1.insert("videothumbnails", "name", v0_6);
                        if (v1_5 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Thumbnails.getContentUri(v12), v1_5);
                        }
                        break;
                    case 300:
                        v19 = v7_2;
                        int v0_3 = p28.getAsString("name");
                        long v1_0 = this.attachVolume(v0_3);
                        if ((this.mMediaScannerVolume != null) && (this.mMediaScannerVolume.equals(v0_3))) {
                            String v2_5 = this.getDatabaseForUri(v1_0);
                            if (v2_5 != null) {
                                v2_5.mScanStartTime = android.os.SystemClock.currentTimeMicro();
                            } else {
                                String v4_1 = new StringBuilder();
                                v4_1.append("no database for attached volume ");
                                v4_1.append(v1_0);
                                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v4_1.toString());
                            }
                        }
                        return v1_0;
                    case 700:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_0 = this.insertFile(v19, p26, p28, 0, 1, p29);
                        if (v0_0 <= 0) {
                            v23 = 0;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getContentUri(v12, v0_0);
                            v0_1 = v15_1;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        }
                        break;
                    case 702:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_63 = this.insertFile(v7_2, p26, p28, 0, 0, p29);
                        if (v0_63 <= 0) {
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getMtpObjectsUri(v12, v0_63);
                        }
                        break;
                    case 705:
                        if (this.mMtpService == null) {
                            int v0_60 = this.getContext();
                            v0_60.bindService(new android.content.Intent(v0_60, com.android.providers.media.MtpService), this.mMtpServiceConnection, 1);
                        }
                        this.fixParentIdIfNeeded();
                        break;
                    case 706:
                        int v0_57 = this.insertDirectory(v7_2, v7_2.getWritableDatabase(), p28.getAsString("_data"));
                        if (v0_57 <= 0) {
                        } else {
                            v15_2 = android.provider.MediaStore$Files.getContentUri(v12, v0_57);
                        }
                        break;
                    default:
                        v23 = 0;
                        long v1_43 = new StringBuilder();
                        v1_43.append("Invalid URI ");
                        v1_43.append(p26);
                        throw new UnsupportedOperationException(v1_43.toString());
                }
                if ((v14 != null) && (v14.toLowerCase(java.util.Locale.US).endsWith("/.nomedia"))) {
                    v8.processNewNoMediaPath(v15_0, v10_0, v14);
                }
                return v0_1;
            }
        } else {
            this.mMediaScannerVolume = p28.getAsString("volume");
            int v0_52 = new StringBuilder();
            v0_52.append("content://media/");
            v0_52.append(this.mMediaScannerVolume);
            v0_52.append("/audio");
            int v0_55 = this.getDatabaseForUri(android.net.Uri.parse(v0_52.toString()));
            if (v0_55 != 0) {
                v0_55.mScanStartTime = android.os.SystemClock.currentTimeMicro();
            } else {
                String v2_55 = new StringBuilder();
                v2_55.append("no database for scanned volume ");
                v2_55.append(this.mMediaScannerVolume);
                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v2_55.toString());
            }
            return android.provider.MediaStore.getMediaScannerUri();
        }
    }

Method com.android.providers.media.MediaProvider.insertInternal() calling method android.database.sqlite.SQLiteDatabase.insert()


    private android.net.Uri insertInternal(android.net.Uri p26, int p27, android.content.ContentValues p28, java.util.ArrayList p29)
    {
        void v8 = this;
        String v12 = com.android.providers.media.MediaProvider.getVolumeName(p26);
        if (p27 != 500) {
            int v0_4 = 0;
            long v1_7 = 0;
            if (p28 != null) {
                v0_4 = p28.getAsString("genre");
                p28.remove("genre");
                v1_7 = p28.getAsString("_data");
            }
            String v13 = v0_4;
            String v14 = v1_7;
            java.util.ArrayList v7_2 = this.getDatabaseForUri(p26);
            if ((v7_2 == null) && ((p27 != 300) && (p27 != 705))) {
                long v1_22 = new StringBuilder();
                v1_22.append("Unknown URI: ");
                v1_22.append(p26);
                throw new UnsupportedOperationException(v1_22.toString());
            } else {
                if ((p27 != 300) && (p27 != 705)) {
                    int v0_44 = v7_2.getWritableDatabase();
                } else {
                    v0_44 = 0;
                }
                android.net.Uri v15_1;
                android.net.Uri v15_2;
                int v18_1;
                android.net.Uri v23;
                java.util.ArrayList v19;
                android.net.Uri v15_0;
                int v0_1;
                int v10_0;
                int v6_1 = v0_44;
                switch (p27) {
                    case 1:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_45 = this.insertFile(v15_0, p26, p28, 1, 1, p29);
                        if (v0_45 <= 0) {
                            v0_1 = v23;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 1, v0_45);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Media.getContentUri(v12), v0_45);
                        }
                        break;
                    case 3:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        int v0_43 = this.ensureFile(v15_0.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v15_0.mNumInserts = (v15_0.mNumInserts + 1);
                        long v1_37 = v10_0.insert("thumbnails", "name", v0_43);
                        if (v1_37 <= 0) {
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Images$Thumbnails.getContentUri(v12), v1_37);
                        }
                        break;
                    case 100:
                        v10_0 = v6_1;
                        v23 = 0;
                        v15_0 = v7_2;
                        long v1_32 = this.insertFile(v7_2, p26, p28, 2, 1, p29);
                        if (v1_32 <= 0) {
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 2, v1_32);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Media.getContentUri(v12), v1_32);
                            if (v13 == null) {
                            } else {
                                v8 = this.updateGenre(v1_32, v13);
                            }
                        }
                        break;
                    case 102:
                        v10_0 = v6_1;
                        int v0_39 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_30 = new android.content.ContentValues(p28);
                        v1_30.put("audio_id", v0_39);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_42 = v10_0.insert("audio_genres_map", "genre_id", v1_30);
                        if (v2_42 <= 0) {
                            v23 = 0;
                            v15_0 = v7_2;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_42);
                            v0_1 = v15_2;
                            v15_0 = v7_2;
                        }
                        break;
                    case 104:
                        v10_0 = v6_1;
                        int v0_35 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(2))));
                        long v1_26 = new android.content.ContentValues(p28);
                        v1_26.put("audio_id", v0_35);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_37 = v10_0.insert("audio_playlists_map", "playlist_id", v1_26);
                        if (v2_37 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_37);
                        }
                        break;
                    case 106:
                        v10_0 = v6_1;
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        int v0_31 = v10_0.insert("audio_genres", "audio_id", p28);
                        if (v0_31 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Genres.getContentUri(v12), v0_31);
                        }
                        break;
                    case 108:
                        int v22_1 = v6_1;
                        int v0_27 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_20 = new android.content.ContentValues(p28);
                        v1_20.put("genre_id", v0_27);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        v10_0 = v22_1;
                        String v2_29 = v10_0.insert("audio_genres_map", "genre_id", v1_20);
                        if (v2_29 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_29);
                        }
                        break;
                    case 110:
                        int v0_21 = new android.content.ContentValues(p28);
                        v0_21.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                        int v22_0 = v6_1;
                        int v10_5 = v7_2;
                        long v1_18 = this.insertFile(v7_2, p26, v0_21, 4, 1, p29);
                        if (v1_18 <= 0) {
                            v23 = 0;
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        } else {
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Audio$Playlists.getContentUri(v12), v1_18);
                            v15_0 = v10_5;
                            v10_0 = v22_0;
                        }
                        break;
                    case 111:
                    case 112:
                        int v0_18 = Long.valueOf(Long.parseLong(((String) p26.getPathSegments().get(3))));
                        long v1_14 = new android.content.ContentValues(p28);
                        v1_14.put("playlist_id", v0_18);
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        String v2_20 = v6_1.insert("audio_playlists_map", "playlist_id", v1_14);
                        if (v2_20 <= 0) {
                            v10_0 = v6_1;
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(p26, v2_20);
                            v10_0 = v6_1;
                        }
                        break;
                    case 119:
                        int v20_1 = v6_1;
                        if (v7_2.mInternal) {
                            throw new UnsupportedOperationException("no internal album art allowed");
                        } else {
                            try {
                                int v0_13 = this.ensureFile(0, p28, "", "Android/data/com.android.providers.media/albumthumbs");
                            } catch (int v0) {
                                v0_13 = p28;
                            }
                            v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                            v6_1 = v20_1;
                            long v1_12 = v6_1.insert("album_art", "_data", v0_13);
                            if (v1_12 <= 0) {
                            } else {
                                v15_2 = android.content.ContentUris.withAppendedId(p26, v1_12);
                            }
                        }
                        break;
                    case 200:
                        int v20_0 = v6_1;
                        java.util.ArrayList v21 = v7_2;
                        int v0_8 = this.insertFile(v7_2, p26, p28, 3, 1, p29);
                        if (v0_8 <= 0) {
                            v23 = 0;
                            v10_0 = v20_0;
                            v15_0 = v21;
                        } else {
                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreInsert(this.getContext(), v12, 3, v0_8);
                            v0_1 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Media.getContentUri(v12), v0_8);
                            v10_0 = v20_0;
                            v15_0 = v21;
                        }
                        break;
                    case 202:
                        v19 = v7_2;
                        int v0_6 = this.ensureFile(v7_2.mInternal, p28, ".jpg", "DCIM/.thumbnails");
                        v7_2.mNumInserts = (v7_2.mNumInserts + 1);
                        long v1_5 = v6_1.insert("videothumbnails", "name", v0_6);
                        if (v1_5 <= 0) {
                        } else {
                            v15_2 = android.content.ContentUris.withAppendedId(android.provider.MediaStore$Video$Thumbnails.getContentUri(v12), v1_5);
                        }
                        break;
                    case 300:
                        v19 = v7_2;
                        int v0_3 = p28.getAsString("name");
                        long v1_0 = this.attachVolume(v0_3);
                        if ((this.mMediaScannerVolume != null) && (this.mMediaScannerVolume.equals(v0_3))) {
                            String v2_5 = this.getDatabaseForUri(v1_0);
                            if (v2_5 != null) {
                                v2_5.mScanStartTime = android.os.SystemClock.currentTimeMicro();
                            } else {
                                String v4_1 = new StringBuilder();
                                v4_1.append("no database for attached volume ");
                                v4_1.append(v1_0);
                                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v4_1.toString());
                            }
                        }
                        return v1_0;
                    case 700:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_0 = this.insertFile(v19, p26, p28, 0, 1, p29);
                        if (v0_0 <= 0) {
                            v23 = 0;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getContentUri(v12, v0_0);
                            v0_1 = v15_1;
                            v10_0 = v18_1;
                            v15_0 = v19;
                        }
                        break;
                    case 702:
                        v18_1 = v6_1;
                        v19 = v7_2;
                        int v0_63 = this.insertFile(v7_2, p26, p28, 0, 0, p29);
                        if (v0_63 <= 0) {
                        } else {
                            v15_1 = android.provider.MediaStore$Files.getMtpObjectsUri(v12, v0_63);
                        }
                        break;
                    case 705:
                        if (this.mMtpService == null) {
                            int v0_60 = this.getContext();
                            v0_60.bindService(new android.content.Intent(v0_60, com.android.providers.media.MtpService), this.mMtpServiceConnection, 1);
                        }
                        this.fixParentIdIfNeeded();
                        break;
                    case 706:
                        int v0_57 = this.insertDirectory(v7_2, v7_2.getWritableDatabase(), p28.getAsString("_data"));
                        if (v0_57 <= 0) {
                        } else {
                            v15_2 = android.provider.MediaStore$Files.getContentUri(v12, v0_57);
                        }
                        break;
                    default:
                        v23 = 0;
                        long v1_43 = new StringBuilder();
                        v1_43.append("Invalid URI ");
                        v1_43.append(p26);
                        throw new UnsupportedOperationException(v1_43.toString());
                }
                if ((v14 != null) && (v14.toLowerCase(java.util.Locale.US).endsWith("/.nomedia"))) {
                    v8.processNewNoMediaPath(v15_0, v10_0, v14);
                }
                return v0_1;
            }
        } else {
            this.mMediaScannerVolume = p28.getAsString("volume");
            int v0_52 = new StringBuilder();
            v0_52.append("content://media/");
            v0_52.append(this.mMediaScannerVolume);
            v0_52.append("/audio");
            int v0_55 = this.getDatabaseForUri(android.net.Uri.parse(v0_52.toString()));
            if (v0_55 != 0) {
                v0_55.mScanStartTime = android.os.SystemClock.currentTimeMicro();
            } else {
                String v2_55 = new StringBuilder();
                v2_55.append("no database for scanned volume ");
                v2_55.append(this.mMediaScannerVolume);
                android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v2_55.toString());
            }
            return android.provider.MediaStore.getMediaScannerUri();
        }
    }

Method com.android.providers.media.MediaProvider.insertFile() calling method android.database.sqlite.SQLiteDatabase.insert()


    private long insertFile(com.android.providers.media.MediaProvider$DatabaseHelper p36, android.net.Uri p37, android.content.ContentValues p38, int p39, boolean p40, java.util.ArrayList p41)
    {
        int v29;
        Long v5_2;
        com.android.providers.media.MediaProvider v7_2;
        com.android.providers.media.MediaProvider$DatabaseHelper v1_18;
        Long v21_0;
        int v11_3 = p36.getWritableDatabase();
        int v0_5 = 0;
        switch (p39) {
            case 1:
                v21_0 = 0;
                v29 = v11_3;
                v7_2 = this;
                v1_18 = p36;
                v5_2 = p38;
                v0_5 = this.ensureFile(p36.mInternal, p38, ".jpg", android.os.Environment.DIRECTORY_PICTURES);
                v0_5.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
                android.content.ContentValues v2_6 = v0_5.getAsString("_data");
                if (!v0_5.containsKey("_display_name")) {
                    com.android.providers.media.MediaProvider.computeDisplayName(v2_6, v0_5);
                }
                com.android.providers.media.MediaProvider.computeTakenTime(v0_5);
                break;
            case 2:
                int v0_25;
                android.database.sqlite.SQLiteDatabase v9_2 = new android.content.ContentValues(p38);
                long v8_7 = v9_2.getAsString("album_artist");
                com.android.providers.media.MediaProvider v7_3 = v9_2.getAsString("compilation");
                v9_2.remove("compilation");
                java.util.ArrayList v6_5 = v9_2.get("artist");
                if (v6_5 != null) {
                    v0_25 = v6_5.toString();
                } else {
                    v0_25 = "";
                }
                Long v5_8 = v0_25;
                v9_2.remove("artist");
                int v4_5 = p36.mArtistCache;
                java.util.HashMap v3_13 = v9_2.getAsString("_data");
                try {
                    String v23_1;
                    String v25;
                    String v26;
                    int v27;
                    int v14_1;
                    long v18_8;
                    com.android.providers.media.MediaProvider$DatabaseHelper v1_1;
                    int v0_48 = ((Long) v4_5.get(v5_8));
                } catch (int v0_0) {
                    Throwable v24 = v4_5;
                    String v19 = v6_5;
                    v26 = v8_7;
                    v29 = v11_3;
                }
                if (v0_48 != 0) {
                    v23_1 = v3_13;
                    v18_8 = v5_8;
                    v25 = v7_3;
                    v26 = v8_7;
                    v27 = v9_2;
                    v14_1 = 0;
                    v29 = v11_3;
                    try {
                        v1_1 = v0_48.longValue();
                    } catch (int v0_0) {
                        com.android.providers.media.MediaProvider v7 = this;
                    }
                } else {
                    try {
                        v23_1 = v3_13;
                        v18_8 = v5_8;
                        v25 = v7_3;
                        com.android.providers.media.MediaProvider v7_4 = v18_8;
                        v26 = v8_7;
                        v27 = v9_2;
                        android.database.sqlite.SQLiteDatabase v9_3 = v23_1;
                        v14_1 = 0;
                        v29 = v11_3;
                        try {
                            v1_1 = this.getKeyIdForName(p36, v11_3, "artists", "artist_key", "artist", v7_4, v18_8, v9_3, 0, 0, v4_5, p37);
                        } catch (int v0_0) {
                            v7 = this;
                        }
                    } catch (int v0_0) {
                        long v18 = "artist_key";
                        v29 = 0;
                        v25 = v7_4;
                        Throwable v15 = v9_3;
                    }
                }
                int v0_2;
                Long v12_1 = v1_1;
                int v11_1 = v18_8;
                Throwable v10_1 = v27;
                android.database.sqlite.SQLiteDatabase v9_0 = v10_1.get("album");
                if (v9_0 != null) {
                    v0_2 = v9_0.toString();
                } else {
                    v0_2 = "";
                }
                int v4_0;
                long v8_0 = v0_2;
                v10_1.remove("album");
                com.android.providers.media.MediaProvider v7_0 = p36.mAlbumCache;
                int v0_4 = 0;
                java.util.ArrayList v6_0 = v26;
                if (v6_0 == null) {
                    Long v5_0 = v25;
                    try {
                        if ((v5_0 == null) || (!v5_0.equals("1"))) {
                            v4_0 = v23_1;
                            try {
                                v0_4 = v4_0.substring(v14_1, v4_0.lastIndexOf(47)).hashCode();
                            } catch (int v0_6) {
                                v25 = v5_0;
                                com.android.providers.media.MediaProvider v20 = v7_0;
                                android.database.sqlite.SQLiteDatabase v28 = v9_0;
                                java.util.HashMap v3 = v12_1;
                            }
                            com.android.providers.media.MediaProvider$DatabaseHelper v1_16;
                            Throwable v15_1;
                            java.util.HashMap v30;
                            com.android.providers.media.MediaProvider$DatabaseHelper v1_12 = new StringBuilder();
                            v1_12.append(v8_0);
                            v1_12.append(v0_4);
                            java.util.HashMap v3_1 = v1_12.toString();
                            android.content.ContentValues v2_1 = ((Long) v7_0.get(v3_1));
                            if (v2_1 != null) {
                                String v23 = v4_0;
                                v26 = v6_0;
                                v27 = v8_0;
                                v15_1 = v10_1;
                                v30 = v12_1;
                                v21_0 = v14_1;
                                try {
                                    v1_16 = v2_1.longValue();
                                } catch (int v0_6) {
                                    v7 = this;
                                }
                            } else {
                                try {
                                    v21_0 = v14_1;
                                    com.android.providers.media.MediaProvider v7_1 = v8_0;
                                    android.database.sqlite.SQLiteDatabase v9_1 = v4_0;
                                    v15_1 = v10_1;
                                    v30 = v12_1;
                                    Long v12_2 = v7_0;
                                    try {
                                        v1_16 = this.getKeyIdForName(p36, v29, "albums", "album_key", "album", v7_1, v3_1, v9_1, v0_4, v11_1, v12_2, p37);
                                    } catch (int v0_6) {
                                    }
                                } catch (int v0_6) {
                                    v25 = "album_key";
                                    v20 = v7_1;
                                    v28 = v9_1;
                                    v3 = v12_2;
                                }
                            }
                            int v0_10;
                            v15_1.put("artist_id", Integer.toString(((int) v30)));
                            v15_1.put("album_id", Integer.toString(((int) v1_16)));
                            Long v5_7 = v15_1.getAsString("title");
                            if (v5_7 != null) {
                                v0_10 = v5_7.toString();
                            } else {
                                v0_10 = "";
                            }
                            java.util.ArrayList v6_2 = v0_10;
                            v7_2 = this;
                            try {
                                int v0_11 = this.getLocalizedTitle(v6_2);
                            } catch (int v0) {
                                v15_1.put("title_resource_uri", v6_2);
                                v15_1.put("title_key", android.provider.MediaStore$Audio.keyFor(v6_2));
                                v15_1.put("title", v6_2.trim());
                                com.android.providers.media.MediaProvider.computeDisplayName(v15_1.getAsString("_data"), v15_1);
                                v0_5 = v15_1;
                                v1_18 = p36;
                                v5_2 = p38;
                            }
                            if (v0_11 == 0) {
                                v15_1.putNull("title_resource_uri");
                            } else {
                                v15_1.put("title_resource_uri", v6_2);
                                v6_2 = v0_11;
                            }
                        } else {
                            v4_0 = v23_1;
                        }
                    } catch (int v0_6) {
                        v20 = v7_0;
                        v28 = v9_0;
                        v3 = v12_1;
                    }
                    while(true) {
                        throw v0_6;
                    }
                } else {
                    try {
                        v0_4 = v6_0.hashCode();
                        v4_0 = v23_1;
                    } catch (int v0_6) {
                    }
                }
                try {
                } catch (int v0_6) {
                }
                break;
            case 3:
                v0_5 = this.ensureFile(p36.mInternal, p38, ".3gp", "video");
                com.android.providers.media.MediaProvider.computeDisplayName(v0_5.getAsString("_data"), v0_5);
                com.android.providers.media.MediaProvider.computeTakenTime(v0_5);
                v21_0 = 0;
                v29 = v11_3;
                v5_2 = p38;
                v7_2 = this;
                v1_18 = p36;
                break;
            default:
                v21_0 = 0;
                v29 = v11_3;
                v5_2 = p38;
                v7_2 = this;
                v1_18 = p36;
        }
        if (v0_5 == 0) {
            v0_5 = new android.content.ContentValues(v5_2);
        }
        android.content.ContentValues v2_10 = v0_5.getAsString("_data");
        if (v2_10 != null) {
            com.android.providers.media.MediaProvider.computeBucketValues(v2_10, v0_5);
        }
        v0_5.put("date_added", Long.valueOf((System.currentTimeMillis() / 1000)));
        java.util.HashMap v3_11 = 0;
        java.util.ArrayList v6_4 = v0_5.getAsInteger("media_scanner_new_object_id");
        if (v6_4 != null) {
            v3_11 = ((long) v6_4.intValue());
            v0_5 = new android.content.ContentValues(v0_5);
            v0_5.remove("media_scanner_new_object_id");
        }
        long v8_14 = v3_11;
        java.util.HashMap v3_12 = v0_5;
        int v0_20 = v3_12.getAsString("title");
        if ((v0_20 == 0) && (v2_10 != null)) {
            v0_20 = android.media.MediaFile.getFileTitle(v2_10);
        }
        int v11_2;
        v3_12.put("title", v0_20);
        int v0_24 = v3_12.getAsString("mime_type");
        Throwable v10_4 = v3_12.getAsInteger("format");
        if (v10_4 != null) {
            v11_2 = v10_4.intValue();
        } else {
            v11_2 = v21_0;
        }
        Throwable v15_2;
        if (v11_2 != 0) {
            v15_2 = v29;
        } else {
            if (!android.text.TextUtils.isEmpty(v2_10)) {
                v15_2 = v29;
                v11_2 = android.media.MediaFile.getFormatCode(v2_10, v0_24);
            } else {
                if (p39 != 4) {
                    v15_2 = v29;
                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, "path is empty in insertFile()");
                } else {
                    v3_12.put("format", Integer.valueOf(47621));
                    int v14_6 = new StringBuilder();
                    v14_6.append(v7_2.mExternalStoragePaths[v21_0]);
                    v14_6.append("/Playlists/");
                    v14_6.append(v3_12.getAsString("name"));
                    v2_10 = v14_6.toString();
                    v3_12.put("_data", v2_10);
                    v15_2 = v29;
                    v3_12.put("parent", Long.valueOf(v7_2.getParent(v1_18, v15_2, v2_10)));
                }
            }
        }
        if ((v2_10 == null) || (!v2_10.endsWith("/"))) {
            if (v11_2 != 0) {
                v3_12.put("format", Integer.valueOf(v11_2));
                if (v0_24 == 0) {
                    v0_24 = android.media.MediaFile.getMimeTypeForFormatCode(v11_2);
                }
            }
            if ((v0_24 == 0) && ((v2_10 != null) && (v11_2 != 12289))) {
                v0_24 = android.media.MediaFile.getMimeTypeForFile(v2_10);
            }
            int v14_11;
            String v13_7 = v0_24;
            if (v13_7 == null) {
                v14_11 = p39;
            } else {
                v3_12.put("mime_type", v13_7);
                if (v3_12.containsKey("media_type")) {
                } else {
                    v14_11 = p39;
                    if ((p39 == 0) && (!android.media.MediaScanner.isNoMediaPath(v2_10))) {
                        int v0_31 = android.media.MediaFile.getFileTypeForMimeType(v13_7);
                        if (!android.media.MediaFile.isAudioFileType(v0_31)) {
                            if (!android.media.MediaFile.isVideoFileType(v0_31)) {
                                if (!android.media.MediaFile.isImageFileType(v0_31)) {
                                    if (android.media.MediaFile.isPlayListFileType(v0_31)) {
                                        v14_11 = 4;
                                    }
                                } else {
                                    v14_11 = 1;
                                }
                            } else {
                                v14_11 = 3;
                            }
                        } else {
                            v14_11 = 2;
                        }
                    }
                }
            }
            v3_12.put("media_type", Integer.valueOf(v14_11));
            if (v8_14 != 0) {
                Exception v34 = v6_4;
                v1_18.mNumUpdates = (v1_18.mNumUpdates + 1);
                Long v5_10 = new String[1];
                v5_10[v21_0] = Long.toString(v8_14);
                v15_2.update("files", v3_12, "_id=?", v5_10);
            } else {
                if (v14_11 != 4) {
                    if (v2_10 == null) {
                        v34 = v6_4;
                        throw new IllegalArgumentException("no path was provided when inserting new file");
                    }
                } else {
                    if ((v3_12.getAsString("name") == null) && (v2_10 == null)) {
                        throw new IllegalArgumentException("no name was provided when inserting abstract playlist");
                    }
                }
                if (v2_10 == null) {
                    v34 = v6_4;
                } else {
                    int v0_46 = new java.io.File(v2_10);
                    if (!v0_46.exists()) {
                    } else {
                        v3_12.put("date_modified", Long.valueOf((v0_46.lastModified() / 1000)));
                        if (!v3_12.containsKey("_size")) {
                            v3_12.put("_size", Long.valueOf(v0_46.length()));
                        }
                        if ((v14_11 == 1) || (v14_11 == 3)) {
                            com.android.providers.media.MediaProvider.computeTakenTime(v3_12);
                        }
                    }
                }
                if ((v3_12.getAsLong("parent") == null) && (v2_10 != null)) {
                    v3_12.put("parent", Long.valueOf(v7_2.getParent(v1_18, v15_2, v2_10)));
                }
                v1_18.mNumInserts = (v1_18.mNumInserts + 1);
                v8_14 = v15_2.insert("files", "date_modified", v3_12);
                if ((v8_14 != -1) && (p40)) {
                    p41.add(Long.valueOf(v8_14));
                }
            }
            if (v11_2 == 12289) {
                try {
                    v7_2.mDirectoryCache.put(v2_10, Long.valueOf(v8_14));
                } catch (int v0_53) {
                    throw v0_53;
                }
            }
            return v8_14;
        } else {
            Long v12_18 = new StringBuilder();
            v12_18.append("directory has trailing slash: ");
            v12_18.append(v2_10);
            android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v12_18.toString());
            return 0;
        }
    }

Method com.android.providers.media.MediaProvider.insertDirectory() calling method android.database.sqlite.SQLiteDatabase.insert()


    private long insertDirectory(com.android.providers.media.MediaProvider$DatabaseHelper p8, android.database.sqlite.SQLiteDatabase p9, String p10)
    {
        android.content.ContentValues v0_1 = new android.content.ContentValues();
        v0_1.put("format", Integer.valueOf(12289));
        v0_1.put("_data", p10);
        v0_1.put("parent", Long.valueOf(this.getParent(p8, p9, p10)));
        java.io.File v1_1 = new java.io.File(p10);
        if (v1_1.exists()) {
            v0_1.put("date_modified", Long.valueOf((v1_1.lastModified() / 1000)));
        }
        p8.mNumInserts = (p8.mNumInserts + 1);
        return p9.insert("files", "date_modified", v0_1);
    }

Method com.android.providers.media.MediaProvider.getKeyIdForName() calling method android.database.sqlite.SQLiteDatabase.insert()


    private long getKeyIdForName(com.android.providers.media.MediaProvider$DatabaseHelper p31, android.database.sqlite.SQLiteDatabase p32, String p33, String p34, String p35, String p36, String p37, String p38, int p39, String p40, java.util.HashMap p41, android.net.Uri p42)
    {
        if ((p36 != null) && (p36.length() != 0)) {
            void v1_0 = p36;
        } else {
            v1_0 = "<unknown>";
        }
        Throwable v0_7 = android.provider.MediaStore$Audio.keyFor(v1_0);
        if (v0_7 != null) {
            boolean v18 = p33.equals("albums");
            boolean v19 = "<unknown>".equals(v1_0);
            if (v18) {
                android.database.Cursor v8_3 = new StringBuilder();
                v8_3.append(v0_7);
                v8_3.append(p39);
                v0_7 = v8_3.toString();
                if (v19) {
                    android.database.Cursor v8_6 = new StringBuilder();
                    v8_6.append(v0_7);
                    v8_6.append(p40);
                    v0_7 = v8_6.toString();
                }
            }
            android.content.ContentResolver v13_12 = v0_7;
            java.util.HashMap v12_1 = new String[1];
            v12_1[0] = v13_12;
            p31.mNumQueries = (p31.mNumQueries + 1);
            android.database.Cursor v8_10 = new StringBuilder();
            v8_10.append(p34);
            v8_10.append("=?");
            String v24 = v13_12;
            android.database.Cursor v8_12 = p32.query(p33, 0, v8_10.toString(), v12_1, 0, 0, 0);
            try {
                android.content.ContentResolver v13_11;
                java.util.HashMap v12_0;
                switch (v8_12.getCount()) {
                    case 0:
                        Throwable v0_11 = new android.content.ContentValues();
                        String v7_1;
                        v0_11.put(p34, v24);
                        v0_11.put(p35, v1_0);
                        p31.mNumInserts = (p31.mNumInserts + 1);
                        v13_11 = p32.insert(p33, "duration", v0_11);
                        if ((p38 == null) || ((!v18) || (v19))) {
                            v7_1 = p33;
                            v12_0 = p41;
                        } else {
                            v12_0 = p41;
                            v7_1 = p33;
                            this.makeThumbAsync(p31, p32, p38, v13_11);
                        }
                        if (v13_11 > 0) {
                            void v1_5 = p42.toString().substring(16, 24);
                            android.net.Uri v2_11 = new StringBuilder();
                            v2_11.append("content://media/");
                            v2_11.append(v1_5);
                            v2_11.append("/audio/");
                            v2_11.append(v7_1);
                            v2_11.append("/");
                            v2_11.append(v13_11);
                            this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_11.toString()), 0);
                        }
                        break;
                    case 1:
                        try {
                            v8_12.moveToFirst();
                            long v14_2 = v8_12.getLong(0);
                            Throwable v0_17 = v8_12.getString(2);
                            try {
                                String v10_5 = this.makeBestName(v1_0, v0_17);
                            } catch (Throwable v0_9) {
                                long v15 = v1_0;
                                java.util.HashMap v28 = v12_1;
                                java.util.HashMap v12 = p41;
                                libcore.io.IoUtils.closeQuietly(v8_12);
                                throw v0_9;
                            }
                            if (!v10_5.equals(v0_17)) {
                                android.content.ContentValues v11_1 = new android.content.ContentValues();
                                v11_1.put(p35, v10_5);
                                p31.mNumUpdates = (p31.mNumUpdates + 1);
                                android.content.ContentResolver v13_3 = new StringBuilder();
                                v13_3.append("rowid=");
                                v13_3.append(Integer.toString(((int) v14_2)));
                                p32.update(p33, v11_1, v13_3.toString(), 0);
                                try {
                                    Throwable v0_6 = p42.toString().substring(16, 24);
                                    android.net.Uri v2_2 = new StringBuilder();
                                    v2_2.append("content://media/");
                                    v2_2.append(v0_6);
                                    v2_2.append("/audio/");
                                    v2_2.append(p33);
                                    v2_2.append("/");
                                    v2_2.append(v14_2);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_2.toString()), 0);
                                } catch (Throwable v0_9) {
                                    v15 = v1_0;
                                    v28 = v12_1;
                                    v12 = p41;
                                }
                            }
                            v28 = v12_1;
                            v13_11 = v14_2;
                            v12_0 = p41;
                        } catch (Throwable v0_9) {
                        }
                        break;
                    default:
                        v15 = v1_0;
                        String v10_1 = v24;
                        v12_0 = p41;
                        void v1_7 = new StringBuilder();
                        v1_7.append("Multiple entries in table ");
                        v1_7.append(p33);
                        v1_7.append(" for key ");
                        v1_7.append(v10_1);
                        android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v1_7.toString());
                        v13_11 = -1;
                }
            } catch (Throwable v0_9) {
                android.content.ContentResolver v3 = p37;
                String v7 = p33;
                String v10 = v24;
            } catch (Throwable v0_9) {
            }
            Throwable v0_13 = v13_11;
            libcore.io.IoUtils.closeQuietly(v8_12);
            if ((v12_0 != null) && (!v19)) {
                v12_0.put(p37, Long.valueOf(v0_13));
            }
            return v0_13;
        } else {
            android.util.Log.e(com.android.providers.media.MediaProvider.TAG, "null key", new Exception());
            return -1;
        }
    }

Method com.android.providers.media.MediaProvider.update() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    public int update(android.net.Uri p44, android.content.ContentValues p45, String p46, String[] p47)
    {
        int v14_0 = this;
        String v12_3 = this.safeUncanonicalize(p44);
        int v11_6 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v12_3);
        android.content.ContentValues v10_4 = this.getDatabaseForUri(v12_3);
        if (v10_4 == null) {
            String v4_0 = v12_3;
            void v9 = this;
            String v15 = v11_6;
            long v1_4 = new StringBuilder();
            v1_4.append("Unknown URI: ");
            v1_4.append(v4_0);
            throw new UnsupportedOperationException(v1_4.toString());
        } else {
            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
            String v8_2 = v10_4.getWritableDatabase();
            Throwable v0_27 = 0;
            if (p45 != null) {
                v0_27 = p45.getAsString("genre");
                p45.remove("genre");
            }
            String v22_1;
            String v8_5;
            String v7_8;
            int v23;
            String v7_5 = v0_27;
            android.content.ContentValues v5_7 = this.getTableAndWhere(v12_3, v11_6, p46);
            if (!p45.containsKey("media_type")) {
                v22_1 = v5_7;
                v23 = v7_5;
                v7_8 = v8_2;
                v8_5 = 0;
            } else {
                String v16_6 = p45.getAsLong("media_type").longValue();
                v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                v22_1 = v5_7;
                v23 = v7_5;
                android.content.ContentResolver v24_1 = v8_2;
                Throwable v0_85 = v8_2.query(v5_7.table, com.android.providers.media.MediaProvider.sMediaTableColumns, v5_7.where, p47, 0, 0, 0);
                while(true) {
                    long v1_45 = v0_85;
                    if ((v1_45 == 0) || (!v1_45.moveToNext())) {
                        break;
                    }
                    String v7_16;
                    String v2_31 = v1_45.getLong(1);
                    try {
                        if ((v2_31 != 1) || (v16_6 == 1)) {
                            v7_16 = v24_1;
                            if ((v2_31 == 3) && (v16_6 != 3)) {
                                String v4_30 = new StringBuilder();
                                v4_30.append("need to remove video thumbnail for id ");
                                v4_30.append(v1_45.getString(0));
                                android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_30.toString());
                                v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                            }
                        } else {
                            String v4_34 = new StringBuilder();
                            v4_34.append("need to remove image thumbnail for id ");
                            v4_34.append(v1_45.getString(0));
                            android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_34.toString());
                            v7_16 = v24_1;
                            v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                        }
                        v0_85 = v1_45;
                        v24_1 = v7_16;
                    } catch (Throwable v0_109) {
                        libcore.io.IoUtils.closeQuietly(v1_45);
                        throw v0_109;
                    }
                }
                v7_8 = v24_1;
                v8_5 = 0;
                libcore.io.IoUtils.closeQuietly(v1_45);
            }
            if ((v11_6 != 702) && ((v11_6 != 703) && (v11_6 != 706))) {
                long v1_0 = 5;
                String v17_0 = 1;
                void v9_0 = v22_1;
                String v8_0 = v7_8;
                String v7_0 = 3;
            } else {
                if ((p45 == null) || (((p45.size() != 1) || (!p45.containsKey("_data"))) && ((p45.size() != 2) || ((!p45.containsKey("_data")) || (!p45.containsKey("parent")))))) {
                    v1_0 = 5;
                    v17_0 = 1;
                    v9_0 = v22_1;
                    v8_0 = v7_8;
                    v7_0 = 3;
                } else {
                    String v16_0 = 0;
                    String v2_0 = p45.getAsString("_data");
                    v14_0.mDirectoryCache.remove(v2_0);
                    long v1_1 = new java.io.File(v2_0);
                    if ((v2_0 == null) || (!v1_1.isDirectory())) {
                        v17_0 = 1;
                        v9_0 = v22_1;
                        v8_0 = v7_8;
                        v7_0 = 3;
                        String v6 = v1_1;
                        v1_0 = 5;
                        android.content.ContentValues v5_0 = v2_0;
                        if (v5_0.toLowerCase(java.util.Locale.US).endsWith("/.nomedia")) {
                            v14_0 = v14_0.processNewNoMediaPath(v10_4, v8_0, v5_0);
                        }
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                        v9_0 = v22_1;
                        java.util.HashMap v26 = v1_1;
                        boolean v27 = v2_0;
                        long v28 = v7_8;
                        Throwable v0_17 = v8_5;
                        long v1_5 = v7_8.query(v9_0.table, com.android.providers.media.MediaProvider.PATH_PROJECTION, p46, p47, 0, 0, 0);
                        try {
                            if ((v1_5 != 0) && (v1_5.moveToNext())) {
                                v16_0 = v1_5.getString(1);
                            }
                        } catch (Throwable v0_18) {
                            libcore.io.IoUtils.closeQuietly(v1_5);
                            throw v0_18;
                        }
                        String v2_7 = v16_0;
                        libcore.io.IoUtils.closeQuietly(v1_5);
                        if (v2_7 == null) {
                            android.content.ContentValues v5 = v27;
                            v8_0 = v28;
                            v1_0 = 5;
                            v7_0 = 3;
                            v17_0 = 1;
                        } else {
                            String v6_14;
                            android.content.ContentValues v5_19;
                            v14_0.mDirectoryCache.remove(v2_7);
                            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                            String v8_11 = v28;
                            String v3_38 = v8_11.update(v9_0.table, p45, v9_0.where, p47);
                            if (v3_38 <= null) {
                                v6_14 = v26;
                                v5_19 = v27;
                            } else {
                                String v4_21 = new Object[6];
                                v5_19 = v27;
                                v4_21[v0_17] = v5_19;
                                v4_21[1] = Integer.valueOf((v2_7.length() + 1));
                                Throwable v0_90 = new StringBuilder();
                                v0_90.append(v2_7);
                                v0_90.append("/");
                                v4_21[2] = v0_90.toString();
                                Throwable v0_93 = new StringBuilder();
                                v0_93.append(v2_7);
                                v0_93.append("0");
                                v4_21[3] = v0_93.toString();
                                v6_14 = v26;
                                v4_21[4] = v6_14.getName();
                                v4_21[5] = Integer.valueOf(v6_14.toString().toLowerCase().hashCode());
                                Throwable v0_101 = v4_21;
                                v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                                v8_11.execSQL("UPDATE files SET _data=?1||SUBSTR(_data, ?2),bucket_display_name=?5,bucket_id=?6 WHERE _data >= ?3 AND _data < ?4;", v0_101);
                            }
                            if ((v3_38 > null) && (!v8_11.inTransaction())) {
                                this.getContext().getContentResolver().notifyChange(v12_3, 0);
                            }
                            if (v6_14.getName().startsWith(".")) {
                                v14_0.processNewNoMediaPath(v10_4, v8_11, v5_19);
                            }
                            return v3_38;
                        }
                    }
                }
            }
            Throwable v0_64;
            int v11_0;
            String v12_0;
            String v42;
            int v13_1;
            switch (v11_6) {
                case 1:
                case 2:
                case 200:
                case 201:
                    int v11_5 = v17_0;
                    v13_1 = v8_0;
                    String v8_8 = v12_3;
                    String v12_6 = v9_0;
                    void v9_6 = v14_0;
                    android.content.ContentValues v5_14 = new android.content.ContentValues(p45);
                    v5_14.remove("bucket_id");
                    v5_14.remove("bucket_display_name");
                    String v4_13 = v5_14.getAsString("_data");
                    if (v4_13 != null) {
                        com.android.providers.media.MediaProvider.computeBucketValues(v4_13, v5_14);
                    }
                    com.android.providers.media.MediaProvider.computeTakenTime(v5_14);
                    v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_5);
                    String v16_7 = v13_1.update(v12_6.table, v5_14, v12_6.where, p47);
                    if ((v16_7 <= null) || (v5_14.getAsString("_data") == null)) {
                        v42 = v8_8;
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + v11_5);
                        v42 = v8_8;
                        String v7_11 = v13_1.query(v12_6.table, com.android.providers.media.MediaProvider.READY_FLAG_PROJECTION, v12_6.where, p47, 0, 0, 0);
                        if (v7_11 == null) {
                            v0_64 = v16_7;
                            String v3 = p47;
                        }
                        try {
                            while (v7_11.moveToNext()) {
                                if (v7_11.getLong(2) == 0) {
                                    v9_6.requestMediaThumbnail(v7_11.getString(v11_5), v42, 10, 0);
                                }
                            }
                        } catch (Throwable v0_81) {
                            libcore.io.IoUtils.closeQuietly(v7_11);
                            throw v0_81;
                        }
                        libcore.io.IoUtils.closeQuietly(v7_11);
                    }
                case 100:
                case 101:
                    android.content.ContentValues v38;
                    long v34;
                    int v13_2;
                    int v35;
                    int v25;
                    int v36;
                    int v31;
                    String v37;
                    int v32;
                    String v6_3 = new android.content.ContentValues(p45);
                    android.content.ContentValues v5_3 = v6_3.getAsString("album_artist");
                    String v3_6 = v6_3.getAsString("compilation");
                    v6_3.remove("compilation");
                    String v2_16 = v6_3.getAsString("artist");
                    v6_3.remove("artist");
                    if (v2_16 == null) {
                        v25 = v2_16;
                        v31 = v3_6;
                        v32 = v5_3;
                        v34 = v8_0;
                        v35 = v9_0;
                        v36 = v10_4;
                        v37 = v11_6;
                        v38 = v12_3;
                        v13_2 = v6_3;
                    } else {
                        long v1_20 = v10_4.mArtistCache;
                        try {
                            long v1_21;
                            String v33;
                            Throwable v0_25 = ((Long) v1_20.get(v2_16));
                        } catch (Throwable v0_26) {
                            v25 = v2_16;
                            v32 = v5_3;
                            v35 = v9_0;
                            v37 = v11_6;
                            v15 = p47;
                        }
                        if (v0_25 != null) {
                            v25 = v2_16;
                            v31 = v3_6;
                            v32 = v5_3;
                            v33 = v6_3;
                            v34 = v8_0;
                            v35 = v9_0;
                            v36 = v10_4;
                            v37 = v11_6;
                            v38 = v12_3;
                            try {
                                v1_21 = v0_25.longValue();
                            } catch (Throwable v0_26) {
                            }
                        } else {
                            try {
                                v25 = v2_16;
                                String v2_17 = v10_4;
                                v31 = v3_6;
                                v32 = v5_3;
                                v33 = v6_3;
                                v34 = v8_0;
                                v35 = v9_0;
                                v36 = v10_4;
                                v37 = v11_6;
                                v38 = v12_3;
                                int v13_3 = v38;
                                try {
                                    v1_21 = v14_0.getKeyIdForName(v2_17, v8_0, "artists", "artist_key", "artist", v25, v25, 0, 0, 0, v1_20, v13_3);
                                } catch (Throwable v0_26) {
                                }
                            } catch (Throwable v0_26) {
                                v25 = v2_17;
                                v32 = "artist_key";
                                v35 = 0;
                                v37 = 0;
                                v15 = v13_3;
                            }
                        }
                        v13_2 = v33;
                        v13_2.put("artist_id", Integer.toString(((int) v1_21)));
                    }
                    String v40;
                    String v41;
                    String v39;
                    int v14_1;
                    String v12_2 = v13_2.getAsString("album");
                    v13_2.remove("album");
                    if (v12_2 == null) {
                        v14_1 = v13_2;
                        int v21 = v32;
                        v39 = v36;
                        v41 = v37;
                        v40 = v38;
                    } else {
                        String v16_5;
                        void v9_3;
                        android.content.ContentValues v5_5;
                        String v7_6 = v13_2.getAsString("_data");
                        String v8_4 = 0;
                        int v11_2 = v32;
                        if (v11_2 == 0) {
                            android.content.ContentValues v10_1 = v31;
                            if ((v10_1 == null) || (!v10_1.equals("1"))) {
                                if (v7_6 != null) {
                                    v9_3 = v37;
                                    v5_5 = v38;
                                } else {
                                    v9_3 = v37;
                                    if (v9_3 != 100) {
                                        long v1_26 = v14_0.query(v38, new String[] {"_data"}), 0, 0, 0);
                                        if (v1_26 == 0) {
                                            v5_5 = v38;
                                        } else {
                                            try {
                                                Throwable v0_36 = v1_26.getCount();
                                            } catch (Throwable v0_38) {
                                                libcore.io.IoUtils.closeQuietly(v1_26);
                                                throw v0_38;
                                            }
                                            if (v0_36 != 1) {
                                                String v3_12 = new StringBuilder();
                                                v3_12.append("");
                                                v3_12.append(v0_36);
                                                v3_12.append(" rows for ");
                                                v5_5 = v38;
                                                try {
                                                    v3_12.append(v5_5);
                                                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v3_12.toString());
                                                } catch (Throwable v0_38) {
                                                }
                                            } else {
                                                try {
                                                    v1_26.moveToFirst();
                                                    v7_6 = v1_26.getString(0);
                                                    v5_5 = v38;
                                                } catch (Throwable v0_38) {
                                                }
                                            }
                                            libcore.io.IoUtils.closeQuietly(v1_26);
                                        }
                                    } else {
                                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Possible multi row album name update without path could give wrong album key");
                                        v5_5 = v38;
                                    }
                                }
                                if (v7_6 != null) {
                                    v8_4 = v7_6.substring(0, v7_6.lastIndexOf(47)).hashCode();
                                }
                                v16_5 = v7_6;
                            } else {
                                v16_5 = v7_6;
                                v9_3 = v37;
                                v5_5 = v38;
                            }
                        } else {
                            v8_4 = v11_2.hashCode();
                            v16_5 = v7_6;
                        }
                        String v7_7 = v12_2.toString();
                        String v4_9 = v36;
                        String v3_15 = v4_9.mAlbumCache;
                        try {
                            long v1_31;
                            Throwable v0_47 = new StringBuilder();
                            v0_47.append(v7_7);
                            v0_47.append(v8_4);
                            Throwable v0_48 = v0_47.toString();
                            String v2_23 = ((Long) v3_15.get(v0_48));
                        } catch (Throwable v0_49) {
                            v39 = v4_9;
                            String v17 = v7_7;
                            v41 = v9_3;
                            v21 = v11_2;
                            int v14 = v13_2;
                            throw v0_49;
                        } catch (Throwable v0_49) {
                        }
                        if (v2_23 != null) {
                            v39 = v4_9;
                            v40 = v5_5;
                            Throwable v18 = v8_4;
                            v41 = v9_3;
                            v21 = v11_2;
                            v14_1 = v13_2;
                            v1_31 = v2_23.longValue();
                        } else {
                            v39 = v4_9;
                            v40 = v5_5;
                            v41 = v9_3;
                            v14_1 = v13_2;
                            v1_31 = v14_0.getKeyIdForName(v4_9, v34, "albums", "album_key", "album", v7_7, v0_48, v16_5, v8_4, v25, v3_15, v40);
                        }
                        v14_1.put("album_id", Integer.toString(((int) v1_31)));
                    }
                    void v9_5;
                    String v2_26;
                    v14_1.remove("title_key");
                    long v1_33 = v14_1.getAsString("title");
                    if (v1_33 == 0) {
                        v2_26 = v14_1;
                        v9_5 = this;
                    } else {
                        v2_26 = v14_1;
                        v9_5 = this;
                        try {
                            Throwable v0_56 = this.getLocalizedTitle(v1_33);
                        } catch (Throwable v0) {
                            v2_26.put("title_resource_uri", v1_33);
                            v2_26.put("title_key", android.provider.MediaStore$Audio.keyFor(v1_33));
                            v2_26.put("title", v1_33.trim());
                        }
                        if (v0_56 == null) {
                            v2_26.putNull("title_resource_uri");
                        } else {
                            v2_26.put("title_resource_uri", v1_33);
                            v1_33 = v0_56;
                        }
                    }
                    String v8_7;
                    android.content.ContentValues v10_3 = v39;
                    v10_3.mNumUpdates = (v10_3.mNumUpdates + 1);
                    String v12_5 = v35;
                    v13_1 = v34;
                    v0_64 = v13_1.update(v12_5.table, v2_26, v12_5.where, p47);
                    int v14_2 = v23;
                    if (v14_2 == 0) {
                        v8_7 = v40;
                    } else {
                        String v15_2;
                        if (v0_64 != 1) {
                            v8_7 = v40;
                            v15_2 = v41;
                        } else {
                            v15_2 = v41;
                            if (v15_2 != 101) {
                                v8_7 = v40;
                            } else {
                                v8_7 = v40;
                                v9_5.updateGenre(Long.parseLong(((String) v8_7.getPathSegments().get(3))), v14_2);
                                v42 = v8_7;
                            }
                        }
                        android.content.ContentValues v5_10 = new StringBuilder();
                        v5_10.append("ignoring genre in update: count = ");
                        v5_10.append(v0_64);
                        v5_10.append(" match = ");
                        v5_10.append(v15_2);
                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v5_10.toString());
                    }
                    break;
                case 113:
                    if (v12_3.getQueryParameter("move") == null) {
                        v13_1 = v8_0;
                        v42 = v12_3;
                        v11_0 = v17_0;
                        v12_0 = v9_0;
                        v14 = v23;
                        v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_0);
                        v0_64 = v13_1.update(v12_0.table, p45, v12_0.where, p47);
                    } else {
                        if (!p45.containsKey("play_order")) {
                            String v2_10 = new StringBuilder();
                            v2_10.append("Need to specify ");
                            v2_10.append("play_order");
                            v2_10.append(" when using \'move\' parameter");
                            throw new IllegalArgumentException(v2_10.toString());
                        } else {
                            String v16_1 = p45.getAsInteger("play_order").intValue();
                            String v4_2 = v12_3.getPathSegments();
                            v0 = "play_order";
                            return v14_0.movePlaylistEntry(v10_4, v8_0, Long.parseLong(((String) v4_2.get(v7_0))), Integer.parseInt(((String) v4_2.get(v1_0))), v16_1);
                        }
                    }
                default:
                    v13_1 = v8_0;
                    v42 = v12_3;
                    v11_0 = v17_0;
                    v12_0 = v9_0;
                    v14 = v23;
            }
            if ((v0_64 > null) && (!v13_1.inTransaction())) {
                this.getContext().getContentResolver().notifyChange(v42, 0);
            }
            return v0_64;
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        android.database.sqlite.SQLiteDatabase v9_0;
                        android.database.sqlite.SQLiteDatabase v13_0;
                        String v14_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.updateFromOCSchema() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    private static void updateFromOCSchema(android.database.sqlite.SQLiteDatabase p1)
    {
        p1.execSQL("ALTER TABLE files ADD COLUMN title_resource_uri TEXT DEFAULT NULL");
        p1.execSQL("UPDATE files SET date_modified=0 WHERE (is_alarm IS 1) OR (is_ringtone IS 1) OR (is_notification IS 1)");
        return;
    }

Method com.android.providers.media.MediaProvider.updateFromKKSchema() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    private static void updateFromKKSchema(android.database.sqlite.SQLiteDatabase p1)
    {
        p1.execSQL("DELETE from albums");
        p1.execSQL("DELETE from artists");
        p1.execSQL("ALTER TABLE files ADD COLUMN title_resource_uri TEXT DEFAULT NULL");
        p1.execSQL("UPDATE files SET date_modified=0");
        return;
    }

Method com.android.providers.media.MediaProvider.sanityCheck() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    private static void sanityCheck(android.database.sqlite.SQLiteDatabase p10, int p11)
    {
        android.database.Cursor v1 = 0;
        try {
            android.database.Cursor v0 = p10.query("audio_meta", new String[] {"count(*)"}), 0, 0, 0, 0, 0);
            v1 = p10.query("audio_meta", new String[] {"count(distinct _data)"}), 0, 0, 0, 0, 0);
            v0.moveToFirst();
            v1.moveToFirst();
            int v3_2 = v0.getInt(0);
            Throwable v2_7 = v1.getInt(0);
        } catch (Throwable v2_8) {
            libcore.io.IoUtils.closeQuietly(v0);
            libcore.io.IoUtils.closeQuietly(v1);
            throw v2_8;
        }
        if (v3_2 != v2_7) {
            String v5_2 = new StringBuilder();
            v5_2.append("audio_meta._data column is not unique while upgrading from schema ");
            v5_2.append(p11);
            v5_2.append(" : ");
            v5_2.append(v3_2);
            v5_2.append("/");
            v5_2.append(v2_7);
            android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v5_2.toString());
            p10.execSQL("DELETE FROM audio_meta;");
        }
        libcore.io.IoUtils.closeQuietly(v0);
        libcore.io.IoUtils.closeQuietly(v1);
        return;
    }

Method com.android.providers.media.MediaProvider.removeThumbnailFor() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    private void removeThumbnailFor(android.net.Uri p4, android.database.sqlite.SQLiteDatabase p5, long p6)
    {
        android.database.Cursor v0_1 = new StringBuilder();
        v0_1.append("select _data from thumbnails where image_id=");
        v0_1.append(p6);
        v0_1.append(" union all select _data from videothumbnails where video_id=");
        v0_1.append(p6);
        android.database.Cursor v0_2 = p5.rawQuery(v0_1.toString(), 0);
        if (v0_2 != null) {
            while (v0_2.moveToNext()) {
                this.deleteIfAllowed(p4, v0_2.getString(0));
            }
            libcore.io.IoUtils.closeQuietly(v0_2);
            String v1_3 = new StringBuilder();
            v1_3.append("delete from thumbnails where image_id=");
            v1_3.append(p6);
            p5.execSQL(v1_3.toString());
            String v1_7 = new StringBuilder();
            v1_7.append("delete from videothumbnails where video_id=");
            v1_7.append(p6);
            p5.execSQL(v1_7.toString());
        }
        String v1_9 = android.media.MiniThumbFile.instance(p4);
        v1_9.eraseMiniThumb(p6);
        v1_9.deactivate();
        return;
    }

Method com.android.providers.media.MediaProvider.pruneThumbnails() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    private void pruneThumbnails()
    {
        android.util.Log.v(com.android.providers.media.MediaProvider.TAG, "pruneThumbnails ");
        android.database.sqlite.SQLiteDatabase v12 = this.getDatabaseForUri(android.provider.MediaStore$Images$Thumbnails.getContentUri("external")).getWritableDatabase();
        v12.execSQL("delete from thumbnails where image_id not in (select _id from images)");
        v12.execSQL("delete from videothumbnails where video_id not in (select _id from video)");
        java.util.HashSet v13 = new java.util.HashSet();
        try {
            String v4_2 = new java.io.File("/sdcard/DCIM/.thumbnails").getCanonicalFile();
            String v5_0 = v4_2.list();
        } catch (SecurityException v0) {
            return;
        }
        if (v5_0 == null) {
            String[] v6_0 = new String[0];
            v5_0 = v6_0;
        }
        String[] v6_1 = v4_2.getPath();
        int v7_0 = 0;
        while (v7_0 < v5_0.length) {
            if (v5_0[v7_0].endsWith(".jpg")) {
                int v8_5 = new StringBuilder();
                v8_5.append(v6_1);
                v8_5.append("/");
                v8_5.append(v5_0[v7_0]);
                v13.add(v8_5.toString());
            }
            v7_0++;
        }
        SecurityException v0_8 = new String[] {"thumbnails", "videothumbnails"});
        int v15 = v0_8.length;
        int v11_0 = 0;
        while (v11_0 < v15) {
            int v18 = v11_0;
            String v4_8 = v12.query(v0_8[v11_0], new String[] {"_data"}), 0, 0, 0, 0, 0);
            if ((v4_8 != null) && (v4_8.moveToFirst())) {
                do {
                    v13.remove(v4_8.getString(0));
                } while(v4_8.moveToNext());
            }
            libcore.io.IoUtils.closeQuietly(v4_8);
            v11_0 = (v18 + 1);
        }
        String v4_4 = v13.iterator();
        while (v4_4.hasNext()) {
            try {
                new java.io.File(((String) v4_4.next())).delete();
            } catch (SecurityException v0) {
            }
        }
        android.util.Log.v(com.android.providers.media.MediaProvider.TAG, "/pruneDeadThumbnailFiles... ");
        return;
    }

Method com.android.providers.media.MediaProvider.movePlaylistEntry() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    private int movePlaylistEntry(com.android.providers.media.MediaProvider$DatabaseHelper p23, android.database.sqlite.SQLiteDatabase p24, long p25, int p27, int p28)
    {
        if (p27 != p28) {
            p24.beginTransaction();
            String v17_0 = 0;
            try {
                p23.mNumUpdates = (p23.mNumUpdates + 3);
                String[] v6_0 = new String[1];
                android.database.Cursor v2_4 = new StringBuilder();
                v2_4.append("");
                v2_4.append(p25);
                v6_0[0] = v2_4.toString();
                android.database.Cursor v2_7 = new StringBuilder();
                v2_7.append(p27);
                v2_7.append(",1");
                String v10_1 = p24.query("audio_playlists_map", new String[] {"play_order"}), "playlist_id=?", v6_0, 0, 0, "play_order", v2_7.toString());
                try {
                    v10_1.moveToFirst();
                    String v9_3 = v10_1.getInt(0);
                    libcore.io.IoUtils.closeQuietly(v10_1);
                    String[] v6_1 = new String[1];
                    android.database.Cursor v2_13 = new StringBuilder();
                    v2_13.append("");
                    v2_13.append(p25);
                    v6_1[0] = v2_13.toString();
                    android.database.Cursor v2_16 = new StringBuilder();
                    v2_16.append(p28);
                    v2_16.append(",1");
                    int v21 = v9_3;
                    v17_0 = v10_1;
                    String v10_2 = v2_16.toString();
                } catch (android.net.Uri v0_0) {
                    android.database.Cursor v2_18 = v10_2;
                    p24.endTransaction();
                    libcore.io.IoUtils.closeQuietly(v2_18);
                    throw v0_0;
                }
                v2_18 = p24.query("audio_playlists_map", new String[] {"play_order"}), "playlist_id=?", v6_1, 0, 0, "play_order", v10_2);
                try {
                    android.content.ContentResolver v3_5;
                    v2_18.moveToFirst();
                    android.net.Uri v0_6 = v2_18.getInt(0);
                    android.content.ContentResolver v3_19 = new StringBuilder();
                    v3_19.append("UPDATE audio_playlists_map SET play_order=-1 WHERE play_order=");
                    int v4_4 = v21;
                    v3_19.append(v4_4);
                    v3_19.append(" AND playlist_id=");
                    v3_19.append(p25);
                    p24.execSQL(v3_19.toString());
                } catch (android.net.Uri v0_0) {
                }
                if (p27 >= p28) {
                    android.content.ContentResolver v3_2 = new StringBuilder();
                    v3_2.append("UPDATE audio_playlists_map SET play_order=play_order+1 WHERE play_order>=");
                    v3_2.append(v0_6);
                    v3_2.append(" AND play_order<");
                    v3_2.append(v4_4);
                    v3_2.append(" AND playlist_id=");
                    v3_2.append(p25);
                    p24.execSQL(v3_2.toString());
                    v3_5 = ((p27 - p28) + 1);
                } else {
                    android.content.ContentResolver v3_7 = new StringBuilder();
                    v3_7.append("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE play_order<=");
                    v3_7.append(v0_6);
                    v3_7.append(" AND play_order>");
                    v3_7.append(v4_4);
                    v3_7.append(" AND playlist_id=");
                    v3_7.append(p25);
                    p24.execSQL(v3_7.toString());
                    v3_5 = ((p28 - p27) + 1);
                }
                int v16 = v3_5;
                android.content.ContentResolver v3_12 = new StringBuilder();
                v3_12.append("UPDATE audio_playlists_map SET play_order=");
                v3_12.append(v0_6);
                v3_12.append(" WHERE play_order=-1 AND playlist_id=");
                v3_12.append(p25);
                p24.execSQL(v3_12.toString());
                p24.setTransactionSuccessful();
                p24.endTransaction();
                libcore.io.IoUtils.closeQuietly(v2_18);
                this.getContext().getContentResolver().notifyChange(android.provider.MediaStore$Audio$Playlists.EXTERNAL_CONTENT_URI.buildUpon().appendEncodedPath(String.valueOf(p25)).build(), 0);
                return v16;
            } catch (android.net.Uri v0_0) {
                v2_18 = v17_0;
            }
        } else {
            return 0;
        }
    }

Method com.android.providers.media.MediaProvider.makePristine() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    private static void makePristine(android.database.sqlite.SQLiteDatabase p11)
    {
        android.database.Cursor v0_1 = p11.query("sqlite_master", new String[] {"name"}), "type is \'trigger\'", 0, 0, 0, 0);
        while (v0_1.moveToNext()) {
            String v1_19 = new StringBuilder();
            v1_19.append("DROP TRIGGER IF EXISTS ");
            v1_19.append(v0_1.getString(0));
            p11.execSQL(v1_19.toString());
        }
        v0_1.close();
        android.database.Cursor v0_2 = p11.query("sqlite_master", new String[] {"name"}), "type is \'view\'", 0, 0, 0, 0);
        while (v0_2.moveToNext()) {
            String v1_16 = new StringBuilder();
            v1_16.append("DROP VIEW IF EXISTS ");
            v1_16.append(v0_2.getString(0));
            p11.execSQL(v1_16.toString());
        }
        v0_2.close();
        android.database.Cursor v0_3 = p11.query("sqlite_master", new String[] {"name"}), "type is \'index\'", 0, 0, 0, 0);
        while (v0_3.moveToNext()) {
            String v1_13 = new StringBuilder();
            v1_13.append("DROP INDEX IF EXISTS ");
            v1_13.append(v0_3.getString(0));
            p11.execSQL(v1_13.toString());
        }
        v0_3.close();
        android.database.Cursor v0_4 = p11.query("sqlite_master", new String[] {"name"}), "type is \'table\'", 0, 0, 0, 0);
        while (v0_4.moveToNext()) {
            String v1_10 = new StringBuilder();
            v1_10.append("DROP TABLE IF EXISTS ");
            v1_10.append(v0_4.getString(0));
            p11.execSQL(v1_10.toString());
        }
        v0_4.close();
        return;
    }

Method com.android.providers.media.MediaProvider.logToDb() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    static void logToDb(android.database.sqlite.SQLiteDatabase p3, String p4)
    {
        String[] v1_1 = new String[1];
        v1_1[0] = p4;
        p3.execSQL("INSERT OR REPLACE INTO log (time,message) VALUES (strftime(\'%Y-%m-%d %H:%M:%f\',\'now\'),?);", v1_1);
        p3.execSQL("DELETE FROM log WHERE rowid IN (SELECT rowid FROM log ORDER BY rowid DESC LIMIT 500,-1);");
        return;
    }

Method com.android.providers.media.MediaProvider.createLatestSchema() calling method android.database.sqlite.SQLiteDatabase.execSQL()


    private static void createLatestSchema(android.database.sqlite.SQLiteDatabase p1, boolean p2)
    {
        com.android.providers.media.MediaProvider.makePristine(p1);
        p1.execSQL("CREATE TABLE android_metadata (locale TEXT)");
        p1.execSQL("CREATE TABLE thumbnails (_id INTEGER PRIMARY KEY,_data TEXT,image_id INTEGER,kind INTEGER,width INTEGER,height INTEGER)");
        p1.execSQL("CREATE TABLE artists (artist_id INTEGER PRIMARY KEY,artist_key TEXT NOT NULL UNIQUE,artist TEXT NOT NULL)");
        p1.execSQL("CREATE TABLE albums (album_id INTEGER PRIMARY KEY,album_key TEXT NOT NULL UNIQUE,album TEXT NOT NULL)");
        p1.execSQL("CREATE TABLE album_art (album_id INTEGER PRIMARY KEY,_data TEXT)");
        p1.execSQL("CREATE TABLE videothumbnails (_id INTEGER PRIMARY KEY,_data TEXT,video_id INTEGER,kind INTEGER,width INTEGER,height INTEGER)");
        p1.execSQL("CREATE TABLE files (_id INTEGER PRIMARY KEY AUTOINCREMENT,_data TEXT UNIQUE COLLATE NOCASE,_size INTEGER,format INTEGER,parent INTEGER,date_added INTEGER,date_modified INTEGER,mime_type TEXT,title TEXT,description TEXT,_display_name TEXT,picasa_id TEXT,orientation INTEGER,latitude DOUBLE,longitude DOUBLE,datetaken INTEGER,mini_thumb_magic INTEGER,bucket_id TEXT,bucket_display_name TEXT,isprivate INTEGER,title_key TEXT,artist_id INTEGER,album_id INTEGER,composer TEXT,track INTEGER,year INTEGER CHECK(year!=0),is_ringtone INTEGER,is_music INTEGER,is_alarm INTEGER,is_notification INTEGER,is_podcast INTEGER,album_artist TEXT,duration INTEGER,bookmark INTEGER,artist TEXT,album TEXT,resolution TEXT,tags TEXT,category TEXT,language TEXT,mini_thumb_data TEXT,name TEXT,media_type INTEGER,old_id INTEGER,is_drm INTEGER,width INTEGER, height INTEGER, title_resource_uri TEXT)");
        p1.execSQL("CREATE TABLE log (time DATETIME, message TEXT)");
        if (!p2) {
            p1.execSQL("CREATE TABLE audio_genres (_id INTEGER PRIMARY KEY,name TEXT NOT NULL)");
            p1.execSQL("CREATE TABLE audio_genres_map (_id INTEGER PRIMARY KEY,audio_id INTEGER NOT NULL,genre_id INTEGER NOT NULL,UNIQUE (audio_id,genre_id) ON CONFLICT IGNORE)");
            p1.execSQL("CREATE TABLE audio_playlists_map (_id INTEGER PRIMARY KEY,audio_id INTEGER NOT NULL,playlist_id INTEGER NOT NULL,play_order INTEGER NOT NULL)");
            p1.execSQL("CREATE TRIGGER audio_genres_cleanup DELETE ON audio_genres BEGIN DELETE FROM audio_genres_map WHERE genre_id = old._id;END");
            p1.execSQL("CREATE TRIGGER audio_playlists_cleanup DELETE ON files WHEN old.media_type=4 BEGIN DELETE FROM audio_playlists_map WHERE playlist_id = old._id;SELECT _DELETE_FILE(old._data);END");
            p1.execSQL("CREATE TRIGGER files_cleanup DELETE ON files BEGIN SELECT _OBJECT_REMOVED(old._id);END");
            p1.execSQL("CREATE VIEW audio_playlists AS SELECT _id,_data,name,date_added,date_modified FROM files WHERE media_type=4");
        }
        p1.execSQL("CREATE INDEX image_id_index on thumbnails(image_id)");
        p1.execSQL("CREATE INDEX album_idx on albums(album)");
        p1.execSQL("CREATE INDEX albumkey_index on albums(album_key)");
        p1.execSQL("CREATE INDEX artist_idx on artists(artist)");
        p1.execSQL("CREATE INDEX artistkey_index on artists(artist_key)");
        p1.execSQL("CREATE INDEX video_id_index on videothumbnails(video_id)");
        p1.execSQL("CREATE INDEX album_id_idx ON files(album_id)");
        p1.execSQL("CREATE INDEX artist_id_idx ON files(artist_id)");
        p1.execSQL("CREATE INDEX bucket_index on files(bucket_id,media_type,datetaken, _id)");
        p1.execSQL("CREATE INDEX bucket_name on files(bucket_id,media_type,bucket_display_name)");
        p1.execSQL("CREATE INDEX format_index ON files(format)");
        p1.execSQL("CREATE INDEX media_type_index ON files(media_type)");
        p1.execSQL("CREATE INDEX parent_index ON files(parent)");
        p1.execSQL("CREATE INDEX path_index ON files(_data)");
        p1.execSQL("CREATE INDEX sort_index ON files(datetaken ASC, _id ASC)");
        p1.execSQL("CREATE INDEX title_idx ON files(title)");
        p1.execSQL("CREATE INDEX titlekey_index ON files(title_key)");
        p1.execSQL("CREATE VIEW audio_meta AS SELECT _id,_data,_display_name,_size,mime_type,date_added,is_drm,date_modified,title,title_key,duration,artist_id,composer,album_id,track,year,is_ringtone,is_music,is_alarm,is_notification,is_podcast,bookmark,album_artist FROM files WHERE media_type=2");
        p1.execSQL("CREATE VIEW artists_albums_map AS SELECT DISTINCT artist_id, album_id FROM audio_meta");
        p1.execSQL("CREATE VIEW audio as SELECT * FROM audio_meta LEFT OUTER JOIN artists ON audio_meta.artist_id=artists.artist_id LEFT OUTER JOIN albums ON audio_meta.album_id=albums.album_id");
        p1.execSQL("CREATE VIEW album_info AS SELECT audio.album_id AS _id, album, album_key, MIN(year) AS minyear, MAX(year) AS maxyear, artist, artist_id, artist_key, count(*) AS numsongs,album_art._data AS album_art FROM audio LEFT OUTER JOIN album_art ON audio.album_id=album_art.album_id WHERE is_music=1 GROUP BY audio.album_id");
        p1.execSQL("CREATE VIEW searchhelpertitle AS SELECT * FROM audio ORDER BY title_key");
        p1.execSQL("CREATE VIEW artist_info AS SELECT artist_id AS _id, artist, artist_key, COUNT(DISTINCT album_key) AS number_of_albums, COUNT(*) AS number_of_tracks FROM audio WHERE is_music=1 GROUP BY artist_key");
        p1.execSQL("CREATE VIEW search AS SELECT _id,\'artist\' AS mime_type,artist,NULL AS album,NULL AS title,artist AS text1,NULL AS text2,number_of_albums AS data1,number_of_tracks AS data2,artist_key AS match,\'content://media/external/audio/artists/\'||_id AS suggest_intent_data,1 AS grouporder FROM artist_info WHERE (artist!=\'<unknown>\') UNION ALL SELECT _id,\'album\' AS mime_type,artist,album,NULL AS title,album AS text1,artist AS text2,NULL AS data1,NULL AS data2,artist_key||\' \'||album_key AS match,\'content://media/external/audio/albums/\'||_id AS suggest_intent_data,2 AS grouporder FROM album_info WHERE (album!=\'<unknown>\') UNION ALL SELECT searchhelpertitle._id AS _id,mime_type,artist,album,title,title AS text1,artist AS text2,NULL AS data1,NULL AS data2,artist_key||\' \'||album_key||\' \'||title_key AS match,\'content://media/external/audio/media/\'||searchhelpertitle._id AS suggest_intent_data,3 AS grouporder FROM searchhelpertitle WHERE (title != \'\')");
        p1.execSQL("CREATE VIEW audio_genres_map_noid AS SELECT audio_id,genre_id FROM audio_genres_map");
        p1.execSQL("CREATE VIEW images AS SELECT _id,_data,_size,_display_name,mime_type,title,date_added,date_modified,description,picasa_id,isprivate,latitude,longitude,datetaken,orientation,mini_thumb_magic,bucket_id,bucket_display_name,width,height FROM files WHERE media_type=1");
        p1.execSQL("CREATE VIEW video AS SELECT _id,_data,_display_name,_size,mime_type,date_added,date_modified,title,duration,artist,album,resolution,description,isprivate,tags,category,language,mini_thumb_data,latitude,longitude,datetaken,mini_thumb_magic,bucket_id,bucket_display_name,bookmark,width,height FROM files WHERE media_type=3");
        p1.execSQL("CREATE TRIGGER albumart_cleanup1 DELETE ON albums BEGIN DELETE FROM album_art WHERE album_id = old.album_id;END");
        p1.execSQL("CREATE TRIGGER albumart_cleanup2 DELETE ON album_art BEGIN SELECT _DELETE_FILE(old._data);END");
        return;
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.delete()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        android.database.sqlite.SQLiteDatabase v13_0;
                        String v14_0;
                        android.database.sqlite.SQLiteDatabase v9_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.delete()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        android.database.sqlite.SQLiteDatabase v13_0;
                        android.database.sqlite.SQLiteDatabase v9_0;
                        String v14_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.delete()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        String v14_0;
                        android.database.sqlite.SQLiteDatabase v9_0;
                        android.database.sqlite.SQLiteDatabase v13_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.delete()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        String v14_0;
                        android.database.sqlite.SQLiteDatabase v9_0;
                        android.database.sqlite.SQLiteDatabase v13_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.delete()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        android.database.sqlite.SQLiteDatabase v9_0;
                        android.database.sqlite.SQLiteDatabase v13_0;
                        String v14_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.delete()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        String v14_0;
                        android.database.sqlite.SQLiteDatabase v13_0;
                        android.database.sqlite.SQLiteDatabase v9_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.setObjectReferences() calling method android.database.sqlite.SQLiteDatabase.delete()


    private int setObjectReferences(com.android.providers.media.MediaProvider$DatabaseHelper p32, android.database.sqlite.SQLiteDatabase p33, int p34, android.content.ContentValues[] p35)
    {
        long v12 = 0;
        p32.mNumQueries = (p32.mNumQueries + 1);
        int v6_1 = new String[1];
        v6_1[0] = Integer.toString(p34);
        int v2_2 = p33.query("files", com.android.providers.media.MediaProvider.sMediaTableColumns, "_id=?", v6_1, 0, 0, 0);
        try {
            if ((v2_2 != 0) && (v2_2.moveToNext())) {
                if (v2_2.getInt(1) == 4) {
                    v12 = v2_2.getLong(0);
                } else {
                    libcore.io.IoUtils.closeQuietly(v2_2);
                    return 0;
                }
            }
        } catch (int v0_11) {
            libcore.io.IoUtils.closeQuietly(v2_2);
            throw v0_11;
        }
        libcore.io.IoUtils.closeQuietly(v2_2);
        if (v12 != 0) {
            p32.mNumDeletes = (p32.mNumDeletes + 1);
            String[] v4_0 = new String[1];
            v4_0[0] = Long.toString(v12);
            p33.delete("audio_playlists_map", "playlist_id=?", v4_0);
            int v9_1 = p35.length;
            android.content.ContentValues[] v8_1 = new android.content.ContentValues[v9_1];
            int v7_2 = 0;
            int v0_7 = 0;
            while(true) {
                int v6_6 = v0_7;
                if (v6_6 >= v9_1) {
                    break;
                }
                int v6_2;
                long v3_0;
                android.content.ContentValues[] v5_2;
                String[] v4_1 = p35[v6_6].getAsLong("_id").longValue();
                p32.mNumQueries = (p32.mNumQueries + 1);
                int v2_5 = new String[1];
                v2_5[0] = Long.toString(v4_1);
                int v21_0 = v6_6;
                int v28 = v7_2;
                android.content.ContentValues[] v29 = v8_1;
                int v30_0 = v9_1;
                int v2_0 = p33.query("files", com.android.providers.media.MediaProvider.sMediaTableColumns, "_id=?", v2_5, 0, 0, 0);
                try {
                    if ((v2_0 == 0) || (!v2_0.moveToNext())) {
                        v3_0 = 0;
                        libcore.io.IoUtils.closeQuietly(v2_0);
                        if (v3_0 == 0) {
                            v6_2 = v28;
                            v5_2 = v29;
                            v7_2 = v6_2;
                        } else {
                            int v0_6 = new android.content.ContentValues();
                            v0_6.put("playlist_id", Long.valueOf(v12));
                            v0_6.put("audio_id", Long.valueOf(v3_0));
                            int v6_5 = v28;
                            v0_6.put("play_order", Integer.valueOf(v6_5));
                            v7_2 = (v6_5 + 1);
                            v5_2 = v29;
                            v5_2[v6_5] = v0_6;
                        }
                    } else {
                        if (v2_0.getInt(1) == 2) {
                            v3_0 = v2_0.getLong(0);
                        } else {
                            libcore.io.IoUtils.closeQuietly(v2_0);
                            v6_2 = v28;
                            v5_2 = v29;
                        }
                    }
                    v0_7 = (v21_0 + 1);
                    v8_1 = v5_2;
                    v9_1 = v30_0;
                } catch (int v0_2) {
                    libcore.io.IoUtils.closeQuietly(v2_0);
                    throw v0_2;
                }
            }
            int v6_7 = v7_2;
            android.content.ContentValues[] v5_7 = v8_1;
            if (v6_7 < v9_1) {
                int v0_19 = new android.content.ContentValues[v6_7];
                System.arraycopy(v5_7, 0, v0_19, 0, v6_7);
                v5_7 = v0_19;
            }
            return this.playlistBulkInsert(p33, android.provider.MediaStore$Audio$Playlists$Members.getContentUri("external", v12), v5_7);
        } else {
            return 0;
        }
    }

Method com.android.providers.media.MediaProvider.fixParentIdIfNeeded() calling method android.database.sqlite.SQLiteDatabase.delete()


    private void fixParentIdIfNeeded()
    {
        com.android.providers.media.MediaProvider$DatabaseHelper v2 = this.getDatabaseForUri(android.net.Uri.parse("content://media/external/file"));
        if (v2 != null) {
            android.database.sqlite.SQLiteDatabase v12 = v2.getWritableDatabase();
            int v11_0 = 0;
            long v14 = -1;
            int v10_0 = 0;
            String v0_9 = 1;
            while(true) {
                android.net.Uri v3_9;
                int v16 = v0_9;
                String v0_11 = new StringBuilder();
                v0_11.append("parent != 0 AND parent NOT IN (SELECT _id FROM files)");
                if (v14 >= 0) {
                    android.net.Uri v3_8 = new StringBuilder();
                    v3_8.append(" AND _id > ");
                    v3_8.append(v14);
                    v3_9 = v3_8.toString();
                } else {
                    v3_9 = "";
                }
                v0_11.append(v3_9);
                int v18 = v10_0;
                int v13_4 = v11_0;
                android.net.Uri v3_11 = v12.query("files", com.android.providers.media.MediaProvider.sDataId, v0_11.toString(), 0, 0, 0, "_id ASC", "500");
                if (v3_11 != null) {
                    try {
                        if (v3_11.getCount() != 0) {
                            v11_0 = (v13_4 + v3_11.getCount());
                            if (v16 != 0) {
                                try {
                                } catch (String v0_5) {
                                    libcore.io.IoUtils.closeQuietly(v3_11);
                                    throw v0_5;
                                }
                                this.mDirectoryCache.clear();
                                v16 = 0;
                            }
                            v10_0 = v18;
                            try {
                                while (v3_11.moveToNext()) {
                                    String v4_9 = v3_11.getString(0);
                                    v14 = v3_11.getLong(1);
                                    if (!new java.io.File(v4_9).exists()) {
                                        String v5_10 = new StringBuilder();
                                        v5_10.append("_id=");
                                        v5_10.append(v14);
                                        v12.delete("files", v5_10.toString(), 0);
                                    } else {
                                        int v7_4 = this.getParent(v2, v12, v4_9);
                                        android.content.ContentValues v9_2 = new android.content.ContentValues();
                                        v9_2.put("parent", Long.valueOf(v7_4));
                                        int v13_2 = new StringBuilder();
                                        v13_2.append("_id=");
                                        v13_2.append(v14);
                                        String v0_4 = v12.update("files", v9_2, v13_2.toString(), 0);
                                        v2.mNumUpdates = (v2.mNumUpdates + v0_4);
                                        v10_0 += v0_4;
                                    }
                                }
                            } catch (String v0_5) {
                            }
                        } else {
                            String v5_5;
                            libcore.io.IoUtils.closeQuietly(v3_11);
                            if (v13_4 <= 0) {
                                v5_5 = v18;
                            } else {
                                android.net.Uri v3_1 = new StringBuilder();
                                v3_1.append("fixParentIdIfNeeded: found: ");
                                v3_1.append(v13_4);
                                v3_1.append(", fixed: ");
                                v5_5 = v18;
                                v3_1.append(v5_5);
                                android.util.Log.d(com.android.providers.media.MediaProvider.TAG, v3_1.toString());
                            }
                            if (v5_5 > null) {
                                this.getContext().getContentResolver().notifyChange(android.net.Uri.parse("content://media/"), 0);
                            }
                            return;
                        }
                    } catch (String v0_5) {
                    }
                }
            }
            libcore.io.IoUtils.closeQuietly(v3_11);
            v0_9 = v16;
        } else {
            return;
        }
    }

Method com.android.providers.media.MediaProvider.update() calling method android.database.sqlite.SQLiteDatabase.query()


    public int update(android.net.Uri p44, android.content.ContentValues p45, String p46, String[] p47)
    {
        int v14_0 = this;
        String v12_3 = this.safeUncanonicalize(p44);
        int v11_6 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v12_3);
        android.content.ContentValues v10_4 = this.getDatabaseForUri(v12_3);
        if (v10_4 == null) {
            String v4_0 = v12_3;
            void v9 = this;
            String v15 = v11_6;
            long v1_4 = new StringBuilder();
            v1_4.append("Unknown URI: ");
            v1_4.append(v4_0);
            throw new UnsupportedOperationException(v1_4.toString());
        } else {
            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
            String v8_2 = v10_4.getWritableDatabase();
            Throwable v0_27 = 0;
            if (p45 != null) {
                v0_27 = p45.getAsString("genre");
                p45.remove("genre");
            }
            String v22_1;
            int v23;
            String v7_8;
            String v8_5;
            String v7_5 = v0_27;
            android.content.ContentValues v5_7 = this.getTableAndWhere(v12_3, v11_6, p46);
            if (!p45.containsKey("media_type")) {
                v22_1 = v5_7;
                v23 = v7_5;
                v7_8 = v8_2;
                v8_5 = 0;
            } else {
                String v16_6 = p45.getAsLong("media_type").longValue();
                v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                v22_1 = v5_7;
                v23 = v7_5;
                android.content.ContentResolver v24_1 = v8_2;
                Throwable v0_85 = v8_2.query(v5_7.table, com.android.providers.media.MediaProvider.sMediaTableColumns, v5_7.where, p47, 0, 0, 0);
                while(true) {
                    long v1_45 = v0_85;
                    if ((v1_45 == 0) || (!v1_45.moveToNext())) {
                        break;
                    }
                    String v7_16;
                    String v2_31 = v1_45.getLong(1);
                    try {
                        if ((v2_31 != 1) || (v16_6 == 1)) {
                            v7_16 = v24_1;
                            if ((v2_31 == 3) && (v16_6 != 3)) {
                                String v4_30 = new StringBuilder();
                                v4_30.append("need to remove video thumbnail for id ");
                                v4_30.append(v1_45.getString(0));
                                android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_30.toString());
                                v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                            }
                        } else {
                            String v4_34 = new StringBuilder();
                            v4_34.append("need to remove image thumbnail for id ");
                            v4_34.append(v1_45.getString(0));
                            android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_34.toString());
                            v7_16 = v24_1;
                            v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                        }
                        v0_85 = v1_45;
                        v24_1 = v7_16;
                    } catch (Throwable v0_109) {
                        libcore.io.IoUtils.closeQuietly(v1_45);
                        throw v0_109;
                    }
                }
                v7_8 = v24_1;
                v8_5 = 0;
                libcore.io.IoUtils.closeQuietly(v1_45);
            }
            if ((v11_6 != 702) && ((v11_6 != 703) && (v11_6 != 706))) {
                long v1_0 = 5;
                String v17_0 = 1;
                void v9_0 = v22_1;
                String v8_0 = v7_8;
                String v7_0 = 3;
            } else {
                if ((p45 == null) || (((p45.size() != 1) || (!p45.containsKey("_data"))) && ((p45.size() != 2) || ((!p45.containsKey("_data")) || (!p45.containsKey("parent")))))) {
                    v1_0 = 5;
                    v17_0 = 1;
                    v9_0 = v22_1;
                    v8_0 = v7_8;
                    v7_0 = 3;
                } else {
                    String v16_0 = 0;
                    String v2_0 = p45.getAsString("_data");
                    v14_0.mDirectoryCache.remove(v2_0);
                    long v1_1 = new java.io.File(v2_0);
                    if ((v2_0 == null) || (!v1_1.isDirectory())) {
                        v17_0 = 1;
                        v9_0 = v22_1;
                        v8_0 = v7_8;
                        v7_0 = 3;
                        String v6 = v1_1;
                        v1_0 = 5;
                        android.content.ContentValues v5_0 = v2_0;
                        if (v5_0.toLowerCase(java.util.Locale.US).endsWith("/.nomedia")) {
                            v14_0 = v14_0.processNewNoMediaPath(v10_4, v8_0, v5_0);
                        }
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                        v9_0 = v22_1;
                        java.util.HashMap v26 = v1_1;
                        boolean v27 = v2_0;
                        long v28 = v7_8;
                        Throwable v0_17 = v8_5;
                        long v1_5 = v7_8.query(v9_0.table, com.android.providers.media.MediaProvider.PATH_PROJECTION, p46, p47, 0, 0, 0);
                        try {
                            if ((v1_5 != 0) && (v1_5.moveToNext())) {
                                v16_0 = v1_5.getString(1);
                            }
                        } catch (Throwable v0_18) {
                            libcore.io.IoUtils.closeQuietly(v1_5);
                            throw v0_18;
                        }
                        String v2_7 = v16_0;
                        libcore.io.IoUtils.closeQuietly(v1_5);
                        if (v2_7 == null) {
                            android.content.ContentValues v5 = v27;
                            v8_0 = v28;
                            v1_0 = 5;
                            v7_0 = 3;
                            v17_0 = 1;
                        } else {
                            android.content.ContentValues v5_19;
                            String v6_14;
                            v14_0.mDirectoryCache.remove(v2_7);
                            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                            String v8_11 = v28;
                            String v3_38 = v8_11.update(v9_0.table, p45, v9_0.where, p47);
                            if (v3_38 <= null) {
                                v6_14 = v26;
                                v5_19 = v27;
                            } else {
                                String v4_21 = new Object[6];
                                v5_19 = v27;
                                v4_21[v0_17] = v5_19;
                                v4_21[1] = Integer.valueOf((v2_7.length() + 1));
                                Throwable v0_90 = new StringBuilder();
                                v0_90.append(v2_7);
                                v0_90.append("/");
                                v4_21[2] = v0_90.toString();
                                Throwable v0_93 = new StringBuilder();
                                v0_93.append(v2_7);
                                v0_93.append("0");
                                v4_21[3] = v0_93.toString();
                                v6_14 = v26;
                                v4_21[4] = v6_14.getName();
                                v4_21[5] = Integer.valueOf(v6_14.toString().toLowerCase().hashCode());
                                Throwable v0_101 = v4_21;
                                v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                                v8_11.execSQL("UPDATE files SET _data=?1||SUBSTR(_data, ?2),bucket_display_name=?5,bucket_id=?6 WHERE _data >= ?3 AND _data < ?4;", v0_101);
                            }
                            if ((v3_38 > null) && (!v8_11.inTransaction())) {
                                this.getContext().getContentResolver().notifyChange(v12_3, 0);
                            }
                            if (v6_14.getName().startsWith(".")) {
                                v14_0.processNewNoMediaPath(v10_4, v8_11, v5_19);
                            }
                            return v3_38;
                        }
                    }
                }
            }
            int v13_1;
            int v11_0;
            String v42;
            String v12_0;
            Throwable v0_64;
            switch (v11_6) {
                case 1:
                case 2:
                case 200:
                case 201:
                    int v11_5 = v17_0;
                    v13_1 = v8_0;
                    String v8_8 = v12_3;
                    String v12_6 = v9_0;
                    void v9_6 = v14_0;
                    android.content.ContentValues v5_14 = new android.content.ContentValues(p45);
                    v5_14.remove("bucket_id");
                    v5_14.remove("bucket_display_name");
                    String v4_13 = v5_14.getAsString("_data");
                    if (v4_13 != null) {
                        com.android.providers.media.MediaProvider.computeBucketValues(v4_13, v5_14);
                    }
                    com.android.providers.media.MediaProvider.computeTakenTime(v5_14);
                    v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_5);
                    String v16_7 = v13_1.update(v12_6.table, v5_14, v12_6.where, p47);
                    if ((v16_7 <= null) || (v5_14.getAsString("_data") == null)) {
                        v42 = v8_8;
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + v11_5);
                        v42 = v8_8;
                        String v7_11 = v13_1.query(v12_6.table, com.android.providers.media.MediaProvider.READY_FLAG_PROJECTION, v12_6.where, p47, 0, 0, 0);
                        if (v7_11 == null) {
                            v0_64 = v16_7;
                            String v3 = p47;
                        }
                        try {
                            while (v7_11.moveToNext()) {
                                if (v7_11.getLong(2) == 0) {
                                    v9_6.requestMediaThumbnail(v7_11.getString(v11_5), v42, 10, 0);
                                }
                            }
                        } catch (Throwable v0_81) {
                            libcore.io.IoUtils.closeQuietly(v7_11);
                            throw v0_81;
                        }
                        libcore.io.IoUtils.closeQuietly(v7_11);
                    }
                case 100:
                case 101:
                    long v34;
                    int v35;
                    int v25;
                    int v36;
                    int v13_2;
                    int v31;
                    String v37;
                    int v32;
                    android.content.ContentValues v38;
                    String v6_3 = new android.content.ContentValues(p45);
                    android.content.ContentValues v5_3 = v6_3.getAsString("album_artist");
                    String v3_6 = v6_3.getAsString("compilation");
                    v6_3.remove("compilation");
                    String v2_16 = v6_3.getAsString("artist");
                    v6_3.remove("artist");
                    if (v2_16 == null) {
                        v25 = v2_16;
                        v31 = v3_6;
                        v32 = v5_3;
                        v34 = v8_0;
                        v35 = v9_0;
                        v36 = v10_4;
                        v37 = v11_6;
                        v38 = v12_3;
                        v13_2 = v6_3;
                    } else {
                        long v1_20 = v10_4.mArtistCache;
                        try {
                            String v33;
                            long v1_21;
                            Throwable v0_25 = ((Long) v1_20.get(v2_16));
                        } catch (Throwable v0_26) {
                            v25 = v2_16;
                            v32 = v5_3;
                            v35 = v9_0;
                            v37 = v11_6;
                            v15 = p47;
                        }
                        if (v0_25 != null) {
                            v25 = v2_16;
                            v31 = v3_6;
                            v32 = v5_3;
                            v33 = v6_3;
                            v34 = v8_0;
                            v35 = v9_0;
                            v36 = v10_4;
                            v37 = v11_6;
                            v38 = v12_3;
                            try {
                                v1_21 = v0_25.longValue();
                            } catch (Throwable v0_26) {
                            }
                        } else {
                            try {
                                v25 = v2_16;
                                String v2_17 = v10_4;
                                v31 = v3_6;
                                v32 = v5_3;
                                v33 = v6_3;
                                v34 = v8_0;
                                v35 = v9_0;
                                v36 = v10_4;
                                v37 = v11_6;
                                v38 = v12_3;
                                int v13_3 = v38;
                                try {
                                    v1_21 = v14_0.getKeyIdForName(v2_17, v8_0, "artists", "artist_key", "artist", v25, v25, 0, 0, 0, v1_20, v13_3);
                                } catch (Throwable v0_26) {
                                }
                            } catch (Throwable v0_26) {
                                v25 = v2_17;
                                v32 = "artist_key";
                                v35 = 0;
                                v37 = 0;
                                v15 = v13_3;
                            }
                        }
                        v13_2 = v33;
                        v13_2.put("artist_id", Integer.toString(((int) v1_21)));
                    }
                    int v14_1;
                    String v40;
                    String v41;
                    String v39;
                    String v12_2 = v13_2.getAsString("album");
                    v13_2.remove("album");
                    if (v12_2 == null) {
                        v14_1 = v13_2;
                        int v21 = v32;
                        v39 = v36;
                        v41 = v37;
                        v40 = v38;
                    } else {
                        String v16_5;
                        android.content.ContentValues v5_5;
                        void v9_3;
                        String v7_6 = v13_2.getAsString("_data");
                        String v8_4 = 0;
                        int v11_2 = v32;
                        if (v11_2 == 0) {
                            android.content.ContentValues v10_1 = v31;
                            if ((v10_1 == null) || (!v10_1.equals("1"))) {
                                if (v7_6 != null) {
                                    v9_3 = v37;
                                    v5_5 = v38;
                                } else {
                                    v9_3 = v37;
                                    if (v9_3 != 100) {
                                        long v1_26 = v14_0.query(v38, new String[] {"_data"}), 0, 0, 0);
                                        if (v1_26 == 0) {
                                            v5_5 = v38;
                                        } else {
                                            try {
                                                Throwable v0_36 = v1_26.getCount();
                                            } catch (Throwable v0_38) {
                                                libcore.io.IoUtils.closeQuietly(v1_26);
                                                throw v0_38;
                                            }
                                            if (v0_36 != 1) {
                                                String v3_12 = new StringBuilder();
                                                v3_12.append("");
                                                v3_12.append(v0_36);
                                                v3_12.append(" rows for ");
                                                v5_5 = v38;
                                                try {
                                                    v3_12.append(v5_5);
                                                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v3_12.toString());
                                                } catch (Throwable v0_38) {
                                                }
                                            } else {
                                                try {
                                                    v1_26.moveToFirst();
                                                    v7_6 = v1_26.getString(0);
                                                    v5_5 = v38;
                                                } catch (Throwable v0_38) {
                                                }
                                            }
                                            libcore.io.IoUtils.closeQuietly(v1_26);
                                        }
                                    } else {
                                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Possible multi row album name update without path could give wrong album key");
                                        v5_5 = v38;
                                    }
                                }
                                if (v7_6 != null) {
                                    v8_4 = v7_6.substring(0, v7_6.lastIndexOf(47)).hashCode();
                                }
                                v16_5 = v7_6;
                            } else {
                                v16_5 = v7_6;
                                v9_3 = v37;
                                v5_5 = v38;
                            }
                        } else {
                            v8_4 = v11_2.hashCode();
                            v16_5 = v7_6;
                        }
                        String v7_7 = v12_2.toString();
                        String v4_9 = v36;
                        String v3_15 = v4_9.mAlbumCache;
                        try {
                            long v1_31;
                            Throwable v0_47 = new StringBuilder();
                            v0_47.append(v7_7);
                            v0_47.append(v8_4);
                            Throwable v0_48 = v0_47.toString();
                            String v2_23 = ((Long) v3_15.get(v0_48));
                        } catch (Throwable v0_49) {
                            v39 = v4_9;
                            String v17 = v7_7;
                            v41 = v9_3;
                            v21 = v11_2;
                            int v14 = v13_2;
                            throw v0_49;
                        } catch (Throwable v0_49) {
                        }
                        if (v2_23 != null) {
                            v39 = v4_9;
                            v40 = v5_5;
                            Throwable v18 = v8_4;
                            v41 = v9_3;
                            v21 = v11_2;
                            v14_1 = v13_2;
                            v1_31 = v2_23.longValue();
                        } else {
                            v39 = v4_9;
                            v40 = v5_5;
                            v41 = v9_3;
                            v14_1 = v13_2;
                            v1_31 = v14_0.getKeyIdForName(v4_9, v34, "albums", "album_key", "album", v7_7, v0_48, v16_5, v8_4, v25, v3_15, v40);
                        }
                        v14_1.put("album_id", Integer.toString(((int) v1_31)));
                    }
                    void v9_5;
                    String v2_26;
                    v14_1.remove("title_key");
                    long v1_33 = v14_1.getAsString("title");
                    if (v1_33 == 0) {
                        v2_26 = v14_1;
                        v9_5 = this;
                    } else {
                        v2_26 = v14_1;
                        v9_5 = this;
                        try {
                            Throwable v0_56 = this.getLocalizedTitle(v1_33);
                        } catch (Throwable v0) {
                            v2_26.put("title_resource_uri", v1_33);
                            v2_26.put("title_key", android.provider.MediaStore$Audio.keyFor(v1_33));
                            v2_26.put("title", v1_33.trim());
                        }
                        if (v0_56 == null) {
                            v2_26.putNull("title_resource_uri");
                        } else {
                            v2_26.put("title_resource_uri", v1_33);
                            v1_33 = v0_56;
                        }
                    }
                    String v8_7;
                    android.content.ContentValues v10_3 = v39;
                    v10_3.mNumUpdates = (v10_3.mNumUpdates + 1);
                    String v12_5 = v35;
                    v13_1 = v34;
                    v0_64 = v13_1.update(v12_5.table, v2_26, v12_5.where, p47);
                    int v14_2 = v23;
                    if (v14_2 == 0) {
                        v8_7 = v40;
                    } else {
                        String v15_2;
                        if (v0_64 != 1) {
                            v8_7 = v40;
                            v15_2 = v41;
                        } else {
                            v15_2 = v41;
                            if (v15_2 != 101) {
                                v8_7 = v40;
                            } else {
                                v8_7 = v40;
                                v9_5.updateGenre(Long.parseLong(((String) v8_7.getPathSegments().get(3))), v14_2);
                                v42 = v8_7;
                            }
                        }
                        android.content.ContentValues v5_10 = new StringBuilder();
                        v5_10.append("ignoring genre in update: count = ");
                        v5_10.append(v0_64);
                        v5_10.append(" match = ");
                        v5_10.append(v15_2);
                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v5_10.toString());
                    }
                    break;
                case 113:
                    if (v12_3.getQueryParameter("move") == null) {
                        v13_1 = v8_0;
                        v42 = v12_3;
                        v11_0 = v17_0;
                        v12_0 = v9_0;
                        v14 = v23;
                        v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_0);
                        v0_64 = v13_1.update(v12_0.table, p45, v12_0.where, p47);
                    } else {
                        if (!p45.containsKey("play_order")) {
                            String v2_10 = new StringBuilder();
                            v2_10.append("Need to specify ");
                            v2_10.append("play_order");
                            v2_10.append(" when using \'move\' parameter");
                            throw new IllegalArgumentException(v2_10.toString());
                        } else {
                            String v16_1 = p45.getAsInteger("play_order").intValue();
                            String v4_2 = v12_3.getPathSegments();
                            v0 = "play_order";
                            return v14_0.movePlaylistEntry(v10_4, v8_0, Long.parseLong(((String) v4_2.get(v7_0))), Integer.parseInt(((String) v4_2.get(v1_0))), v16_1);
                        }
                    }
                default:
                    v13_1 = v8_0;
                    v42 = v12_3;
                    v11_0 = v17_0;
                    v12_0 = v9_0;
                    v14 = v23;
            }
            if ((v0_64 > null) && (!v13_1.inTransaction())) {
                this.getContext().getContentResolver().notifyChange(v42, 0);
            }
            return v0_64;
        }
    }

Method com.android.providers.media.MediaProvider.update() calling method android.database.sqlite.SQLiteDatabase.query()


    public int update(android.net.Uri p44, android.content.ContentValues p45, String p46, String[] p47)
    {
        int v14_0 = this;
        String v12_3 = this.safeUncanonicalize(p44);
        int v11_6 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v12_3);
        android.content.ContentValues v10_4 = this.getDatabaseForUri(v12_3);
        if (v10_4 == null) {
            String v4_0 = v12_3;
            void v9 = this;
            String v15 = v11_6;
            long v1_4 = new StringBuilder();
            v1_4.append("Unknown URI: ");
            v1_4.append(v4_0);
            throw new UnsupportedOperationException(v1_4.toString());
        } else {
            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
            String v8_2 = v10_4.getWritableDatabase();
            Throwable v0_27 = 0;
            if (p45 != null) {
                v0_27 = p45.getAsString("genre");
                p45.remove("genre");
            }
            String v7_8;
            int v23;
            String v8_5;
            String v22_1;
            String v7_5 = v0_27;
            android.content.ContentValues v5_7 = this.getTableAndWhere(v12_3, v11_6, p46);
            if (!p45.containsKey("media_type")) {
                v22_1 = v5_7;
                v23 = v7_5;
                v7_8 = v8_2;
                v8_5 = 0;
            } else {
                String v16_6 = p45.getAsLong("media_type").longValue();
                v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                v22_1 = v5_7;
                v23 = v7_5;
                android.content.ContentResolver v24_1 = v8_2;
                Throwable v0_85 = v8_2.query(v5_7.table, com.android.providers.media.MediaProvider.sMediaTableColumns, v5_7.where, p47, 0, 0, 0);
                while(true) {
                    long v1_45 = v0_85;
                    if ((v1_45 == 0) || (!v1_45.moveToNext())) {
                        break;
                    }
                    String v7_16;
                    String v2_31 = v1_45.getLong(1);
                    try {
                        if ((v2_31 != 1) || (v16_6 == 1)) {
                            v7_16 = v24_1;
                            if ((v2_31 == 3) && (v16_6 != 3)) {
                                String v4_30 = new StringBuilder();
                                v4_30.append("need to remove video thumbnail for id ");
                                v4_30.append(v1_45.getString(0));
                                android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_30.toString());
                                v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                            }
                        } else {
                            String v4_34 = new StringBuilder();
                            v4_34.append("need to remove image thumbnail for id ");
                            v4_34.append(v1_45.getString(0));
                            android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_34.toString());
                            v7_16 = v24_1;
                            v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                        }
                        v0_85 = v1_45;
                        v24_1 = v7_16;
                    } catch (Throwable v0_109) {
                        libcore.io.IoUtils.closeQuietly(v1_45);
                        throw v0_109;
                    }
                }
                v7_8 = v24_1;
                v8_5 = 0;
                libcore.io.IoUtils.closeQuietly(v1_45);
            }
            if ((v11_6 != 702) && ((v11_6 != 703) && (v11_6 != 706))) {
                long v1_0 = 5;
                String v17_0 = 1;
                void v9_0 = v22_1;
                String v8_0 = v7_8;
                String v7_0 = 3;
            } else {
                if ((p45 == null) || (((p45.size() != 1) || (!p45.containsKey("_data"))) && ((p45.size() != 2) || ((!p45.containsKey("_data")) || (!p45.containsKey("parent")))))) {
                    v1_0 = 5;
                    v17_0 = 1;
                    v9_0 = v22_1;
                    v8_0 = v7_8;
                    v7_0 = 3;
                } else {
                    String v16_0 = 0;
                    String v2_0 = p45.getAsString("_data");
                    v14_0.mDirectoryCache.remove(v2_0);
                    long v1_1 = new java.io.File(v2_0);
                    if ((v2_0 == null) || (!v1_1.isDirectory())) {
                        v17_0 = 1;
                        v9_0 = v22_1;
                        v8_0 = v7_8;
                        v7_0 = 3;
                        String v6 = v1_1;
                        v1_0 = 5;
                        android.content.ContentValues v5_0 = v2_0;
                        if (v5_0.toLowerCase(java.util.Locale.US).endsWith("/.nomedia")) {
                            v14_0 = v14_0.processNewNoMediaPath(v10_4, v8_0, v5_0);
                        }
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                        v9_0 = v22_1;
                        java.util.HashMap v26 = v1_1;
                        boolean v27 = v2_0;
                        long v28 = v7_8;
                        Throwable v0_17 = v8_5;
                        long v1_5 = v7_8.query(v9_0.table, com.android.providers.media.MediaProvider.PATH_PROJECTION, p46, p47, 0, 0, 0);
                        try {
                            if ((v1_5 != 0) && (v1_5.moveToNext())) {
                                v16_0 = v1_5.getString(1);
                            }
                        } catch (Throwable v0_18) {
                            libcore.io.IoUtils.closeQuietly(v1_5);
                            throw v0_18;
                        }
                        String v2_7 = v16_0;
                        libcore.io.IoUtils.closeQuietly(v1_5);
                        if (v2_7 == null) {
                            android.content.ContentValues v5 = v27;
                            v8_0 = v28;
                            v1_0 = 5;
                            v7_0 = 3;
                            v17_0 = 1;
                        } else {
                            String v6_14;
                            android.content.ContentValues v5_19;
                            v14_0.mDirectoryCache.remove(v2_7);
                            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                            String v8_11 = v28;
                            String v3_38 = v8_11.update(v9_0.table, p45, v9_0.where, p47);
                            if (v3_38 <= null) {
                                v6_14 = v26;
                                v5_19 = v27;
                            } else {
                                String v4_21 = new Object[6];
                                v5_19 = v27;
                                v4_21[v0_17] = v5_19;
                                v4_21[1] = Integer.valueOf((v2_7.length() + 1));
                                Throwable v0_90 = new StringBuilder();
                                v0_90.append(v2_7);
                                v0_90.append("/");
                                v4_21[2] = v0_90.toString();
                                Throwable v0_93 = new StringBuilder();
                                v0_93.append(v2_7);
                                v0_93.append("0");
                                v4_21[3] = v0_93.toString();
                                v6_14 = v26;
                                v4_21[4] = v6_14.getName();
                                v4_21[5] = Integer.valueOf(v6_14.toString().toLowerCase().hashCode());
                                Throwable v0_101 = v4_21;
                                v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                                v8_11.execSQL("UPDATE files SET _data=?1||SUBSTR(_data, ?2),bucket_display_name=?5,bucket_id=?6 WHERE _data >= ?3 AND _data < ?4;", v0_101);
                            }
                            if ((v3_38 > null) && (!v8_11.inTransaction())) {
                                this.getContext().getContentResolver().notifyChange(v12_3, 0);
                            }
                            if (v6_14.getName().startsWith(".")) {
                                v14_0.processNewNoMediaPath(v10_4, v8_11, v5_19);
                            }
                            return v3_38;
                        }
                    }
                }
            }
            int v11_0;
            int v13_1;
            String v42;
            Throwable v0_64;
            String v12_0;
            switch (v11_6) {
                case 1:
                case 2:
                case 200:
                case 201:
                    int v11_5 = v17_0;
                    v13_1 = v8_0;
                    String v8_8 = v12_3;
                    String v12_6 = v9_0;
                    void v9_6 = v14_0;
                    android.content.ContentValues v5_14 = new android.content.ContentValues(p45);
                    v5_14.remove("bucket_id");
                    v5_14.remove("bucket_display_name");
                    String v4_13 = v5_14.getAsString("_data");
                    if (v4_13 != null) {
                        com.android.providers.media.MediaProvider.computeBucketValues(v4_13, v5_14);
                    }
                    com.android.providers.media.MediaProvider.computeTakenTime(v5_14);
                    v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_5);
                    String v16_7 = v13_1.update(v12_6.table, v5_14, v12_6.where, p47);
                    if ((v16_7 <= null) || (v5_14.getAsString("_data") == null)) {
                        v42 = v8_8;
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + v11_5);
                        v42 = v8_8;
                        String v7_11 = v13_1.query(v12_6.table, com.android.providers.media.MediaProvider.READY_FLAG_PROJECTION, v12_6.where, p47, 0, 0, 0);
                        if (v7_11 == null) {
                            v0_64 = v16_7;
                            String v3 = p47;
                        }
                        try {
                            while (v7_11.moveToNext()) {
                                if (v7_11.getLong(2) == 0) {
                                    v9_6.requestMediaThumbnail(v7_11.getString(v11_5), v42, 10, 0);
                                }
                            }
                        } catch (Throwable v0_81) {
                            libcore.io.IoUtils.closeQuietly(v7_11);
                            throw v0_81;
                        }
                        libcore.io.IoUtils.closeQuietly(v7_11);
                    }
                case 100:
                case 101:
                    int v32;
                    android.content.ContentValues v38;
                    int v36;
                    long v34;
                    int v35;
                    int v25;
                    int v13_2;
                    int v31;
                    String v37;
                    String v6_3 = new android.content.ContentValues(p45);
                    android.content.ContentValues v5_3 = v6_3.getAsString("album_artist");
                    String v3_6 = v6_3.getAsString("compilation");
                    v6_3.remove("compilation");
                    String v2_16 = v6_3.getAsString("artist");
                    v6_3.remove("artist");
                    if (v2_16 == null) {
                        v25 = v2_16;
                        v31 = v3_6;
                        v32 = v5_3;
                        v34 = v8_0;
                        v35 = v9_0;
                        v36 = v10_4;
                        v37 = v11_6;
                        v38 = v12_3;
                        v13_2 = v6_3;
                    } else {
                        long v1_20 = v10_4.mArtistCache;
                        try {
                            long v1_21;
                            String v33;
                            Throwable v0_25 = ((Long) v1_20.get(v2_16));
                        } catch (Throwable v0_26) {
                            v25 = v2_16;
                            v32 = v5_3;
                            v35 = v9_0;
                            v37 = v11_6;
                            v15 = p47;
                        }
                        if (v0_25 != null) {
                            v25 = v2_16;
                            v31 = v3_6;
                            v32 = v5_3;
                            v33 = v6_3;
                            v34 = v8_0;
                            v35 = v9_0;
                            v36 = v10_4;
                            v37 = v11_6;
                            v38 = v12_3;
                            try {
                                v1_21 = v0_25.longValue();
                            } catch (Throwable v0_26) {
                            }
                        } else {
                            try {
                                v25 = v2_16;
                                String v2_17 = v10_4;
                                v31 = v3_6;
                                v32 = v5_3;
                                v33 = v6_3;
                                v34 = v8_0;
                                v35 = v9_0;
                                v36 = v10_4;
                                v37 = v11_6;
                                v38 = v12_3;
                                int v13_3 = v38;
                                try {
                                    v1_21 = v14_0.getKeyIdForName(v2_17, v8_0, "artists", "artist_key", "artist", v25, v25, 0, 0, 0, v1_20, v13_3);
                                } catch (Throwable v0_26) {
                                }
                            } catch (Throwable v0_26) {
                                v25 = v2_17;
                                v32 = "artist_key";
                                v35 = 0;
                                v37 = 0;
                                v15 = v13_3;
                            }
                        }
                        v13_2 = v33;
                        v13_2.put("artist_id", Integer.toString(((int) v1_21)));
                    }
                    int v14_1;
                    String v40;
                    String v41;
                    String v39;
                    String v12_2 = v13_2.getAsString("album");
                    v13_2.remove("album");
                    if (v12_2 == null) {
                        v14_1 = v13_2;
                        int v21 = v32;
                        v39 = v36;
                        v41 = v37;
                        v40 = v38;
                    } else {
                        String v16_5;
                        void v9_3;
                        android.content.ContentValues v5_5;
                        String v7_6 = v13_2.getAsString("_data");
                        String v8_4 = 0;
                        int v11_2 = v32;
                        if (v11_2 == 0) {
                            android.content.ContentValues v10_1 = v31;
                            if ((v10_1 == null) || (!v10_1.equals("1"))) {
                                if (v7_6 != null) {
                                    v9_3 = v37;
                                    v5_5 = v38;
                                } else {
                                    v9_3 = v37;
                                    if (v9_3 != 100) {
                                        long v1_26 = v14_0.query(v38, new String[] {"_data"}), 0, 0, 0);
                                        if (v1_26 == 0) {
                                            v5_5 = v38;
                                        } else {
                                            try {
                                                Throwable v0_36 = v1_26.getCount();
                                            } catch (Throwable v0_38) {
                                                libcore.io.IoUtils.closeQuietly(v1_26);
                                                throw v0_38;
                                            }
                                            if (v0_36 != 1) {
                                                String v3_12 = new StringBuilder();
                                                v3_12.append("");
                                                v3_12.append(v0_36);
                                                v3_12.append(" rows for ");
                                                v5_5 = v38;
                                                try {
                                                    v3_12.append(v5_5);
                                                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v3_12.toString());
                                                } catch (Throwable v0_38) {
                                                }
                                            } else {
                                                try {
                                                    v1_26.moveToFirst();
                                                    v7_6 = v1_26.getString(0);
                                                    v5_5 = v38;
                                                } catch (Throwable v0_38) {
                                                }
                                            }
                                            libcore.io.IoUtils.closeQuietly(v1_26);
                                        }
                                    } else {
                                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Possible multi row album name update without path could give wrong album key");
                                        v5_5 = v38;
                                    }
                                }
                                if (v7_6 != null) {
                                    v8_4 = v7_6.substring(0, v7_6.lastIndexOf(47)).hashCode();
                                }
                                v16_5 = v7_6;
                            } else {
                                v16_5 = v7_6;
                                v9_3 = v37;
                                v5_5 = v38;
                            }
                        } else {
                            v8_4 = v11_2.hashCode();
                            v16_5 = v7_6;
                        }
                        String v7_7 = v12_2.toString();
                        String v4_9 = v36;
                        String v3_15 = v4_9.mAlbumCache;
                        try {
                            long v1_31;
                            Throwable v0_47 = new StringBuilder();
                            v0_47.append(v7_7);
                            v0_47.append(v8_4);
                            Throwable v0_48 = v0_47.toString();
                            String v2_23 = ((Long) v3_15.get(v0_48));
                        } catch (Throwable v0_49) {
                            v39 = v4_9;
                            String v17 = v7_7;
                            v41 = v9_3;
                            v21 = v11_2;
                            int v14 = v13_2;
                            throw v0_49;
                        } catch (Throwable v0_49) {
                        }
                        if (v2_23 != null) {
                            v39 = v4_9;
                            v40 = v5_5;
                            Throwable v18 = v8_4;
                            v41 = v9_3;
                            v21 = v11_2;
                            v14_1 = v13_2;
                            v1_31 = v2_23.longValue();
                        } else {
                            v39 = v4_9;
                            v40 = v5_5;
                            v41 = v9_3;
                            v14_1 = v13_2;
                            v1_31 = v14_0.getKeyIdForName(v4_9, v34, "albums", "album_key", "album", v7_7, v0_48, v16_5, v8_4, v25, v3_15, v40);
                        }
                        v14_1.put("album_id", Integer.toString(((int) v1_31)));
                    }
                    void v9_5;
                    String v2_26;
                    v14_1.remove("title_key");
                    long v1_33 = v14_1.getAsString("title");
                    if (v1_33 == 0) {
                        v2_26 = v14_1;
                        v9_5 = this;
                    } else {
                        v2_26 = v14_1;
                        v9_5 = this;
                        try {
                            Throwable v0_56 = this.getLocalizedTitle(v1_33);
                        } catch (Throwable v0) {
                            v2_26.put("title_resource_uri", v1_33);
                            v2_26.put("title_key", android.provider.MediaStore$Audio.keyFor(v1_33));
                            v2_26.put("title", v1_33.trim());
                        }
                        if (v0_56 == null) {
                            v2_26.putNull("title_resource_uri");
                        } else {
                            v2_26.put("title_resource_uri", v1_33);
                            v1_33 = v0_56;
                        }
                    }
                    String v8_7;
                    android.content.ContentValues v10_3 = v39;
                    v10_3.mNumUpdates = (v10_3.mNumUpdates + 1);
                    String v12_5 = v35;
                    v13_1 = v34;
                    v0_64 = v13_1.update(v12_5.table, v2_26, v12_5.where, p47);
                    int v14_2 = v23;
                    if (v14_2 == 0) {
                        v8_7 = v40;
                    } else {
                        String v15_2;
                        if (v0_64 != 1) {
                            v8_7 = v40;
                            v15_2 = v41;
                        } else {
                            v15_2 = v41;
                            if (v15_2 != 101) {
                                v8_7 = v40;
                            } else {
                                v8_7 = v40;
                                v9_5.updateGenre(Long.parseLong(((String) v8_7.getPathSegments().get(3))), v14_2);
                                v42 = v8_7;
                            }
                        }
                        android.content.ContentValues v5_10 = new StringBuilder();
                        v5_10.append("ignoring genre in update: count = ");
                        v5_10.append(v0_64);
                        v5_10.append(" match = ");
                        v5_10.append(v15_2);
                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v5_10.toString());
                    }
                    break;
                case 113:
                    if (v12_3.getQueryParameter("move") == null) {
                        v13_1 = v8_0;
                        v42 = v12_3;
                        v11_0 = v17_0;
                        v12_0 = v9_0;
                        v14 = v23;
                        v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_0);
                        v0_64 = v13_1.update(v12_0.table, p45, v12_0.where, p47);
                    } else {
                        if (!p45.containsKey("play_order")) {
                            String v2_10 = new StringBuilder();
                            v2_10.append("Need to specify ");
                            v2_10.append("play_order");
                            v2_10.append(" when using \'move\' parameter");
                            throw new IllegalArgumentException(v2_10.toString());
                        } else {
                            String v16_1 = p45.getAsInteger("play_order").intValue();
                            String v4_2 = v12_3.getPathSegments();
                            v0 = "play_order";
                            return v14_0.movePlaylistEntry(v10_4, v8_0, Long.parseLong(((String) v4_2.get(v7_0))), Integer.parseInt(((String) v4_2.get(v1_0))), v16_1);
                        }
                    }
                default:
                    v13_1 = v8_0;
                    v42 = v12_3;
                    v11_0 = v17_0;
                    v12_0 = v9_0;
                    v14 = v23;
            }
            if ((v0_64 > null) && (!v13_1.inTransaction())) {
                this.getContext().getContentResolver().notifyChange(v42, 0);
            }
            return v0_64;
        }
    }

Method com.android.providers.media.MediaProvider.update() calling method android.database.sqlite.SQLiteDatabase.query()


    public int update(android.net.Uri p44, android.content.ContentValues p45, String p46, String[] p47)
    {
        int v14_0 = this;
        String v12_3 = this.safeUncanonicalize(p44);
        int v11_6 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v12_3);
        android.content.ContentValues v10_4 = this.getDatabaseForUri(v12_3);
        if (v10_4 == null) {
            String v4_0 = v12_3;
            void v9 = this;
            String v15 = v11_6;
            long v1_4 = new StringBuilder();
            v1_4.append("Unknown URI: ");
            v1_4.append(v4_0);
            throw new UnsupportedOperationException(v1_4.toString());
        } else {
            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
            String v8_2 = v10_4.getWritableDatabase();
            Throwable v0_27 = 0;
            if (p45 != null) {
                v0_27 = p45.getAsString("genre");
                p45.remove("genre");
            }
            String v7_8;
            int v23;
            String v8_5;
            String v22_1;
            String v7_5 = v0_27;
            android.content.ContentValues v5_7 = this.getTableAndWhere(v12_3, v11_6, p46);
            if (!p45.containsKey("media_type")) {
                v22_1 = v5_7;
                v23 = v7_5;
                v7_8 = v8_2;
                v8_5 = 0;
            } else {
                String v16_6 = p45.getAsLong("media_type").longValue();
                v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                v22_1 = v5_7;
                v23 = v7_5;
                android.content.ContentResolver v24_1 = v8_2;
                Throwable v0_85 = v8_2.query(v5_7.table, com.android.providers.media.MediaProvider.sMediaTableColumns, v5_7.where, p47, 0, 0, 0);
                while(true) {
                    long v1_45 = v0_85;
                    if ((v1_45 == 0) || (!v1_45.moveToNext())) {
                        break;
                    }
                    String v7_16;
                    String v2_31 = v1_45.getLong(1);
                    try {
                        if ((v2_31 != 1) || (v16_6 == 1)) {
                            v7_16 = v24_1;
                            if ((v2_31 == 3) && (v16_6 != 3)) {
                                String v4_30 = new StringBuilder();
                                v4_30.append("need to remove video thumbnail for id ");
                                v4_30.append(v1_45.getString(0));
                                android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_30.toString());
                                v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                            }
                        } else {
                            String v4_34 = new StringBuilder();
                            v4_34.append("need to remove image thumbnail for id ");
                            v4_34.append(v1_45.getString(0));
                            android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v4_34.toString());
                            v7_16 = v24_1;
                            v14_0 = v14_0.removeThumbnailFor(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI, v7_16, v1_45.getLong(0));
                        }
                        v0_85 = v1_45;
                        v24_1 = v7_16;
                    } catch (Throwable v0_109) {
                        libcore.io.IoUtils.closeQuietly(v1_45);
                        throw v0_109;
                    }
                }
                v7_8 = v24_1;
                v8_5 = 0;
                libcore.io.IoUtils.closeQuietly(v1_45);
            }
            if ((v11_6 != 702) && ((v11_6 != 703) && (v11_6 != 706))) {
                long v1_0 = 5;
                String v17_0 = 1;
                void v9_0 = v22_1;
                String v8_0 = v7_8;
                String v7_0 = 3;
            } else {
                if ((p45 == null) || (((p45.size() != 1) || (!p45.containsKey("_data"))) && ((p45.size() != 2) || ((!p45.containsKey("_data")) || (!p45.containsKey("parent")))))) {
                    v1_0 = 5;
                    v17_0 = 1;
                    v9_0 = v22_1;
                    v8_0 = v7_8;
                    v7_0 = 3;
                } else {
                    String v16_0 = 0;
                    String v2_0 = p45.getAsString("_data");
                    v14_0.mDirectoryCache.remove(v2_0);
                    long v1_1 = new java.io.File(v2_0);
                    if ((v2_0 == null) || (!v1_1.isDirectory())) {
                        v17_0 = 1;
                        v9_0 = v22_1;
                        v8_0 = v7_8;
                        v7_0 = 3;
                        String v6 = v1_1;
                        v1_0 = 5;
                        android.content.ContentValues v5_0 = v2_0;
                        if (v5_0.toLowerCase(java.util.Locale.US).endsWith("/.nomedia")) {
                            v14_0 = v14_0.processNewNoMediaPath(v10_4, v8_0, v5_0);
                        }
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + 1);
                        v9_0 = v22_1;
                        java.util.HashMap v26 = v1_1;
                        boolean v27 = v2_0;
                        long v28 = v7_8;
                        Throwable v0_17 = v8_5;
                        long v1_5 = v7_8.query(v9_0.table, com.android.providers.media.MediaProvider.PATH_PROJECTION, p46, p47, 0, 0, 0);
                        try {
                            if ((v1_5 != 0) && (v1_5.moveToNext())) {
                                v16_0 = v1_5.getString(1);
                            }
                        } catch (Throwable v0_18) {
                            libcore.io.IoUtils.closeQuietly(v1_5);
                            throw v0_18;
                        }
                        String v2_7 = v16_0;
                        libcore.io.IoUtils.closeQuietly(v1_5);
                        if (v2_7 == null) {
                            android.content.ContentValues v5 = v27;
                            v8_0 = v28;
                            v1_0 = 5;
                            v7_0 = 3;
                            v17_0 = 1;
                        } else {
                            String v6_14;
                            android.content.ContentValues v5_19;
                            v14_0.mDirectoryCache.remove(v2_7);
                            v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                            String v8_11 = v28;
                            String v3_38 = v8_11.update(v9_0.table, p45, v9_0.where, p47);
                            if (v3_38 <= null) {
                                v6_14 = v26;
                                v5_19 = v27;
                            } else {
                                String v4_21 = new Object[6];
                                v5_19 = v27;
                                v4_21[v0_17] = v5_19;
                                v4_21[1] = Integer.valueOf((v2_7.length() + 1));
                                Throwable v0_90 = new StringBuilder();
                                v0_90.append(v2_7);
                                v0_90.append("/");
                                v4_21[2] = v0_90.toString();
                                Throwable v0_93 = new StringBuilder();
                                v0_93.append(v2_7);
                                v0_93.append("0");
                                v4_21[3] = v0_93.toString();
                                v6_14 = v26;
                                v4_21[4] = v6_14.getName();
                                v4_21[5] = Integer.valueOf(v6_14.toString().toLowerCase().hashCode());
                                Throwable v0_101 = v4_21;
                                v10_4.mNumUpdates = (v10_4.mNumUpdates + 1);
                                v8_11.execSQL("UPDATE files SET _data=?1||SUBSTR(_data, ?2),bucket_display_name=?5,bucket_id=?6 WHERE _data >= ?3 AND _data < ?4;", v0_101);
                            }
                            if ((v3_38 > null) && (!v8_11.inTransaction())) {
                                this.getContext().getContentResolver().notifyChange(v12_3, 0);
                            }
                            if (v6_14.getName().startsWith(".")) {
                                v14_0.processNewNoMediaPath(v10_4, v8_11, v5_19);
                            }
                            return v3_38;
                        }
                    }
                }
            }
            String v42;
            Throwable v0_64;
            String v12_0;
            int v11_0;
            int v13_1;
            switch (v11_6) {
                case 1:
                case 2:
                case 200:
                case 201:
                    int v11_5 = v17_0;
                    v13_1 = v8_0;
                    String v8_8 = v12_3;
                    String v12_6 = v9_0;
                    void v9_6 = v14_0;
                    android.content.ContentValues v5_14 = new android.content.ContentValues(p45);
                    v5_14.remove("bucket_id");
                    v5_14.remove("bucket_display_name");
                    String v4_13 = v5_14.getAsString("_data");
                    if (v4_13 != null) {
                        com.android.providers.media.MediaProvider.computeBucketValues(v4_13, v5_14);
                    }
                    com.android.providers.media.MediaProvider.computeTakenTime(v5_14);
                    v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_5);
                    String v16_7 = v13_1.update(v12_6.table, v5_14, v12_6.where, p47);
                    if ((v16_7 <= null) || (v5_14.getAsString("_data") == null)) {
                        v42 = v8_8;
                    } else {
                        v10_4.mNumQueries = (v10_4.mNumQueries + v11_5);
                        v42 = v8_8;
                        String v7_11 = v13_1.query(v12_6.table, com.android.providers.media.MediaProvider.READY_FLAG_PROJECTION, v12_6.where, p47, 0, 0, 0);
                        if (v7_11 == null) {
                            v0_64 = v16_7;
                            String v3 = p47;
                        }
                        try {
                            while (v7_11.moveToNext()) {
                                if (v7_11.getLong(2) == 0) {
                                    v9_6.requestMediaThumbnail(v7_11.getString(v11_5), v42, 10, 0);
                                }
                            }
                        } catch (Throwable v0_81) {
                            libcore.io.IoUtils.closeQuietly(v7_11);
                            throw v0_81;
                        }
                        libcore.io.IoUtils.closeQuietly(v7_11);
                    }
                case 100:
                case 101:
                    int v25;
                    int v31;
                    String v37;
                    int v36;
                    int v32;
                    android.content.ContentValues v38;
                    long v34;
                    int v35;
                    int v13_2;
                    String v6_3 = new android.content.ContentValues(p45);
                    android.content.ContentValues v5_3 = v6_3.getAsString("album_artist");
                    String v3_6 = v6_3.getAsString("compilation");
                    v6_3.remove("compilation");
                    String v2_16 = v6_3.getAsString("artist");
                    v6_3.remove("artist");
                    if (v2_16 == null) {
                        v25 = v2_16;
                        v31 = v3_6;
                        v32 = v5_3;
                        v34 = v8_0;
                        v35 = v9_0;
                        v36 = v10_4;
                        v37 = v11_6;
                        v38 = v12_3;
                        v13_2 = v6_3;
                    } else {
                        long v1_20 = v10_4.mArtistCache;
                        try {
                            long v1_21;
                            String v33;
                            Throwable v0_25 = ((Long) v1_20.get(v2_16));
                        } catch (Throwable v0_26) {
                            v25 = v2_16;
                            v32 = v5_3;
                            v35 = v9_0;
                            v37 = v11_6;
                            v15 = p47;
                        }
                        if (v0_25 != null) {
                            v25 = v2_16;
                            v31 = v3_6;
                            v32 = v5_3;
                            v33 = v6_3;
                            v34 = v8_0;
                            v35 = v9_0;
                            v36 = v10_4;
                            v37 = v11_6;
                            v38 = v12_3;
                            try {
                                v1_21 = v0_25.longValue();
                            } catch (Throwable v0_26) {
                            }
                        } else {
                            try {
                                v25 = v2_16;
                                String v2_17 = v10_4;
                                v31 = v3_6;
                                v32 = v5_3;
                                v33 = v6_3;
                                v34 = v8_0;
                                v35 = v9_0;
                                v36 = v10_4;
                                v37 = v11_6;
                                v38 = v12_3;
                                int v13_3 = v38;
                                try {
                                    v1_21 = v14_0.getKeyIdForName(v2_17, v8_0, "artists", "artist_key", "artist", v25, v25, 0, 0, 0, v1_20, v13_3);
                                } catch (Throwable v0_26) {
                                }
                            } catch (Throwable v0_26) {
                                v25 = v2_17;
                                v32 = "artist_key";
                                v35 = 0;
                                v37 = 0;
                                v15 = v13_3;
                            }
                        }
                        v13_2 = v33;
                        v13_2.put("artist_id", Integer.toString(((int) v1_21)));
                    }
                    String v41;
                    String v39;
                    int v14_1;
                    String v40;
                    String v12_2 = v13_2.getAsString("album");
                    v13_2.remove("album");
                    if (v12_2 == null) {
                        v14_1 = v13_2;
                        int v21 = v32;
                        v39 = v36;
                        v41 = v37;
                        v40 = v38;
                    } else {
                        String v16_5;
                        android.content.ContentValues v5_5;
                        void v9_3;
                        String v7_6 = v13_2.getAsString("_data");
                        String v8_4 = 0;
                        int v11_2 = v32;
                        if (v11_2 == 0) {
                            android.content.ContentValues v10_1 = v31;
                            if ((v10_1 == null) || (!v10_1.equals("1"))) {
                                if (v7_6 != null) {
                                    v9_3 = v37;
                                    v5_5 = v38;
                                } else {
                                    v9_3 = v37;
                                    if (v9_3 != 100) {
                                        long v1_26 = v14_0.query(v38, new String[] {"_data"}), 0, 0, 0);
                                        if (v1_26 == 0) {
                                            v5_5 = v38;
                                        } else {
                                            try {
                                                Throwable v0_36 = v1_26.getCount();
                                            } catch (Throwable v0_38) {
                                                libcore.io.IoUtils.closeQuietly(v1_26);
                                                throw v0_38;
                                            }
                                            if (v0_36 != 1) {
                                                String v3_12 = new StringBuilder();
                                                v3_12.append("");
                                                v3_12.append(v0_36);
                                                v3_12.append(" rows for ");
                                                v5_5 = v38;
                                                try {
                                                    v3_12.append(v5_5);
                                                    android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v3_12.toString());
                                                } catch (Throwable v0_38) {
                                                }
                                            } else {
                                                try {
                                                    v1_26.moveToFirst();
                                                    v7_6 = v1_26.getString(0);
                                                    v5_5 = v38;
                                                } catch (Throwable v0_38) {
                                                }
                                            }
                                            libcore.io.IoUtils.closeQuietly(v1_26);
                                        }
                                    } else {
                                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, "Possible multi row album name update without path could give wrong album key");
                                        v5_5 = v38;
                                    }
                                }
                                if (v7_6 != null) {
                                    v8_4 = v7_6.substring(0, v7_6.lastIndexOf(47)).hashCode();
                                }
                                v16_5 = v7_6;
                            } else {
                                v16_5 = v7_6;
                                v9_3 = v37;
                                v5_5 = v38;
                            }
                        } else {
                            v8_4 = v11_2.hashCode();
                            v16_5 = v7_6;
                        }
                        String v7_7 = v12_2.toString();
                        String v4_9 = v36;
                        String v3_15 = v4_9.mAlbumCache;
                        try {
                            long v1_31;
                            Throwable v0_47 = new StringBuilder();
                            v0_47.append(v7_7);
                            v0_47.append(v8_4);
                            Throwable v0_48 = v0_47.toString();
                            String v2_23 = ((Long) v3_15.get(v0_48));
                        } catch (Throwable v0_49) {
                            v39 = v4_9;
                            String v17 = v7_7;
                            v41 = v9_3;
                            v21 = v11_2;
                            int v14 = v13_2;
                            throw v0_49;
                        } catch (Throwable v0_49) {
                        }
                        if (v2_23 != null) {
                            v39 = v4_9;
                            v40 = v5_5;
                            Throwable v18 = v8_4;
                            v41 = v9_3;
                            v21 = v11_2;
                            v14_1 = v13_2;
                            v1_31 = v2_23.longValue();
                        } else {
                            v39 = v4_9;
                            v40 = v5_5;
                            v41 = v9_3;
                            v14_1 = v13_2;
                            v1_31 = v14_0.getKeyIdForName(v4_9, v34, "albums", "album_key", "album", v7_7, v0_48, v16_5, v8_4, v25, v3_15, v40);
                        }
                        v14_1.put("album_id", Integer.toString(((int) v1_31)));
                    }
                    String v2_26;
                    void v9_5;
                    v14_1.remove("title_key");
                    long v1_33 = v14_1.getAsString("title");
                    if (v1_33 == 0) {
                        v2_26 = v14_1;
                        v9_5 = this;
                    } else {
                        v2_26 = v14_1;
                        v9_5 = this;
                        try {
                            Throwable v0_56 = this.getLocalizedTitle(v1_33);
                        } catch (Throwable v0) {
                            v2_26.put("title_resource_uri", v1_33);
                            v2_26.put("title_key", android.provider.MediaStore$Audio.keyFor(v1_33));
                            v2_26.put("title", v1_33.trim());
                        }
                        if (v0_56 == null) {
                            v2_26.putNull("title_resource_uri");
                        } else {
                            v2_26.put("title_resource_uri", v1_33);
                            v1_33 = v0_56;
                        }
                    }
                    String v8_7;
                    android.content.ContentValues v10_3 = v39;
                    v10_3.mNumUpdates = (v10_3.mNumUpdates + 1);
                    String v12_5 = v35;
                    v13_1 = v34;
                    v0_64 = v13_1.update(v12_5.table, v2_26, v12_5.where, p47);
                    int v14_2 = v23;
                    if (v14_2 == 0) {
                        v8_7 = v40;
                    } else {
                        String v15_2;
                        if (v0_64 != 1) {
                            v8_7 = v40;
                            v15_2 = v41;
                        } else {
                            v15_2 = v41;
                            if (v15_2 != 101) {
                                v8_7 = v40;
                            } else {
                                v8_7 = v40;
                                v9_5.updateGenre(Long.parseLong(((String) v8_7.getPathSegments().get(3))), v14_2);
                                v42 = v8_7;
                            }
                        }
                        android.content.ContentValues v5_10 = new StringBuilder();
                        v5_10.append("ignoring genre in update: count = ");
                        v5_10.append(v0_64);
                        v5_10.append(" match = ");
                        v5_10.append(v15_2);
                        android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v5_10.toString());
                    }
                    break;
                case 113:
                    if (v12_3.getQueryParameter("move") == null) {
                        v13_1 = v8_0;
                        v42 = v12_3;
                        v11_0 = v17_0;
                        v12_0 = v9_0;
                        v14 = v23;
                        v10_4.mNumUpdates = (v10_4.mNumUpdates + v11_0);
                        v0_64 = v13_1.update(v12_0.table, p45, v12_0.where, p47);
                    } else {
                        if (!p45.containsKey("play_order")) {
                            String v2_10 = new StringBuilder();
                            v2_10.append("Need to specify ");
                            v2_10.append("play_order");
                            v2_10.append(" when using \'move\' parameter");
                            throw new IllegalArgumentException(v2_10.toString());
                        } else {
                            String v16_1 = p45.getAsInteger("play_order").intValue();
                            String v4_2 = v12_3.getPathSegments();
                            v0 = "play_order";
                            return v14_0.movePlaylistEntry(v10_4, v8_0, Long.parseLong(((String) v4_2.get(v7_0))), Integer.parseInt(((String) v4_2.get(v1_0))), v16_1);
                        }
                    }
                default:
                    v13_1 = v8_0;
                    v42 = v12_3;
                    v11_0 = v17_0;
                    v12_0 = v9_0;
                    v14 = v23;
            }
            if ((v0_64 > null) && (!v13_1.inTransaction())) {
                this.getContext().getContentResolver().notifyChange(v42, 0);
            }
            return v0_64;
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.query()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        String v14_0;
                        android.database.sqlite.SQLiteDatabase v9_0;
                        android.database.sqlite.SQLiteDatabase v13_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.query()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        android.database.sqlite.SQLiteDatabase v9_0;
                        String v14_0;
                        android.database.sqlite.SQLiteDatabase v13_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.query()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        String v14_0;
                        android.database.sqlite.SQLiteDatabase v9_0;
                        android.database.sqlite.SQLiteDatabase v13_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.delete() calling method android.database.sqlite.SQLiteDatabase.query()


    public int delete(android.net.Uri p40, String p41, String[] p42)
    {
        void v1 = this;
        android.net.Uri v11 = this.safeUncanonicalize(p40);
        android.database.sqlite.SQLiteDatabase v12_2 = com.android.providers.media.MediaProvider.URI_MATCHER.match(v11);
        android.database.sqlite.SQLiteDatabase v13_3 = 0;
        String v14_9 = 1;
        if (v12_2 != 500) {
            Throwable v0_10;
            if (v12_2 != 301) {
                if (v12_2 != 705) {
                    String v15 = com.android.providers.media.MediaProvider.getVolumeName(v11);
                    boolean v16 = "external".equals(v15);
                    android.database.sqlite.SQLiteDatabase v9_2 = this.getDatabaseForUri(v11);
                    if (v9_2 == null) {
                        int v38 = v12_2;
                        android.net.Uri v2_16 = new StringBuilder();
                        v2_16.append("Unknown URI: ");
                        v2_16.append(v11);
                        v2_16.append(" match: ");
                        v2_16.append(v38);
                        throw new UnsupportedOperationException(v2_16.toString());
                    } else {
                        android.database.sqlite.SQLiteDatabase v9_0;
                        android.database.sqlite.SQLiteDatabase v13_0;
                        String v14_0;
                        v9_2.mNumDeletes = (v9_2.mNumDeletes + 1);
                        String v8_14 = v9_2.getWritableDatabase();
                        android.media.MiniThumbFile v6_2 = this.getTableAndWhere(v11, v12_2, p41);
                        if (!v6_2.table.equals("files")) {
                            v14_0 = v6_2;
                            v13_0 = v9_2;
                            v9_0 = v8_14;
                        } else {
                            String v5_12 = v11.getQueryParameter("deletedata");
                            if ((v5_12 != null) && (v5_12.equals("false"))) {
                                v14_0 = v6_2;
                                v13_0 = v9_2;
                                v9_0 = v8_14;
                            } else {
                                v9_2.mNumQueries = (v9_2.mNumQueries + 1);
                                String v26 = v6_2;
                                android.database.sqlite.SQLiteDatabase v27 = v8_14;
                                android.database.sqlite.SQLiteDatabase v28 = v9_2;
                                android.net.Uri v2_35 = v8_14.query(v6_2.table, com.android.providers.media.MediaProvider.sMediaTypeDataId, v6_2.where, p42, 0, 0, 0);
                                String v3_26 = new String[] {""});
                                long v4_3 = new String[] {"", ""});
                                android.media.MiniThumbFile v6_1 = 0;
                                String v5_8 = 0;
                                try {
                                    while (v2_35.moveToNext()) {
                                        try {
                                            android.database.sqlite.SQLiteDatabase v13_1;
                                            android.database.sqlite.SQLiteDatabase v9_4;
                                            int v7_2 = v2_35.getInt(v13_3);
                                            String v8_3 = v2_35.getString(v14_9);
                                            long v29 = v2_35.getLong(2);
                                        } catch (Throwable v0_0) {
                                            android.database.sqlite.SQLiteDatabase v13 = v28;
                                            String v8_0 = v5_8;
                                            libcore.io.IoUtils.closeQuietly(v2_35);
                                            if (v6_1 != null) {
                                                v6_1.deactivate();
                                            }
                                            if (v8_0 != null) {
                                                v8_0.deactivate();
                                            }
                                            throw v0_0;
                                        }
                                        if (v7_2 != v14_9) {
                                            long v31_0 = v4_3;
                                            String v32_2 = v5_8;
                                            v9_4 = v27;
                                            v13_1 = v28;
                                            long v4_2 = v29;
                                            if (v7_2 != 3) {
                                                if (v7_2 != 2) {
                                                    v4_3 = v31_0;
                                                    v5_8 = v32_2;
                                                    v27 = v9_4;
                                                    v28 = v13_1;
                                                    v13_3 = 0;
                                                    v14_9 = 1;
                                                } else {
                                                    try {
                                                        if (v13_1.mInternal) {
                                                            v4_3 = v31_0;
                                                        } else {
                                                            com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 2, v4_2);
                                                            v3_26[0] = String.valueOf(v4_2);
                                                            v13_1.mNumDeletes = (v13_1.mNumDeletes + 2);
                                                            v9_4.delete("audio_genres_map", "audio_id=?", v3_26);
                                                            Throwable v0_27 = v9_4.query("audio_playlists_map", com.android.providers.media.MediaProvider.sPlaylistIdPlayOrder, "audio_id=?", v3_26, 0, 0, 0);
                                                            while(true) {
                                                                String v8_10 = v0_27;
                                                                if (!v8_10.moveToNext()) {
                                                                    break;
                                                                }
                                                                Throwable v0_32 = new StringBuilder();
                                                                v0_32.append("");
                                                                long v36 = v4_2;
                                                                v0_32.append(v8_10.getLong(0));
                                                                v31_0[0] = v0_32.toString();
                                                                Throwable v0_35 = new StringBuilder();
                                                                v0_35.append("");
                                                                v0_35.append(v8_10.getInt(1));
                                                                v31_0[1] = v0_35.toString();
                                                                v13_1.mNumUpdates = (v13_1.mNumUpdates + 1);
                                                                long v4_7 = v31_0;
                                                                v9_4.execSQL("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE playlist_id=? AND play_order>?", v4_7);
                                                                v31_0 = v4_7;
                                                                v0_27 = v8_10;
                                                                v4_2 = v36;
                                                            }
                                                            v4_3 = v31_0;
                                                            v9_4.delete("audio_playlists_map", "audio_id=?", v3_26);
                                                            libcore.io.IoUtils.closeQuietly(v8_10);
                                                        }
                                                    } catch (Throwable v0_0) {
                                                        String v14 = v26;
                                                        v8_0 = v32_2;
                                                    }
                                                }
                                            } else {
                                                try {
                                                    v1 = v1.deleteIfAllowed(v11, v8_3);
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, 3, v4_2);
                                                    v3_26[0] = String.valueOf(v4_2);
                                                    v13_1.mNumQueries = (v13_1.mNumQueries + 1);
                                                    Throwable v0_44 = v9_4.query("videothumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "video_id=?", v3_26, 0, 0, 0);
                                                } catch (Throwable v0_0) {
                                                    long v4 = v31_0;
                                                }
                                                while(true) {
                                                    String v14_7 = v0_44;
                                                    if (!v14_7.moveToNext()) {
                                                        break;
                                                    }
                                                    String v35 = v8_3;
                                                    v1 = v1.deleteIfAllowed(v11, v14_7.getString(0));
                                                    v0_44 = v14_7;
                                                    v8_3 = v35;
                                                }
                                                v13_1.mNumDeletes = (v13_1.mNumDeletes + 1);
                                                v9_4.delete("videothumbnails", "video_id=?", v3_26);
                                                libcore.io.IoUtils.closeQuietly(v14_7);
                                                if (v16) {
                                                    if (v32_2 != null) {
                                                        v8_0 = v32_2;
                                                    } else {
                                                        v8_0 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Video$Media.EXTERNAL_CONTENT_URI);
                                                    }
                                                    try {
                                                        v8_0.eraseMiniThumb(v4_2);
                                                        v32_2 = v8_0;
                                                    } catch (Throwable v0_0) {
                                                        v4 = v31_0;
                                                    }
                                                }
                                                v4_3 = v31_0;
                                            }
                                            v8_0 = v32_2;
                                        } else {
                                            try {
                                                v1 = v1.deleteIfAllowed(v11, v8_3);
                                                long v31_1 = v4_3;
                                                String v32_3 = v5_8;
                                                long v4_8 = v29;
                                                try {
                                                    com.android.providers.media.MediaDocumentsProvider.onMediaStoreDelete(this.getContext(), v15, v14_9, v4_8);
                                                    v3_26[v13_3] = String.valueOf(v4_8);
                                                    v9_4 = v28;
                                                    try {
                                                        v9_4.mNumQueries = (v9_4.mNumQueries + v14_9);
                                                        Throwable v0_57 = v27.query("thumbnails", com.android.providers.media.MediaProvider.sDataOnlyColumn, "image_id=?", v3_26, 0, 0, 0);
                                                    } catch (Throwable v0_0) {
                                                        v14 = v26;
                                                        v8_0 = v32_3;
                                                    }
                                                    while(true) {
                                                        String v14_8 = v0_57;
                                                        if (!v14_8.moveToNext()) {
                                                            break;
                                                        }
                                                        try {
                                                            v1 = v1.deleteIfAllowed(v11, v14_8.getString(v13_3));
                                                            v0_57 = v14_8;
                                                            v14_8 = 1;
                                                        } catch (Throwable v0_62) {
                                                            libcore.io.IoUtils.closeQuietly(v14_8);
                                                            throw v0_62;
                                                        }
                                                    }
                                                    v9_4.mNumDeletes = (v9_4.mNumDeletes + 1);
                                                    android.database.sqlite.SQLiteDatabase v34_1 = v9_4;
                                                    v9_4 = v27;
                                                    v9_4.delete("thumbnails", "image_id=?", v3_26);
                                                    libcore.io.IoUtils.closeQuietly(v14_8);
                                                    if (v16) {
                                                        if (v6_1 == null) {
                                                            v6_1 = android.media.MiniThumbFile.instance(android.provider.MediaStore$Images$Media.EXTERNAL_CONTENT_URI);
                                                        }
                                                        v6_1.eraseMiniThumb(v4_8);
                                                    }
                                                    v4_3 = v31_1;
                                                    v5_8 = v32_3;
                                                    v13_1 = v34_1;
                                                } catch (Throwable v0_0) {
                                                    v14 = v26;
                                                    v4 = v31_1;
                                                    v8_0 = v32_3;
                                                }
                                            } catch (Throwable v0_0) {
                                                v14 = v26;
                                                v8_0 = v5_8;
                                            }
                                        }
                                    }
                                } catch (Throwable v0_0) {
                                    v8_0 = v5_8;
                                    android.database.sqlite.SQLiteDatabase v9 = v27;
                                }
                                String v32_0 = v5_8;
                                v9_0 = v27;
                                v13_0 = v28;
                                libcore.io.IoUtils.closeQuietly(v2_35);
                                if (v6_1 != null) {
                                    v6_1.deactivate();
                                }
                                if (v32_0 != null) {
                                    v32_0.deactivate();
                                }
                                v14_0 = v26;
                                if (android.text.TextUtils.isEmpty(v14_0.where)) {
                                    v14_0.where = "_id NOT IN (SELECT parent FROM files)";
                                    switch (v12_2) {
                                        case 3:
                                        case 4:
                                        case 202:
                                        case 203:
                                            android.database.sqlite.SQLiteDatabase v12_0 = v9_0;
                                            android.net.Uri v2_8 = v9_0.query(v14_0.table, com.android.providers.media.MediaProvider.sDataOnlyColumn, v14_0.where, p42, 0, 0, 0);
                                            if (v2_8 != null) {
                                                try {
                                                    while (v2_8.moveToNext()) {
                                                        v1 = v1.deleteIfAllowed(v11, v2_8.getString(0));
                                                    }
                                                } catch (Throwable v0_16) {
                                                    libcore.io.IoUtils.closeQuietly(v2_8);
                                                    throw v0_16;
                                                }
                                                libcore.io.IoUtils.closeQuietly(v2_8);
                                            }
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_0.delete(v14_0.table, v14_0.where, p42);
                                            break;
                                        case 108:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("audio_genres_map", v14_0.where, p42);
                                            android.database.sqlite.SQLiteDatabase v12 = v9_0;
                                            break;
                                        case 702:
                                        case 703:
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v9_0.delete("files", v14_0.where, p42);
                                            break;
                                        default:
                                            android.database.sqlite.SQLiteDatabase v12_1 = v9_0;
                                            v13_0.mNumDeletes = (v13_0.mNumDeletes + 1);
                                            v0_10 = v12_1.delete(v14_0.table, v14_0.where, p42);
                                    }
                                    android.net.Uri v2_12 = new StringBuilder();
                                    v2_12.append("content://media/");
                                    v2_12.append(v15);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_12.toString()), 0);
                                    return v0_10;
                                } else {
                                    Throwable v0_5 = new StringBuilder();
                                    v0_5.append("(");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(") AND (_id NOT IN (SELECT parent FROM files WHERE NOT (");
                                    v0_5.append(v14_0.where);
                                    v0_5.append(")))");
                                    v14_0.where = v0_5.toString();
                                }
                            }
                        }
                    }
                } else {
                    try {
                        if (this.mMtpService == null) {
                        } else {
                            this.getContext().unbindService(this.mMtpServiceConnection);
                            v13_3 = 1;
                            this.mMtpService = 0;
                        }
                    } catch (Throwable v0_66) {
                        throw v0_66;
                    }
                    v0_10 = v13_3;
                }
            } else {
                this.detachVolume(v11);
                v0_10 = 1;
            }
            return v0_10;
        } else {
            if (this.mMediaScannerVolume != null) {
                android.net.Uri v2_24 = new StringBuilder();
                v2_24.append("content://media/");
                v2_24.append(this.mMediaScannerVolume);
                v2_24.append("/audio");
                android.net.Uri v2_27 = this.getDatabaseForUri(android.net.Uri.parse(v2_24.toString()));
                if (v2_27 != null) {
                    v2_27.mScanStopTime = android.os.SystemClock.currentTimeMicro();
                    com.android.providers.media.MediaProvider.logToDb(v2_27.getWritableDatabase(), this.dump(v2_27, 0));
                } else {
                    long v4_12 = new StringBuilder();
                    v4_12.append("no database for scanned volume ");
                    v4_12.append(this.mMediaScannerVolume);
                    android.util.Log.w(com.android.providers.media.MediaProvider.TAG, v4_12.toString());
                }
                if ("internal".equals(this.mMediaScannerVolume)) {
                    long v4_16 = this.getContext().getSharedPreferences("MediaScanBuild", 0).edit();
                    v4_16.putString("lastScanFingerprint", android.os.Build.FINGERPRINT);
                    v4_16.apply();
                }
                this.mMediaScannerVolume = 0;
                this.pruneThumbnails();
                return 1;
            } else {
                return 0;
            }
        }
    }

Method com.android.providers.media.MediaProvider.setObjectReferences() calling method android.database.sqlite.SQLiteDatabase.query()


    private int setObjectReferences(com.android.providers.media.MediaProvider$DatabaseHelper p32, android.database.sqlite.SQLiteDatabase p33, int p34, android.content.ContentValues[] p35)
    {
        long v12 = 0;
        p32.mNumQueries = (p32.mNumQueries + 1);
        int v6_1 = new String[1];
        v6_1[0] = Integer.toString(p34);
        int v2_2 = p33.query("files", com.android.providers.media.MediaProvider.sMediaTableColumns, "_id=?", v6_1, 0, 0, 0);
        try {
            if ((v2_2 != 0) && (v2_2.moveToNext())) {
                if (v2_2.getInt(1) == 4) {
                    v12 = v2_2.getLong(0);
                } else {
                    libcore.io.IoUtils.closeQuietly(v2_2);
                    return 0;
                }
            }
        } catch (int v0_11) {
            libcore.io.IoUtils.closeQuietly(v2_2);
            throw v0_11;
        }
        libcore.io.IoUtils.closeQuietly(v2_2);
        if (v12 != 0) {
            p32.mNumDeletes = (p32.mNumDeletes + 1);
            String[] v4_0 = new String[1];
            v4_0[0] = Long.toString(v12);
            p33.delete("audio_playlists_map", "playlist_id=?", v4_0);
            int v9_1 = p35.length;
            android.content.ContentValues[] v8_1 = new android.content.ContentValues[v9_1];
            int v7_2 = 0;
            int v0_7 = 0;
            while(true) {
                int v6_6 = v0_7;
                if (v6_6 >= v9_1) {
                    break;
                }
                int v6_2;
                android.content.ContentValues[] v5_2;
                long v3_0;
                String[] v4_1 = p35[v6_6].getAsLong("_id").longValue();
                p32.mNumQueries = (p32.mNumQueries + 1);
                int v2_5 = new String[1];
                v2_5[0] = Long.toString(v4_1);
                int v21_0 = v6_6;
                int v28 = v7_2;
                android.content.ContentValues[] v29 = v8_1;
                int v30_0 = v9_1;
                int v2_0 = p33.query("files", com.android.providers.media.MediaProvider.sMediaTableColumns, "_id=?", v2_5, 0, 0, 0);
                try {
                    if ((v2_0 == 0) || (!v2_0.moveToNext())) {
                        v3_0 = 0;
                        libcore.io.IoUtils.closeQuietly(v2_0);
                        if (v3_0 == 0) {
                            v6_2 = v28;
                            v5_2 = v29;
                            v7_2 = v6_2;
                        } else {
                            int v0_6 = new android.content.ContentValues();
                            v0_6.put("playlist_id", Long.valueOf(v12));
                            v0_6.put("audio_id", Long.valueOf(v3_0));
                            int v6_5 = v28;
                            v0_6.put("play_order", Integer.valueOf(v6_5));
                            v7_2 = (v6_5 + 1);
                            v5_2 = v29;
                            v5_2[v6_5] = v0_6;
                        }
                    } else {
                        if (v2_0.getInt(1) == 2) {
                            v3_0 = v2_0.getLong(0);
                        } else {
                            libcore.io.IoUtils.closeQuietly(v2_0);
                            v6_2 = v28;
                            v5_2 = v29;
                        }
                    }
                    v0_7 = (v21_0 + 1);
                    v8_1 = v5_2;
                    v9_1 = v30_0;
                } catch (int v0_2) {
                    libcore.io.IoUtils.closeQuietly(v2_0);
                    throw v0_2;
                }
            }
            int v6_7 = v7_2;
            android.content.ContentValues[] v5_7 = v8_1;
            if (v6_7 < v9_1) {
                int v0_19 = new android.content.ContentValues[v6_7];
                System.arraycopy(v5_7, 0, v0_19, 0, v6_7);
                v5_7 = v0_19;
            }
            return this.playlistBulkInsert(p33, android.provider.MediaStore$Audio$Playlists$Members.getContentUri("external", v12), v5_7);
        } else {
            return 0;
        }
    }

Method com.android.providers.media.MediaProvider.setObjectReferences() calling method android.database.sqlite.SQLiteDatabase.query()


    private int setObjectReferences(com.android.providers.media.MediaProvider$DatabaseHelper p32, android.database.sqlite.SQLiteDatabase p33, int p34, android.content.ContentValues[] p35)
    {
        long v12 = 0;
        p32.mNumQueries = (p32.mNumQueries + 1);
        int v6_1 = new String[1];
        v6_1[0] = Integer.toString(p34);
        int v2_2 = p33.query("files", com.android.providers.media.MediaProvider.sMediaTableColumns, "_id=?", v6_1, 0, 0, 0);
        try {
            if ((v2_2 != 0) && (v2_2.moveToNext())) {
                if (v2_2.getInt(1) == 4) {
                    v12 = v2_2.getLong(0);
                } else {
                    libcore.io.IoUtils.closeQuietly(v2_2);
                    return 0;
                }
            }
        } catch (int v0_11) {
            libcore.io.IoUtils.closeQuietly(v2_2);
            throw v0_11;
        }
        libcore.io.IoUtils.closeQuietly(v2_2);
        if (v12 != 0) {
            p32.mNumDeletes = (p32.mNumDeletes + 1);
            String[] v4_0 = new String[1];
            v4_0[0] = Long.toString(v12);
            p33.delete("audio_playlists_map", "playlist_id=?", v4_0);
            int v9_1 = p35.length;
            android.content.ContentValues[] v8_1 = new android.content.ContentValues[v9_1];
            int v7_2 = 0;
            int v0_7 = 0;
            while(true) {
                int v6_6 = v0_7;
                if (v6_6 >= v9_1) {
                    break;
                }
                long v3_0;
                android.content.ContentValues[] v5_2;
                int v6_2;
                String[] v4_1 = p35[v6_6].getAsLong("_id").longValue();
                p32.mNumQueries = (p32.mNumQueries + 1);
                int v2_5 = new String[1];
                v2_5[0] = Long.toString(v4_1);
                int v21_0 = v6_6;
                int v28 = v7_2;
                android.content.ContentValues[] v29 = v8_1;
                int v30_0 = v9_1;
                int v2_0 = p33.query("files", com.android.providers.media.MediaProvider.sMediaTableColumns, "_id=?", v2_5, 0, 0, 0);
                try {
                    if ((v2_0 == 0) || (!v2_0.moveToNext())) {
                        v3_0 = 0;
                        libcore.io.IoUtils.closeQuietly(v2_0);
                        if (v3_0 == 0) {
                            v6_2 = v28;
                            v5_2 = v29;
                            v7_2 = v6_2;
                        } else {
                            int v0_6 = new android.content.ContentValues();
                            v0_6.put("playlist_id", Long.valueOf(v12));
                            v0_6.put("audio_id", Long.valueOf(v3_0));
                            int v6_5 = v28;
                            v0_6.put("play_order", Integer.valueOf(v6_5));
                            v7_2 = (v6_5 + 1);
                            v5_2 = v29;
                            v5_2[v6_5] = v0_6;
                        }
                    } else {
                        if (v2_0.getInt(1) == 2) {
                            v3_0 = v2_0.getLong(0);
                        } else {
                            libcore.io.IoUtils.closeQuietly(v2_0);
                            v6_2 = v28;
                            v5_2 = v29;
                        }
                    }
                    v0_7 = (v21_0 + 1);
                    v8_1 = v5_2;
                    v9_1 = v30_0;
                } catch (int v0_2) {
                    libcore.io.IoUtils.closeQuietly(v2_0);
                    throw v0_2;
                }
            }
            int v6_7 = v7_2;
            android.content.ContentValues[] v5_7 = v8_1;
            if (v6_7 < v9_1) {
                int v0_19 = new android.content.ContentValues[v6_7];
                System.arraycopy(v5_7, 0, v0_19, 0, v6_7);
                v5_7 = v0_19;
            }
            return this.playlistBulkInsert(p33, android.provider.MediaStore$Audio$Playlists$Members.getContentUri("external", v12), v5_7);
        } else {
            return 0;
        }
    }

Method com.android.providers.media.MediaProvider.sanityCheck() calling method android.database.sqlite.SQLiteDatabase.query()


    private static void sanityCheck(android.database.sqlite.SQLiteDatabase p10, int p11)
    {
        android.database.Cursor v1 = 0;
        try {
            android.database.Cursor v0 = p10.query("audio_meta", new String[] {"count(*)"}), 0, 0, 0, 0, 0);
            v1 = p10.query("audio_meta", new String[] {"count(distinct _data)"}), 0, 0, 0, 0, 0);
            v0.moveToFirst();
            v1.moveToFirst();
            int v3_2 = v0.getInt(0);
            Throwable v2_7 = v1.getInt(0);
        } catch (Throwable v2_8) {
            libcore.io.IoUtils.closeQuietly(v0);
            libcore.io.IoUtils.closeQuietly(v1);
            throw v2_8;
        }
        if (v3_2 != v2_7) {
            String v5_2 = new StringBuilder();
            v5_2.append("audio_meta._data column is not unique while upgrading from schema ");
            v5_2.append(p11);
            v5_2.append(" : ");
            v5_2.append(v3_2);
            v5_2.append("/");
            v5_2.append(v2_7);
            android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v5_2.toString());
            p10.execSQL("DELETE FROM audio_meta;");
        }
        libcore.io.IoUtils.closeQuietly(v0);
        libcore.io.IoUtils.closeQuietly(v1);
        return;
    }

Method com.android.providers.media.MediaProvider.pruneThumbnails() calling method android.database.sqlite.SQLiteDatabase.query()


    private void pruneThumbnails()
    {
        android.util.Log.v(com.android.providers.media.MediaProvider.TAG, "pruneThumbnails ");
        android.database.sqlite.SQLiteDatabase v12 = this.getDatabaseForUri(android.provider.MediaStore$Images$Thumbnails.getContentUri("external")).getWritableDatabase();
        v12.execSQL("delete from thumbnails where image_id not in (select _id from images)");
        v12.execSQL("delete from videothumbnails where video_id not in (select _id from video)");
        java.util.HashSet v13 = new java.util.HashSet();
        try {
            String v4_2 = new java.io.File("/sdcard/DCIM/.thumbnails").getCanonicalFile();
            String v5_0 = v4_2.list();
        } catch (SecurityException v0) {
            return;
        }
        if (v5_0 == null) {
            String[] v6_0 = new String[0];
            v5_0 = v6_0;
        }
        String[] v6_1 = v4_2.getPath();
        int v7_0 = 0;
        while (v7_0 < v5_0.length) {
            if (v5_0[v7_0].endsWith(".jpg")) {
                int v8_5 = new StringBuilder();
                v8_5.append(v6_1);
                v8_5.append("/");
                v8_5.append(v5_0[v7_0]);
                v13.add(v8_5.toString());
            }
            v7_0++;
        }
        SecurityException v0_8 = new String[] {"thumbnails", "videothumbnails"});
        int v15 = v0_8.length;
        int v11_0 = 0;
        while (v11_0 < v15) {
            int v18 = v11_0;
            String v4_8 = v12.query(v0_8[v11_0], new String[] {"_data"}), 0, 0, 0, 0, 0);
            if ((v4_8 != null) && (v4_8.moveToFirst())) {
                do {
                    v13.remove(v4_8.getString(0));
                } while(v4_8.moveToNext());
            }
            libcore.io.IoUtils.closeQuietly(v4_8);
            v11_0 = (v18 + 1);
        }
        String v4_4 = v13.iterator();
        while (v4_4.hasNext()) {
            try {
                new java.io.File(((String) v4_4.next())).delete();
            } catch (SecurityException v0) {
            }
        }
        android.util.Log.v(com.android.providers.media.MediaProvider.TAG, "/pruneDeadThumbnailFiles... ");
        return;
    }

Method com.android.providers.media.MediaProvider.movePlaylistEntry() calling method android.database.sqlite.SQLiteDatabase.query()


    private int movePlaylistEntry(com.android.providers.media.MediaProvider$DatabaseHelper p23, android.database.sqlite.SQLiteDatabase p24, long p25, int p27, int p28)
    {
        if (p27 != p28) {
            p24.beginTransaction();
            String v17_0 = 0;
            try {
                p23.mNumUpdates = (p23.mNumUpdates + 3);
                String[] v6_0 = new String[1];
                android.database.Cursor v2_4 = new StringBuilder();
                v2_4.append("");
                v2_4.append(p25);
                v6_0[0] = v2_4.toString();
                android.database.Cursor v2_7 = new StringBuilder();
                v2_7.append(p27);
                v2_7.append(",1");
                String v10_1 = p24.query("audio_playlists_map", new String[] {"play_order"}), "playlist_id=?", v6_0, 0, 0, "play_order", v2_7.toString());
                try {
                    v10_1.moveToFirst();
                    String v9_3 = v10_1.getInt(0);
                    libcore.io.IoUtils.closeQuietly(v10_1);
                    String[] v6_1 = new String[1];
                    android.database.Cursor v2_13 = new StringBuilder();
                    v2_13.append("");
                    v2_13.append(p25);
                    v6_1[0] = v2_13.toString();
                    android.database.Cursor v2_16 = new StringBuilder();
                    v2_16.append(p28);
                    v2_16.append(",1");
                    int v21 = v9_3;
                    v17_0 = v10_1;
                    String v10_2 = v2_16.toString();
                } catch (android.net.Uri v0_0) {
                    android.database.Cursor v2_18 = v10_2;
                    p24.endTransaction();
                    libcore.io.IoUtils.closeQuietly(v2_18);
                    throw v0_0;
                }
                v2_18 = p24.query("audio_playlists_map", new String[] {"play_order"}), "playlist_id=?", v6_1, 0, 0, "play_order", v10_2);
                try {
                    android.content.ContentResolver v3_5;
                    v2_18.moveToFirst();
                    android.net.Uri v0_6 = v2_18.getInt(0);
                    android.content.ContentResolver v3_19 = new StringBuilder();
                    v3_19.append("UPDATE audio_playlists_map SET play_order=-1 WHERE play_order=");
                    int v4_4 = v21;
                    v3_19.append(v4_4);
                    v3_19.append(" AND playlist_id=");
                    v3_19.append(p25);
                    p24.execSQL(v3_19.toString());
                } catch (android.net.Uri v0_0) {
                }
                if (p27 >= p28) {
                    android.content.ContentResolver v3_2 = new StringBuilder();
                    v3_2.append("UPDATE audio_playlists_map SET play_order=play_order+1 WHERE play_order>=");
                    v3_2.append(v0_6);
                    v3_2.append(" AND play_order<");
                    v3_2.append(v4_4);
                    v3_2.append(" AND playlist_id=");
                    v3_2.append(p25);
                    p24.execSQL(v3_2.toString());
                    v3_5 = ((p27 - p28) + 1);
                } else {
                    android.content.ContentResolver v3_7 = new StringBuilder();
                    v3_7.append("UPDATE audio_playlists_map SET play_order=play_order-1 WHERE play_order<=");
                    v3_7.append(v0_6);
                    v3_7.append(" AND play_order>");
                    v3_7.append(v4_4);
                    v3_7.append(" AND playlist_id=");
                    v3_7.append(p25);
                    p24.execSQL(v3_7.toString());
                    v3_5 = ((p28 - p27) + 1);
                }
                int v16 = v3_5;
                android.content.ContentResolver v3_12 = new StringBuilder();
                v3_12.append("UPDATE audio_playlists_map SET play_order=");
                v3_12.append(v0_6);
                v3_12.append(" WHERE play_order=-1 AND playlist_id=");
                v3_12.append(p25);
                p24.execSQL(v3_12.toString());
                p24.setTransactionSuccessful();
                p24.endTransaction();
                libcore.io.IoUtils.closeQuietly(v2_18);
                this.getContext().getContentResolver().notifyChange(android.provider.MediaStore$Audio$Playlists.EXTERNAL_CONTENT_URI.buildUpon().appendEncodedPath(String.valueOf(p25)).build(), 0);
                return v16;
            } catch (android.net.Uri v0_0) {
                v2_18 = v17_0;
            }
        } else {
            return 0;
        }
    }

Method com.android.providers.media.MediaProvider.makePristine() calling method android.database.sqlite.SQLiteDatabase.query()


    private static void makePristine(android.database.sqlite.SQLiteDatabase p11)
    {
        android.database.Cursor v0_1 = p11.query("sqlite_master", new String[] {"name"}), "type is \'trigger\'", 0, 0, 0, 0);
        while (v0_1.moveToNext()) {
            String v1_19 = new StringBuilder();
            v1_19.append("DROP TRIGGER IF EXISTS ");
            v1_19.append(v0_1.getString(0));
            p11.execSQL(v1_19.toString());
        }
        v0_1.close();
        android.database.Cursor v0_2 = p11.query("sqlite_master", new String[] {"name"}), "type is \'view\'", 0, 0, 0, 0);
        while (v0_2.moveToNext()) {
            String v1_16 = new StringBuilder();
            v1_16.append("DROP VIEW IF EXISTS ");
            v1_16.append(v0_2.getString(0));
            p11.execSQL(v1_16.toString());
        }
        v0_2.close();
        android.database.Cursor v0_3 = p11.query("sqlite_master", new String[] {"name"}), "type is \'index\'", 0, 0, 0, 0);
        while (v0_3.moveToNext()) {
            String v1_13 = new StringBuilder();
            v1_13.append("DROP INDEX IF EXISTS ");
            v1_13.append(v0_3.getString(0));
            p11.execSQL(v1_13.toString());
        }
        v0_3.close();
        android.database.Cursor v0_4 = p11.query("sqlite_master", new String[] {"name"}), "type is \'table\'", 0, 0, 0, 0);
        while (v0_4.moveToNext()) {
            String v1_10 = new StringBuilder();
            v1_10.append("DROP TABLE IF EXISTS ");
            v1_10.append(v0_4.getString(0));
            p11.execSQL(v1_10.toString());
        }
        v0_4.close();
        return;
    }

Method com.android.providers.media.MediaProvider.localizeTitles() calling method android.database.sqlite.SQLiteDatabase.query()


    private void localizeTitles()
    {
        Throwable v0_2 = this.mDatabases.values().iterator();
        while (v0_2.hasNext()) {
            android.database.sqlite.SQLiteDatabase v10 = ((com.android.providers.media.MediaProvider$DatabaseHelper) v0_2.next()).getWritableDatabase();
            android.database.Cursor v2_2 = v10.query("files", new String[] {"_id", "title_resource_uri"}), "title_resource_uri IS NOT NULL", 0, 0, 0, 0);
            Throwable v3_1 = 0;
            try {
                while (v2_2.moveToNext()) {
                    String v5_1 = v2_2.getString(0);
                    String v7_1 = v2_2.getString(1);
                    android.content.ContentValues v8_2 = new android.content.ContentValues();
                    try {
                        String v9_1 = this.getLocalizedTitle(v7_1);
                        v8_2.put("title_key", android.provider.MediaStore$Audio.keyFor(v9_1));
                        v8_2.put("title", v9_1.trim());
                        String v6_2 = new String[1];
                        v6_2[0] = v5_1;
                        v10.update("files", v8_2, "_id=?", v6_2);
                    } catch (Exception v4) {
                        String v9_3 = new StringBuilder();
                        v9_3.append("Error updating localized title for ");
                        v9_3.append(v7_1);
                        v9_3.append(", keeping old localization");
                        android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v9_3.toString());
                    }
                }
            } catch (Throwable v0_4) {
                if (v2_2 != null) {
                    com.android.providers.media.MediaProvider.$closeResource(v3_1, v2_2);
                }
                throw v0_4;
            } catch (Throwable v0_3) {
                v3_1 = v0_3;
                throw v3_1;
            }
            if (v2_2 != null) {
                com.android.providers.media.MediaProvider.$closeResource(0, v2_2);
            }
        }
        return;
    }

Method com.android.providers.media.MediaProvider.hidePath() calling method android.database.sqlite.SQLiteDatabase.query()


    private void hidePath(com.android.providers.media.MediaProvider$DatabaseHelper p19, android.database.sqlite.SQLiteDatabase p20, String p21)
    {
        android.database.Cursor v1_1;
        int v10_4 = 1;
        android.media.MediaScanner.clearMediaPathCache(1, 0);
        java.io.File v13 = new java.io.File(p21);
        if (!v13.isDirectory()) {
            v1_1 = v13.getParent();
        } else {
            v1_1 = p21;
        }
        String v14 = v1_1;
        android.net.Uri v5_1 = new String[2];
        android.database.Cursor v1_4 = new StringBuilder();
        v1_4.append(v14);
        v1_4.append("/");
        v5_1[0] = v1_4.toString();
        android.database.Cursor v1_7 = new StringBuilder();
        v1_7.append(v14);
        v1_7.append("0");
        v5_1[1] = v1_7.toString();
        android.database.Cursor v1_10 = p20.query("files", new String[] {"_id", "media_type"}), "_data >= ? AND _data < ? AND (media_type=1 OR media_type=3) AND mini_thumb_magic IS NOT NULL", v5_1, 0, 0, 0);
        if (v1_10 != null) {
            if (v1_10.getCount() != 0) {
                android.content.ContentValues v2_3 = android.net.Uri.parse("content://media/external/images/media");
                int v3_3 = android.net.Uri.parse("content://media/external/videos/media");
                while (v1_10.moveToNext()) {
                    int v8_2;
                    long v4_0 = v1_10.getLong(0);
                    long v6_1 = v1_10.getLong(v10_4);
                    int v10_1 = new StringBuilder();
                    v10_1.append("hiding image ");
                    v10_1.append(v4_0);
                    v10_1.append(", removing thumbnail");
                    android.util.Log.i(com.android.providers.media.MediaProvider.TAG, v10_1.toString());
                    if (v6_1 != 1) {
                        v8_2 = v3_3;
                    } else {
                        v8_2 = v2_3;
                    }
                    this.removeThumbnailFor(v8_2, p20, v4_0);
                    v10_4 = 1;
                }
            }
            libcore.io.IoUtils.closeQuietly(v1_10);
        }
        android.content.ContentValues v2_5 = new android.content.ContentValues();
        v2_5.put("media_type", Integer.valueOf(0));
        android.net.Uri v5_3 = new String[2];
        long v6_6 = new StringBuilder();
        v6_6.append(v14);
        v6_6.append("/");
        v5_3[0] = v6_6.toString();
        long v6_9 = new StringBuilder();
        v6_9.append(v14);
        v6_9.append("0");
        v5_3[1] = v6_9.toString();
        p19.mNumUpdates = (p19.mNumUpdates + p20.update("files", v2_5, "_data >= ? AND _data < ?", v5_3));
        this.getContext().getContentResolver().notifyChange(android.net.Uri.parse("content://media/"), 0);
        return;
    }

Method com.android.providers.media.MediaProvider.getParent() calling method android.database.sqlite.SQLiteDatabase.query()


    private long getParent(com.android.providers.media.MediaProvider$DatabaseHelper p20, android.database.sqlite.SQLiteDatabase p21, String p22)
    {
        int v4 = p22.lastIndexOf(47);
        if (v4 <= 0) {
            return 0;
        } else {
            String v7 = p22.substring(0, v4);
            int v8 = 0;
            while (v8 < this.mExternalStoragePaths.length) {
                if (!v7.equals(this.mExternalStoragePaths[v8])) {
                    v8++;
                } else {
                    return 0;
                }
            }
            try {
                Long v5_2 = ((Long) this.mDirectoryCache.get(v7));
            } catch (java.util.HashMap v0_4) {
                throw v0_4;
            }
            if (v5_2 == null) {
                long v11_2;
                String[] v15 = new String[1];
                v15[0] = v7;
                p20.mNumQueries = (p20.mNumQueries + 1);
                android.database.Cursor v9_4 = p21.query("files", com.android.providers.media.MediaProvider.sIdOnlyColumn, "_data=?", v15, 0, 0, 0);
                if (v9_4 == null) {
                    v11_2 = this.insertDirectory(p20, p21, v7);
                } else {
                    try {
                        if (v9_4.getCount() != 0) {
                            if (v9_4.getCount() > 1) {
                                android.database.sqlite.SQLiteDatabase v10_3 = new StringBuilder();
                                v10_3.append("more than one match for ");
                                v10_3.append(v7);
                                android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v10_3.toString());
                            }
                            v9_4.moveToFirst();
                            v11_2 = v9_4.getLong(0);
                        } else {
                        }
                    } catch (java.util.HashMap v0_2) {
                        libcore.io.IoUtils.closeQuietly(v9_4);
                        throw v0_2;
                    }
                }
                this.mDirectoryCache.put(v7, Long.valueOf(v11_2));
                libcore.io.IoUtils.closeQuietly(v9_4);
                return v11_2;
            } else {
                return v5_2.longValue();
            }
        }
    }

Method com.android.providers.media.MediaProvider.getObjectReferences() calling method android.database.sqlite.SQLiteDatabase.query()


    private android.database.Cursor getObjectReferences(com.android.providers.media.MediaProvider$DatabaseHelper p12, android.database.sqlite.SQLiteDatabase p13, int p14)
    {
        p12.mNumQueries = (p12.mNumQueries + 1);
        String v6_2 = new String[1];
        v6_2[0] = Integer.toString(p14);
        android.database.Cursor v0_1 = p13.query("files", com.android.providers.media.MediaProvider.sMediaTableColumns, "_id=?", v6_2, 0, 0, 0);
        try {
            if ((v0_1 == null) || (!v0_1.moveToNext())) {
                libcore.io.IoUtils.closeQuietly(v0_1);
                return 0;
            } else {
                long v3_1 = v0_1.getLong(0);
                if (v0_1.getInt(1) == 4) {
                    p12.mNumQueries = (p12.mNumQueries + 1);
                    android.database.Cursor v1_1 = new String[1];
                    v1_1[0] = Long.toString(v3_1);
                    android.database.Cursor v1_2 = p13.rawQuery("SELECT audio_id FROM audio_playlists_map WHERE playlist_id=? ORDER BY play_order", v1_1);
                    libcore.io.IoUtils.closeQuietly(v0_1);
                    return v1_2;
                } else {
                    libcore.io.IoUtils.closeQuietly(v0_1);
                    return 0;
                }
            }
        } catch (android.database.Cursor v1_3) {
            libcore.io.IoUtils.closeQuietly(v0_1);
            throw v1_3;
        }
    }

Method com.android.providers.media.MediaProvider.getKeyIdForName() calling method android.database.sqlite.SQLiteDatabase.query()


    private long getKeyIdForName(com.android.providers.media.MediaProvider$DatabaseHelper p31, android.database.sqlite.SQLiteDatabase p32, String p33, String p34, String p35, String p36, String p37, String p38, int p39, String p40, java.util.HashMap p41, android.net.Uri p42)
    {
        if ((p36 != null) && (p36.length() != 0)) {
            void v1_0 = p36;
        } else {
            v1_0 = "<unknown>";
        }
        Throwable v0_7 = android.provider.MediaStore$Audio.keyFor(v1_0);
        if (v0_7 != null) {
            boolean v18 = p33.equals("albums");
            boolean v19 = "<unknown>".equals(v1_0);
            if (v18) {
                android.database.Cursor v8_3 = new StringBuilder();
                v8_3.append(v0_7);
                v8_3.append(p39);
                v0_7 = v8_3.toString();
                if (v19) {
                    android.database.Cursor v8_6 = new StringBuilder();
                    v8_6.append(v0_7);
                    v8_6.append(p40);
                    v0_7 = v8_6.toString();
                }
            }
            android.content.ContentResolver v13_12 = v0_7;
            java.util.HashMap v12_1 = new String[1];
            v12_1[0] = v13_12;
            p31.mNumQueries = (p31.mNumQueries + 1);
            android.database.Cursor v8_10 = new StringBuilder();
            v8_10.append(p34);
            v8_10.append("=?");
            String v24 = v13_12;
            android.database.Cursor v8_12 = p32.query(p33, 0, v8_10.toString(), v12_1, 0, 0, 0);
            try {
                java.util.HashMap v12_0;
                android.content.ContentResolver v13_11;
                switch (v8_12.getCount()) {
                    case 0:
                        Throwable v0_11 = new android.content.ContentValues();
                        String v7_1;
                        v0_11.put(p34, v24);
                        v0_11.put(p35, v1_0);
                        p31.mNumInserts = (p31.mNumInserts + 1);
                        v13_11 = p32.insert(p33, "duration", v0_11);
                        if ((p38 == null) || ((!v18) || (v19))) {
                            v7_1 = p33;
                            v12_0 = p41;
                        } else {
                            v12_0 = p41;
                            v7_1 = p33;
                            this.makeThumbAsync(p31, p32, p38, v13_11);
                        }
                        if (v13_11 > 0) {
                            void v1_5 = p42.toString().substring(16, 24);
                            android.net.Uri v2_11 = new StringBuilder();
                            v2_11.append("content://media/");
                            v2_11.append(v1_5);
                            v2_11.append("/audio/");
                            v2_11.append(v7_1);
                            v2_11.append("/");
                            v2_11.append(v13_11);
                            this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_11.toString()), 0);
                        }
                        break;
                    case 1:
                        try {
                            v8_12.moveToFirst();
                            long v14_2 = v8_12.getLong(0);
                            Throwable v0_17 = v8_12.getString(2);
                            try {
                                String v10_5 = this.makeBestName(v1_0, v0_17);
                            } catch (Throwable v0_9) {
                                long v15 = v1_0;
                                java.util.HashMap v28 = v12_1;
                                java.util.HashMap v12 = p41;
                                libcore.io.IoUtils.closeQuietly(v8_12);
                                throw v0_9;
                            }
                            if (!v10_5.equals(v0_17)) {
                                android.content.ContentValues v11_1 = new android.content.ContentValues();
                                v11_1.put(p35, v10_5);
                                p31.mNumUpdates = (p31.mNumUpdates + 1);
                                android.content.ContentResolver v13_3 = new StringBuilder();
                                v13_3.append("rowid=");
                                v13_3.append(Integer.toString(((int) v14_2)));
                                p32.update(p33, v11_1, v13_3.toString(), 0);
                                try {
                                    Throwable v0_6 = p42.toString().substring(16, 24);
                                    android.net.Uri v2_2 = new StringBuilder();
                                    v2_2.append("content://media/");
                                    v2_2.append(v0_6);
                                    v2_2.append("/audio/");
                                    v2_2.append(p33);
                                    v2_2.append("/");
                                    v2_2.append(v14_2);
                                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse(v2_2.toString()), 0);
                                } catch (Throwable v0_9) {
                                    v15 = v1_0;
                                    v28 = v12_1;
                                    v12 = p41;
                                }
                            }
                            v28 = v12_1;
                            v13_11 = v14_2;
                            v12_0 = p41;
                        } catch (Throwable v0_9) {
                        }
                        break;
                    default:
                        v15 = v1_0;
                        String v10_1 = v24;
                        v12_0 = p41;
                        void v1_7 = new StringBuilder();
                        v1_7.append("Multiple entries in table ");
                        v1_7.append(p33);
                        v1_7.append(" for key ");
                        v1_7.append(v10_1);
                        android.util.Log.e(com.android.providers.media.MediaProvider.TAG, v1_7.toString());
                        v13_11 = -1;
                }
            } catch (Throwable v0_9) {
                android.content.ContentResolver v3 = p37;
                String v7 = p33;
                String v10 = v24;
            } catch (Throwable v0_9) {
            }
            Throwable v0_13 = v13_11;
            libcore.io.IoUtils.closeQuietly(v8_12);
            if ((v12_0 != null) && (!v19)) {
                v12_0.put(p37, Long.valueOf(v0_13));
            }
            return v0_13;
        } else {
            android.util.Log.e(com.android.providers.media.MediaProvider.TAG, "null key", new Exception());
            return -1;
        }
    }

Method com.android.providers.media.MediaProvider.fixParentIdIfNeeded() calling method android.database.sqlite.SQLiteDatabase.query()


    private void fixParentIdIfNeeded()
    {
        com.android.providers.media.MediaProvider$DatabaseHelper v2 = this.getDatabaseForUri(android.net.Uri.parse("content://media/external/file"));
        if (v2 != null) {
            android.database.sqlite.SQLiteDatabase v12 = v2.getWritableDatabase();
            int v11_0 = 0;
            long v14 = -1;
            int v10_0 = 0;
            String v0_9 = 1;
            while(true) {
                android.net.Uri v3_9;
                int v16 = v0_9;
                String v0_11 = new StringBuilder();
                v0_11.append("parent != 0 AND parent NOT IN (SELECT _id FROM files)");
                if (v14 >= 0) {
                    android.net.Uri v3_8 = new StringBuilder();
                    v3_8.append(" AND _id > ");
                    v3_8.append(v14);
                    v3_9 = v3_8.toString();
                } else {
                    v3_9 = "";
                }
                v0_11.append(v3_9);
                int v18 = v10_0;
                int v13_4 = v11_0;
                android.net.Uri v3_11 = v12.query("files", com.android.providers.media.MediaProvider.sDataId, v0_11.toString(), 0, 0, 0, "_id ASC", "500");
                if (v3_11 != null) {
                    try {
                        if (v3_11.getCount() == 0) {
                            break;
                        }
                        v11_0 = (v13_4 + v3_11.getCount());
                        if (v16 != 0) {
                            try {
                            } catch (String v0_5) {
                                libcore.io.IoUtils.closeQuietly(v3_11);
                                throw v0_5;
                            }
                            this.mDirectoryCache.clear();
                            v16 = 0;
                        }
                        v10_0 = v18;
                        try {
                            while (v3_11.moveToNext()) {
                                String v4_9 = v3_11.getString(0);
                                v14 = v3_11.getLong(1);
                                if (!new java.io.File(v4_9).exists()) {
                                    String v5_10 = new StringBuilder();
                                    v5_10.append("_id=");
                                    v5_10.append(v14);
                                    v12.delete("files", v5_10.toString(), 0);
                                } else {
                                    int v7_4 = this.getParent(v2, v12, v4_9);
                                    android.content.ContentValues v9_2 = new android.content.ContentValues();
                                    v9_2.put("parent", Long.valueOf(v7_4));
                                    int v13_2 = new StringBuilder();
                                    v13_2.append("_id=");
                                    v13_2.append(v14);
                                    String v0_4 = v12.update("files", v9_2, v13_2.toString(), 0);
                                    v2.mNumUpdates = (v2.mNumUpdates + v0_4);
                                    v10_0 += v0_4;
                                }
                            }
                        } catch (String v0_5) {
                        }
                        libcore.io.IoUtils.closeQuietly(v3_11);
                        v0_9 = v16;
                    } catch (String v0_5) {
                    }
                }
                String v5_5;
                libcore.io.IoUtils.closeQuietly(v3_11);
                if (v13_4 <= 0) {
                    v5_5 = v18;
                } else {
                    android.net.Uri v3_1 = new StringBuilder();
                    v3_1.append("fixParentIdIfNeeded: found: ");
                    v3_1.append(v13_4);
                    v3_1.append(", fixed: ");
                    v5_5 = v18;
                    v3_1.append(v5_5);
                    android.util.Log.d(com.android.providers.media.MediaProvider.TAG, v3_1.toString());
                }
                if (v5_5 > null) {
                    this.getContext().getContentResolver().notifyChange(android.net.Uri.parse("content://media/"), 0);
                }
                return;
            }
        } else {
            return;
        }
    }

Method com.android.providers.media.MediaProvider.dump() calling method android.database.sqlite.SQLiteDatabase.query()


    private String dump(com.android.providers.media.MediaProvider$DatabaseHelper p13, boolean p14)
    {
        StringBuilder v0_1 = new StringBuilder();
        v0_1.append(p13.mName);
        v0_1.append(": ");
        android.database.sqlite.SQLiteDatabase v1_2 = p13.getReadableDatabase();
        if (v1_2 != null) {
            android.database.Cursor v2_0 = new StringBuilder();
            v2_0.append("version ");
            v2_0.append(v1_2.getVersion());
            v2_0.append(", ");
            v0_1.append(v2_0.toString());
            android.database.Cursor v10 = v1_2.query("files", new String[] {"count(*)"}), 0, 0, 0, 0, 0);
            if ((v10 == null) || (!v10.moveToFirst())) {
                v0_1.append("couldn\'t get row count, ");
            } else {
                android.database.Cursor v2_14 = v10.getInt(0);
                String v3_11 = new StringBuilder();
                v3_11.append(v2_14);
                v3_11.append(" rows, ");
                v0_1.append(v3_11.toString());
            }
            libcore.io.IoUtils.closeQuietly(v10);
            android.database.Cursor v2_17 = new StringBuilder();
            v2_17.append(p13.mNumInserts);
            v2_17.append(" inserts, ");
            v0_1.append(v2_17.toString());
            android.database.Cursor v2_20 = new StringBuilder();
            v2_20.append(p13.mNumUpdates);
            v2_20.append(" updates, ");
            v0_1.append(v2_20.toString());
            android.database.Cursor v2_23 = new StringBuilder();
            v2_23.append(p13.mNumDeletes);
            v2_23.append(" deletes, ");
            v0_1.append(v2_23.toString());
            android.database.Cursor v2_26 = new StringBuilder();
            v2_26.append(p13.mNumQueries);
            v2_26.append(" queries, ");
            v0_1.append(v2_26.toString());
            if (p13.mScanStartTime != 0) {
                android.database.Cursor v2_32 = new StringBuilder();
                v2_32.append("scan started ");
                v2_32.append(android.text.format.DateUtils.formatDateTime(this.getContext(), (p13.mScanStartTime / 1000), 524305));
                v0_1.append(v2_32.toString());
                android.database.Cursor v2_2 = p13.mScanStopTime;
                if (v2_2 < p13.mScanStartTime) {
                    v2_2 = android.os.SystemClock.currentTimeMicro();
                }
                String v4_5 = new StringBuilder();
                v4_5.append(" (");
                v4_5.append(android.text.format.DateUtils.formatElapsedTime(((v2_2 - p13.mScanStartTime) / 1000000)));
                v4_5.append(")");
                v0_1.append(v4_5.toString());
                if (p13.mScanStopTime < p13.mScanStartTime) {
                    if ((this.mMediaScannerVolume == null) || (!p13.mName.startsWith(this.mMediaScannerVolume))) {
                        String v4_13 = new StringBuilder();
                        v4_13.append(" (scanning ");
                        v4_13.append(this.mMediaScannerVolume);
                        v4_13.append(")");
                        v0_1.append(v4_13.toString());
                    } else {
                        v0_1.append(" (ongoing)");
                    }
                }
            }
            if (p14) {
                android.database.Cursor v2_5 = v1_2.query("log", new String[] {"time", "message"}), 0, 0, 0, 0, "rowid");
                if (v2_5 != null) {
                    try {
                        while (v2_5.moveToNext()) {
                            String v3_8 = v2_5.getString(0);
                            String v4_19 = v2_5.getString(1);
                            String v5_12 = new StringBuilder();
                            v5_12.append("\n");
                            v5_12.append(v3_8);
                            v5_12.append(" : ");
                            v5_12.append(v4_19);
                            v0_1.append(v5_12.toString());
                        }
                    } catch (String v3_7) {
                        libcore.io.IoUtils.closeQuietly(v2_5);
                        throw v3_7;
                    }
                }
                libcore.io.IoUtils.closeQuietly(v2_5);
            }
        } else {
            v0_1.append("null");
        }
        return v0_1.toString();
    }

Method com.android.providers.media.MediaProvider$ScannerClient.onMediaScannerConnected() calling method android.database.sqlite.SQLiteDatabase.query()


    public void onMediaScannerConnected()
    {
        android.database.Cursor v0_0 = this.mDb;
        java.io.File v2_0 = com.android.providers.media.MediaProvider.access$1300();
        int v4_2 = new String[2];
        int v5_6 = new StringBuilder();
        v5_6.append(this.mPath);
        v5_6.append("/");
        v4_2[0] = v5_6.toString();
        int v5_2 = new StringBuilder();
        v5_2.append(this.mPath);
        v5_2.append("0");
        v4_2[1] = v5_2.toString();
        android.database.Cursor v0_1 = v0_0.query("files", v2_0, "_data >= ? AND _data < ?", v4_2, 0, 0, 0);
        try {
            while (v0_1.moveToNext()) {
                android.media.MediaScannerConnection v1_3 = v0_1.getString(0);
                if (new java.io.File(v1_3).isFile()) {
                    this.mScannerConnection.scanFile(v1_3, 0);
                }
            }
        } catch (android.media.MediaScannerConnection v1_4) {
            libcore.io.IoUtils.closeQuietly(v0_1);
            throw v1_4;
        }
        this.mScannerConnection.disconnect();
        libcore.io.IoUtils.closeQuietly(v0_1);
        return;
    }