forked from REAndroid/APKEditor
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated REAndroid APKEditor and dependencies Try to fix a bug with black theme on Android < 8 Try to fix a bug with saving without signing Add option to force merge files with mismatched version code or package name Changed the app icon
- Loading branch information
1 parent
04170af
commit 995cc9c
Showing
1,714 changed files
with
1,095 additions
and
217,640 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 0 additions & 34 deletions
34
app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/IconsHelper.java
This file was deleted.
Oops, something went wrong.
348 changes: 185 additions & 163 deletions
348
app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/MainActivity.java
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/MismatchedSplitsException.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
app/src/main/java/com/abdurazaaqmohammed/utils/FileUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package com.abdurazaaqmohammed.utils; | ||
|
||
|
||
import android.content.Context; | ||
|
||
import org.apache.commons.io.FilenameUtils; | ||
|
||
import java.io.File; | ||
import java.io.FileInputStream; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
|
||
public class FileUtils { | ||
|
||
public static File copyFileFromAssetsAndGetFile(String fileName, Context context) throws IOException { | ||
File destinationFile = new File(context.getFilesDir(), fileName); | ||
if(!destinationFile.exists()) try(InputStream is = context.getAssets().open(fileName)) { | ||
copyFile(is, destinationFile); | ||
} | ||
return destinationFile; | ||
} | ||
|
||
public static File getUnusedFile(File file) { | ||
int i = 0; | ||
while(file.exists()) { | ||
i++; | ||
String fileName = file.getName(); | ||
String extension = FilenameUtils.getExtension(fileName); | ||
file = new File(file.getParentFile(), fileName.replace(extension, "").replaceFirst("_\\d+$", "") + '_' + i + '.' + extension); | ||
} | ||
return file; | ||
} | ||
|
||
public static File getUnusedFile(String file) { | ||
return getUnusedFile(new File(file)); | ||
} | ||
|
||
public static OutputStream getOutputStream(String filepath) throws IOException { | ||
return getOutputStream(new File(filepath)); | ||
} | ||
|
||
public static void copyFile(File sourceFile, File destinationFile) throws IOException { | ||
try (InputStream is = getInputStream(sourceFile); | ||
OutputStream os = getOutputStream(destinationFile)) { | ||
copyFile(is, os); | ||
} | ||
} | ||
|
||
public static void copyFile(InputStream is, OutputStream os) throws IOException { | ||
if(LegacyUtils.supportsWriteExternalStorage) { | ||
byte[] buffer = new byte[1024]; | ||
int length; | ||
while ((length = is.read(buffer)) > 0) os.write(buffer, 0, length); | ||
} else android.os.FileUtils.copy(is, os); | ||
} | ||
|
||
public static InputStream getInputStream(File file) throws IOException { | ||
return LegacyUtils.supportsFileChannel ? | ||
StreamBackups.getInputStream(file) | ||
: new FileInputStream(file); | ||
} | ||
|
||
public static InputStream getInputStream(String filePath) throws IOException { | ||
return getInputStream(new File(filePath)); | ||
} | ||
|
||
public static void copyFile(InputStream is, File destinationFile) throws IOException { | ||
try (OutputStream os = getOutputStream(destinationFile)) { | ||
copyFile(is, os); | ||
} | ||
} | ||
|
||
public static void copyFile(File in, OutputStream os) throws IOException { | ||
try(InputStream is = getInputStream(in)) { | ||
copyFile(is, os); | ||
} | ||
} | ||
|
||
public static OutputStream getOutputStream(File file) throws IOException { | ||
return LegacyUtils.supportsFileChannel ? | ||
StreamBackups.getOutputStream(file) | ||
: new FileOutputStream(file); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...qmohammed/AntiSplit/main/LegacyUtils.java → ...abdurazaaqmohammed/utils/LegacyUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.abdurazaaqmohammed.AntiSplit.main; | ||
package com.abdurazaaqmohammed.utils; | ||
|
||
import android.os.Build; | ||
|
||
|
60 changes: 60 additions & 0 deletions
60
app/src/main/java/com/abdurazaaqmohammed/utils/RunUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.abdurazaaqmohammed.utils; | ||
|
||
|
||
import android.os.Handler; | ||
import android.text.TextUtils; | ||
import android.widget.Toast; | ||
|
||
import com.abdurazaaqmohammed.AntiSplit.main.MainActivity; | ||
|
||
import java.util.concurrent.Callable; | ||
import java.util.concurrent.ExecutorService; | ||
import java.util.concurrent.Executors; | ||
import java.util.concurrent.Future; | ||
|
||
public class RunUtil { | ||
|
||
private final Handler handler; | ||
private final MainActivity context; | ||
private final CharSequence msg; | ||
|
||
public RunUtil(MainActivity context) { | ||
this(null, context, null); | ||
} | ||
|
||
public RunUtil(Handler handler, MainActivity context, CharSequence msg) { | ||
this.handler = handler; | ||
this.context = context; | ||
this.msg = msg; | ||
} | ||
|
||
public void runInBackground(Callable<Boolean> callable) { | ||
ExecutorService executor = Executors.newSingleThreadExecutor(); | ||
Future<Boolean> future = executor.submit(callable); | ||
|
||
executor.submit(() -> { | ||
try { | ||
Boolean success = future.get(); | ||
|
||
if (success && handler != null && !TextUtils.isEmpty(msg)) | ||
handler.post(() -> Toast.makeText(context, msg, Toast.LENGTH_SHORT).show()); | ||
} catch (Exception e) { | ||
(context).showError(e); | ||
} | ||
}); | ||
} | ||
|
||
public void runInBackground(Callable<Boolean> callable, Runnable doAfter, boolean onlyIfSuccessful) { | ||
ExecutorService executor = Executors.newSingleThreadExecutor(); | ||
Future<Boolean> future = executor.submit(callable); | ||
|
||
executor.submit(() -> { | ||
try { | ||
if (future.get() && handler != null) handler.post(doAfter); | ||
} catch (Exception e) { | ||
if (!onlyIfSuccessful && handler != null) handler.post(doAfter); | ||
(context).showError(e); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.