(File file, com.fongmi.android.tv.impl.Callback callback)
| 66 | } |
| 67 | |
| 68 | public static void restore(File file, com.fongmi.android.tv.impl.Callback callback) { |
| 69 | Task.execute(() -> { |
| 70 | File restore = Path.cache("restore"); |
| 71 | FileUtil.gzipDecompress(file, restore); |
| 72 | Backup backup = Backup.objectFrom(Path.read(restore)); |
| 73 | if (backup.getConfig().isEmpty()) { |
| 74 | App.post(callback::error); |
| 75 | } else { |
| 76 | backup.restore(); |
| 77 | Path.clear(restore); |
| 78 | App.post(callback::success); |
| 79 | } |
| 80 | }); |
| 81 | } |
| 82 | |
| 83 | private static void cleanOld() { |
| 84 | List<File> items = new ArrayList<>(); |
no test coverage detected