Skip to content

Commit

Permalink
escape backup file name
Browse files Browse the repository at this point in the history
increment version
  • Loading branch information
Aefyr committed Sep 29, 2019
1 parent b5eb6dd commit 63b7f48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.aefyr.sai"
minSdkVersion 21
targetSdkVersion 28
versionCode 36
versionName "2.6"
versionCode 37
versionName "2.7"
}
buildTypes {
release {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/aefyr/sai/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ public static File createBackupFile(Context c, PackageMeta packageMeta) {
if (backupFileName.length() > 160)
backupFileName = backupFileName.substring(0, 160);

File backupFile = new File(backupsDir, String.format("%s.apks", backupFileName));
File backupFile = new File(backupsDir, escapeFileName(String.format("%s.apks", backupFileName)));
int suffix = 0;
while (backupFile.exists()) {
suffix++;
backupFile = new File(backupsDir, String.format("%s(%d).apks", backupFileName, suffix));
backupFile = new File(backupsDir, escapeFileName(String.format("%s(%d).apks", backupFileName, suffix)));
}

try {
Expand Down

0 comments on commit 63b7f48

Please sign in to comment.