Copyright (c) 2014, John Phillips
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
...
If you think the Android project HistoryCleanerPro listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.ayros.historycleaner.cleaning.items;
//www.java2s.comimport java.util.ArrayList;
import java.util.List;
import com.ayros.historycleaner.Globals;
import com.ayros.historycleaner.cleaning.Category;
import com.ayros.historycleaner.cleaning.CleanItem;
import com.ayros.historycleaner.helpers.DBHelper;
import com.ayros.historycleaner.helpers.Logger;
publicclass _FirefoxBeta_Cookies extends CleanItem
{
public _FirefoxBeta_Cookies(Category parent)
{
super(parent);
}
@Override
public String getDisplayName()
{
return"Cookies";
}
@Override
public String getPackageName()
{
return"org.mozilla.firefox_beta";
}
@Override
public List<String[]> getSavedData()
{
String path = _FirefoxBeta_History.getFirefoxBetaDataPath();
if (path == null)
{
Logger.error("Could not get FireFox Beta data path to view cookies");
return null;
}
elseif (path.length() == 0)
{
returnnew ArrayList<String []>();
}
return DBHelper.queryDatabase
(
Globals.getContext(),
path + "/cookies.sqlite",
new String[] { "Domain", "Cookie Name", "Cookie Value" },
"moz_cookies",
new String[] { "baseDomain", "name", "value" },
null
);
}
@Override
publicboolean clean()
{
String path = _FirefoxBeta_History.getFirefoxBetaDataPath();
if (path == null)
{
Logger.error("Could not get FireFox Beta data path to clear cookies");
return false;
}
elseif (path.length() == 0)
{
return true;
}
return DBHelper.updateDatabase
(
Globals.getContext(),
path + "/cookies.sqlite",
new String[]
{
"DELETE FROM moz_cookies;",
}
);
}
}