正在查看: Fancy Optimizer v4.6.3 应用的 ClearWebBrowserHistoriesService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Fancy Optimizer v4.6.3 应用的 ClearWebBrowserHistoriesService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.fancyclean.boost.securebrowser.service;
import ak.a;
import android.content.Intent;
import android.database.Cursor;
import android.support.v4.media.b;
import androidx.annotation.NonNull;
import androidx.core.app.ThinkJobIntentService;
import java.io.File;
import kb.e;
import lb.f;
import vj.h;
public class ClearWebBrowserHistoriesService extends ThinkJobIntentService {
public static final h c = h.f(ClearWebBrowserHistoriesService.class);
public final void a(@NonNull Cursor cursor) {
a f = f.f(this);
getApplicationContext();
if (cursor.moveToFirst()) {
int columnIndex = cursor.getColumnIndex("_id");
int columnIndex2 = cursor.getColumnIndex("host");
do {
long j = cursor.getLong(columnIndex);
String string = cursor.getString(columnIndex2);
int i = 0;
f.getWritableDatabase().delete("browser_history", "_id=?", new String[]{String.valueOf(j)});
Cursor cursor2 = null;
try {
Cursor query = f.getReadableDatabase().query("browser_history", new String[]{"COUNT(*) AS host_count"}, "host = ?", new String[]{string}, null, null, null);
if (query != null) {
try {
if (query.moveToFirst()) {
i = query.getInt(query.getColumnIndex("host_count"));
}
} catch (Throwable th) {
th = th;
cursor2 = query;
if (cursor2 != null) {
cursor2.close();
}
throw th;
}
}
if (query != null) {
query.close();
}
if (i <= 0) {
c.c(b.l("Delete fav icon, urlHost: ", string));
e.b().getClass();
File a = e.a(string);
if (a != null && a.exists() && !a.delete()) {
e.a.d("Fail to delete fav icon file, path: " + a.getAbsolutePath(), (Throwable) null);
}
}
} catch (Throwable th2) {
th = th2;
}
} while (cursor.moveToNext());
}
}
public final void onHandleWork(@NonNull Intent intent) {
Cursor cursor;
Cursor cursor2;
boolean booleanExtra = intent.getBooleanExtra("clear_all", false);
h hVar = c;
if (booleanExtra) {
a f = f.f(this);
getApplicationContext();
hVar.i("Browsing history cleared, rows: " + f.getWritableDatabase().delete("browser_history", null, null));
hVar.i("Clear all fav icons");
e.b().getClass();
ml.h.d(new File(kb.h.c()));
e.b().getClass();
ml.h.d(new File(kb.h.d()));
return;
}
e.b().getClass();
ml.h.d(new File(kb.h.d()));
a f10 = f.f(this);
getApplicationContext();
try {
long currentTimeMillis = System.currentTimeMillis() - 5184000000L;
cursor = f10.getReadableDatabase().query("browser_history", new String[]{"_id", "host"}, "last_visit_time_utc < ?", new String[]{String.valueOf(currentTimeMillis)}, null, null, "last_visit_time_utc DESC");
if (cursor != null) {
try {
hVar.i("Delete browser histories too early, timeThreshold: " + currentTimeMillis + ", rows: " + cursor.getCount());
a(cursor);
} catch (Throwable th) {
th = th;
if (cursor != null) {
cursor.close();
}
throw th;
}
}
if (cursor != null) {
cursor.close();
cursor = null;
}
try {
Cursor query = f10.getReadableDatabase().query("browser_history", new String[]{"last_visit_time_utc"}, null, null, null, null, "last_visit_time_utc DESC", String.valueOf(2000L));
if (query != null && query.moveToLast()) {
long j = query.getLong(query.getColumnIndex("last_visit_time_utc"));
hVar.i("Delete browser histories too many, keptRows: 2000, timeThreshold: " + j);
try {
cursor2 = f10.getReadableDatabase().query("browser_history", new String[]{"_id", "host"}, "last_visit_time_utc < ?", new String[]{String.valueOf(j)}, null, null, "last_visit_time_utc DESC");
if (cursor2 != null) {
try {
hVar.i("Delete browser histories too early, timeThreshold: " + j + ", rows: " + cursor2.getCount());
a(cursor2);
} catch (Throwable th2) {
th = th2;
throw th;
}
}
if (cursor2 != null) {
cursor2.close();
}
} catch (Throwable th3) {
th = th3;
cursor2 = null;
}
}
if (query != null) {
query.close();
}
} finally {
if (cursor != null) {
cursor.close();
}
}
} catch (Throwable th4) {
th = th4;
cursor = null;
}
}
}