// Path: app/src/main/java/com/pindroid/providers/ContentNotFoundException.java
// public class ContentNotFoundException extends Exception {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 2493195718128847571L;
// 
// }
// 
// Path: app/src/main/java/com/pindroid/util/Md5Hash.java
// public class Md5Hash {
// 
// 	public static String md5(String s){
// 	    try {
// 	        // Create MD5 Hash
// 	        MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
// 	        digest.update(s.getBytes());
// 	        byte messageDigest[] = digest.digest();
// 	        
// 	        // Create Hex String
// 	        StringBuffer hexString = new StringBuffer();
// 	        for (int i = 0; i < messageDigest.length; i++) {
//                 String h = Integer.toHexString(0xFF & messageDigest[i]);
//                 while (h.length() < 2) h = "0" + h;
//                     hexString.append(h);
// 	        }
// 
// 	        return hexString.toString();
// 	        
// 	    } catch (NoSuchAlgorithmException e) {
// 	        e.printStackTrace();
// 	    }
// 	    return "";
// 	}
// }


import android.database.Cursor;
import android.net.Uri;
import android.provider.BaseColumns;
import android.support.v4.content.CursorLoader;
import android.text.TextUtils;
import java.util.ArrayList;
import com.pindroid.providers.ContentNotFoundException;
import com.pindroid.providers.BookmarkContent.Bookmark;
import com.pindroid.util.Md5Hash;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;


		Cursor c = context.getContentResolver().query(bookmarks, projection, selection, selectionargs, null);				

		if(c.moveToFirst()){
			int idColumn = c.getColumnIndex(Bookmark._ID);
			int urlColumn = c.getColumnIndex(Bookmark.Url);
			int descriptionColumn = c.getColumnIndex(Bookmark.Description);
			int tagsColumn = c.getColumnIndex(Bookmark.Tags);
			int metaColumn = c.getColumnIndex(Bookmark.Meta);
			int readColumn = c.getColumnIndex(Bookmark.ToRead);
			int shareColumn = c.getColumnIndex(Bookmark.Shared);
			int notesColumn = c.getColumnIndex(Bookmark.Notes);
			int hashColumn = c.getColumnIndex(Bookmark.Hash);

			do {

				Bookmark b = new Bookmark(c.getInt(idColumn), "", c.getString(urlColumn), 
						c.getString(descriptionColumn), c.getString(notesColumn), c.getString(tagsColumn), c.getString(hashColumn), 
						c.getString(metaColumn), 0, c.getInt(readColumn) == 0 ? false : true,
						c.getInt(shareColumn) == 0 ? false : true, 0, true);

				bookmarkList.add(b);

			} while(c.moveToNext());

		}
		c.close();
		return bookmarkList;
	}
	

// Path: app/src/main/java/com/pindroid/providers/ContentNotFoundException.java
// public class ContentNotFoundException extends Exception {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 2493195718128847571L;
// 
// }
// 
// Path: app/src/main/java/com/pindroid/util/Md5Hash.java
// public class Md5Hash {
// 
// 	public static String md5(String s){
// 	    try {
// 	        // Create MD5 Hash
// 	        MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
// 	        digest.update(s.getBytes());
// 	        byte messageDigest[] = digest.digest();
// 	        
// 	        // Create Hex String
// 	        StringBuffer hexString = new StringBuffer();
// 	        for (int i = 0; i < messageDigest.length; i++) {
//                 String h = Integer.toHexString(0xFF & messageDigest[i]);
//                 while (h.length() < 2) h = "0" + h;
//                     hexString.append(h);
// 	        }
// 
// 	        return hexString.toString();
// 	        
// 	    } catch (NoSuchAlgorithmException e) {
// 	        e.printStackTrace();
// 	    }
// 	    return "";
// 	}
// }


// Path: app/src/main/java/com/pindroid/platform/BookmarkManager.java
import android.database.Cursor;
import android.net.Uri;
import android.provider.BaseColumns;
import android.support.v4.content.CursorLoader;
import android.text.TextUtils;
import java.util.ArrayList;
import com.pindroid.providers.ContentNotFoundException;
import com.pindroid.providers.BookmarkContent.Bookmark;
import com.pindroid.util.Md5Hash;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;


		Cursor c = context.getContentResolver().query(bookmarks, projection, selection, selectionargs, null);				

		if(c.moveToFirst()){
			int idColumn = c.getColumnIndex(Bookmark._ID);
			int urlColumn = c.getColumnIndex(Bookmark.Url);
			int descriptionColumn = c.getColumnIndex(Bookmark.Description);
			int tagsColumn = c.getColumnIndex(Bookmark.Tags);
			int metaColumn = c.getColumnIndex(Bookmark.Meta);
			int readColumn = c.getColumnIndex(Bookmark.ToRead);
			int shareColumn = c.getColumnIndex(Bookmark.Shared);
			int notesColumn = c.getColumnIndex(Bookmark.Notes);
			int hashColumn = c.getColumnIndex(Bookmark.Hash);

			do {

				Bookmark b = new Bookmark(c.getInt(idColumn), "", c.getString(urlColumn), 
						c.getString(descriptionColumn), c.getString(notesColumn), c.getString(tagsColumn), c.getString(hashColumn), 
						c.getString(metaColumn), 0, c.getInt(readColumn) == 0 ? false : true,
						c.getInt(shareColumn) == 0 ? false : true, 0, true);

				bookmarkList.add(b);

			} while(c.moveToNext());

		}
		c.close();
		return bookmarkList;
	}
	

	public static Bookmark GetById(int id, Context context) throws ContentNotFoundException {		
