|
@ -41,9 +41,9 @@ import awais.instagrabber.db.repositories.RepositoryCallback; |
|
|
import awais.instagrabber.interfaces.FetchListener; |
|
|
import awais.instagrabber.interfaces.FetchListener; |
|
|
import awais.instagrabber.models.enums.FavoriteType; |
|
|
import awais.instagrabber.models.enums.FavoriteType; |
|
|
import awais.instagrabber.utils.PasswordUtils.IncorrectPasswordException; |
|
|
import awais.instagrabber.utils.PasswordUtils.IncorrectPasswordException; |
|
|
import awaisomereport.LogCollector.LogFile; |
|
|
//import awaisomereport.LogCollector.LogFile; |
|
|
|
|
|
|
|
|
import static awais.instagrabber.utils.Utils.logCollector; |
|
|
//import static awais.instagrabber.utils.Utils.logCollector; |
|
|
import static awais.instagrabber.utils.Utils.settingsHelper; |
|
|
import static awais.instagrabber.utils.Utils.settingsHelper; |
|
|
|
|
|
|
|
|
public final class ExportImportUtils { |
|
|
public final class ExportImportUtils { |
|
@ -80,8 +80,8 @@ public final class ExportImportUtils { |
|
|
throw e; |
|
|
throw e; |
|
|
} catch (final Exception e) { |
|
|
} catch (final Exception e) { |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (logCollector != null) |
|
|
// if (logCollector != null) |
|
|
logCollector.appendException(e, LogFile.UTILS_IMPORT, "Import::pass"); |
|
|
// logCollector.appendException(e, LogFile.UTILS_IMPORT, "Import::pass"); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "Error importing backup", e); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "Error importing backup", e); |
|
|
} |
|
|
} |
|
|
} else if (configType == 'Z') { |
|
|
} else if (configType == 'Z') { |
|
@ -99,7 +99,7 @@ public final class ExportImportUtils { |
|
|
throw e; |
|
|
throw e; |
|
|
} catch (final Exception e) { |
|
|
} catch (final Exception e) { |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (logCollector != null) logCollector.appendException(e, LogFile.UTILS_IMPORT, "Import"); |
|
|
// if (logCollector != null) logCollector.appendException(e, LogFile.UTILS_IMPORT, "Import"); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -122,7 +122,7 @@ public final class ExportImportUtils { |
|
|
if (fetchListener != null) fetchListener.onResult(true); |
|
|
if (fetchListener != null) fetchListener.onResult(true); |
|
|
} catch (final Exception e) { |
|
|
} catch (final Exception e) { |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (logCollector != null) logCollector.appendException(e, LogFile.UTILS_IMPORT, "importJson"); |
|
|
// if (logCollector != null) logCollector.appendException(e, LogFile.UTILS_IMPORT, "importJson"); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -241,8 +241,8 @@ public final class ExportImportUtils { |
|
|
exportBytes = PasswordUtils.enc(exportString, bytes); |
|
|
exportBytes = PasswordUtils.enc(exportString, bytes); |
|
|
} catch (final Exception e) { |
|
|
} catch (final Exception e) { |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (logCollector != null) |
|
|
// if (logCollector != null) |
|
|
logCollector.appendException(e, LogFile.UTILS_EXPORT, "Export::isPass"); |
|
|
// logCollector.appendException(e, LogFile.UTILS_EXPORT, "Export::isPass"); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
@ -255,8 +255,8 @@ public final class ExportImportUtils { |
|
|
if (fetchListener != null) fetchListener.onResult(true); |
|
|
if (fetchListener != null) fetchListener.onResult(true); |
|
|
} catch (final Exception e) { |
|
|
} catch (final Exception e) { |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (fetchListener != null) fetchListener.onResult(false); |
|
|
if (logCollector != null) |
|
|
// if (logCollector != null) |
|
|
logCollector.appendException(e, LogFile.UTILS_EXPORT, "Export::notPass"); |
|
|
// logCollector.appendException(e, LogFile.UTILS_EXPORT, "Export::notPass"); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
} |
|
|
} |
|
|
} else if (fetchListener != null) fetchListener.onResult(false); |
|
|
} else if (fetchListener != null) fetchListener.onResult(false); |
|
@ -324,7 +324,7 @@ public final class ExportImportUtils { |
|
|
}, AppExecutors.getInstance().tasksThread()); |
|
|
}, AppExecutors.getInstance().tasksThread()); |
|
|
return; |
|
|
return; |
|
|
} catch (final Exception e) { |
|
|
} catch (final Exception e) { |
|
|
if (logCollector != null) logCollector.appendException(e, LogFile.UTILS_EXPORT, "getExportString"); |
|
|
// if (logCollector != null) logCollector.appendException(e, LogFile.UTILS_EXPORT, "getExportString"); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
if (BuildConfig.DEBUG) Log.e(TAG, "", e); |
|
|
} |
|
|
} |
|
|
callback.onCreated(null); |
|
|
callback.onCreated(null); |
|
@ -373,9 +373,9 @@ public final class ExportImportUtils { |
|
|
jsonArray.put(jsonObject); |
|
|
jsonArray.put(jsonObject); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
if (logCollector != null) { |
|
|
// if (logCollector != null) { |
|
|
logCollector.appendException(e, LogFile.UTILS_EXPORT, "getFavorites"); |
|
|
// logCollector.appendException(e, LogFile.UTILS_EXPORT, "getFavorites"); |
|
|
} |
|
|
// } |
|
|
if (BuildConfig.DEBUG) { |
|
|
if (BuildConfig.DEBUG) { |
|
|
Log.e(TAG, "Error exporting favorites", e); |
|
|
Log.e(TAG, "Error exporting favorites", e); |
|
|
} |
|
|
} |
|
@ -409,9 +409,9 @@ public final class ExportImportUtils { |
|
|
jsonArray.put(jsonObject); |
|
|
jsonArray.put(jsonObject); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
if (logCollector != null) { |
|
|
// if (logCollector != null) { |
|
|
logCollector.appendException(e, LogFile.UTILS_EXPORT, "getCookies"); |
|
|
// logCollector.appendException(e, LogFile.UTILS_EXPORT, "getCookies"); |
|
|
} |
|
|
// } |
|
|
if (BuildConfig.DEBUG) { |
|
|
if (BuildConfig.DEBUG) { |
|
|
Log.e(TAG, "Error exporting accounts", e); |
|
|
Log.e(TAG, "Error exporting accounts", e); |
|
|
} |
|
|
} |
|
|
xxxxxxxxxx