Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void restore() {
- File backupFolder = new File(getBackupFolder());
- if(!backupFolder.exists() || !backupFolder.isDirectory() ||
- !backupFolder.canWrite()){
- Log.w(TAG,
- backupFolder
- + " either does not exist or is not a directory or not writable!");
- }
- ShellCommand sc = new ShellCommand();
- FileInputStream fis = null;
- FileOutputStream fos = null;
- try{
- for(File font : backupFolder.listFiles()){
- if(font.isDirectory()){
- continue;
- }
- fis = new FileInputStream(font);
- fos = new FileOutputStream(new File("/system/fonts" + font.getName()));
- sc.su.run("mount -o remount, rw" + getSystemPartion() + "/system");
- IOUtils.copy(fis, fos);
- }
- }catch (Exception ex) {
- notifyUser(ex.getMessage());
- }finally{
- IOUtils.closeQuietly(fis);
- IOUtils.closeQuietly(fos);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement