Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# APKSignReader
A tool to read Signature on installed APKs
A tool to read Signature on installed APKs. By providing the target package name the app will read its signatures and save to `/sdcard/Android/data/com.kuro.signreader/files/<package_name>_signatures.txt`
Binary file added app/.DS_Store
Binary file not shown.
Binary file added app/src/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
<application
android:allowBackup="true"
android:requestLegacyExternalStorage="true"
Expand Down
16 changes: 10 additions & 6 deletions app/src/main/java/com/kuro/signreader/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,20 @@ public void onClick(View view) {
@Override
public void onClick(View view) {
try {
String path = appPkg.getText().toString() + "_signatures.txt";
String filename = appPkg.getText().toString() + "_signatures.txt";
File outputFile = new File(getExternalFilesDir(null), filename);
FileOutputStream fos = new FileOutputStream(outputFile);

StringBuilder sb = new StringBuilder();
sb.append(resultBase64.getText().toString() + "\n");
sb.append(resultCpp.getText().toString() + "\n");
FileOutputStream fos = new FileOutputStream(new File("/sdcard", path));
sb.append(resultBase64.getText().toString()).append("\n");
sb.append(resultCpp.getText().toString()).append("\n");

fos.write(sb.toString().getBytes());
fos.close();
Toast.makeText(MainActivity.this, "Saved to " + path, Toast.LENGTH_SHORT).show();

Toast.makeText(MainActivity.this, "Saved to " + outputFile.getAbsolutePath(), Toast.LENGTH_SHORT).show();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(MainActivity.this, "Failed to save: " + e.getMessage(), Toast.LENGTH_LONG).show();
}
}
});
Expand Down