mirror of
https://github.com/izzy2lost/aab2apk.git
synced 2026-06-19 01:20:08 -07:00
Added New File Option Enable Disable to Unzip and Delete Apks File.
This commit is contained in:
@@ -52,6 +52,7 @@ fun App(fileStorageHelper: FileStorageHelper, savedPath: String?) {
|
||||
var keyStorePassword by remember { mutableStateOf("") }
|
||||
var keyAlias by remember { mutableStateOf("") }
|
||||
var keyPassword by remember { mutableStateOf("") }
|
||||
var isAutoUnzip by remember { mutableStateOf(true) }
|
||||
|
||||
savedPath?.let {
|
||||
bundletoolPath = it
|
||||
@@ -96,7 +97,7 @@ fun App(fileStorageHelper: FileStorageHelper, savedPath: String?) {
|
||||
if (savedPath == null) {
|
||||
fileStorageHelper.save("path", bundletoolPath)
|
||||
} else {
|
||||
if(fileStorageHelper.delete("path"))
|
||||
if (fileStorageHelper.delete("path"))
|
||||
saveJarPath = false
|
||||
}
|
||||
|
||||
@@ -117,10 +118,16 @@ fun App(fileStorageHelper: FileStorageHelper, savedPath: String?) {
|
||||
Log.i("Command Executed in ${((endTime - startTime) / 1000)}s")
|
||||
logs += "\nCommand Executed in ${((endTime - startTime) / 1000)}s\n"
|
||||
// Do further file operation after new apks is generated
|
||||
FileHelper.performFileOperations(aabFilePath.first, aabFilePath.second) { status, message ->
|
||||
// From Auto Zip you can control further file operations.
|
||||
if (isAutoUnzip) {
|
||||
FileHelper.performFileOperations(aabFilePath.first, aabFilePath.second) { status, message ->
|
||||
isLoading = false
|
||||
Log.i("STATUS - $status\nMESSAGE - $message")
|
||||
logs += "\nFiles Operations Starting...\n$message\n"
|
||||
}
|
||||
} else {
|
||||
logs += "\nFile will be saved at ${aabFilePath.first.removeSuffix("\\")}.\n"
|
||||
isLoading = false
|
||||
Log.i("STATUS - $status\nMESSAGE - $message")
|
||||
logs += "\nFiles Operations Starting...\n$message\n"
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
@@ -316,6 +323,19 @@ fun App(fileStorageHelper: FileStorageHelper, savedPath: String?) {
|
||||
)
|
||||
}
|
||||
}
|
||||
Text(
|
||||
text = Strings.FILE_OPTIONS,
|
||||
style = Styles.TextStyleBold(16.sp),
|
||||
modifier = Modifier.padding(start = 16.dp, top = 8.dp, end = 16.dp, bottom = 8.dp)
|
||||
)
|
||||
CheckboxWithText(
|
||||
Strings.AUTO_UNZIP,
|
||||
isAutoUnzip,
|
||||
onCheckedChange = {
|
||||
isAutoUnzip = it
|
||||
},
|
||||
Strings.AUTO_UNZIP
|
||||
)
|
||||
Spacer(modifier = Modifier.padding(8.dp))
|
||||
if (isLoading) {
|
||||
CircularProgressIndicator(
|
||||
|
||||
@@ -12,7 +12,7 @@ object FileHelper {
|
||||
Log.i("CHANGED NAME\n Unzipping...")
|
||||
try {
|
||||
FileUtils.unzip(newFile, directory)
|
||||
fileStatus.invoke(Constant.SUCCESS, "Rename and Unzip Successful")
|
||||
fileStatus.invoke(Constant.SUCCESS, "Rename and Unzip Successful\nFile Saved at ${directory.removeSuffix("\\")}.")
|
||||
Log.i("TRYING DELETING FILE")
|
||||
val value = FileUtils.deleteFile(newFile)
|
||||
Log.i("DELETE STATUS : $value")
|
||||
|
||||
@@ -27,4 +27,7 @@ object Strings {
|
||||
const val KEY_ALIAS = "Key Alias"
|
||||
const val KEY_PASSWORD = "Key Password"
|
||||
const val EXECUTE = "Execute"
|
||||
const val FILE_OPTIONS = "File Options"
|
||||
const val AUTO_UNZIP = "Automatically Unzip and Delete Apks File"
|
||||
const val AUTO_UNZIP_INFO = "Automatically Unzip and Delete Apks File"
|
||||
}
|
||||
Reference in New Issue
Block a user