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
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
Expand All @@ -25,4 +26,4 @@
</intent-filter>
</activity>
</application>
</manifest>
</manifest>
3 changes: 2 additions & 1 deletion app/src/main/java/com/kuro/signreader/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.content.pm.Signature;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.util.Base64;
import android.view.View;
import android.widget.Button;
Expand Down Expand Up @@ -89,7 +90,7 @@ public void onClick(View view) {
StringBuilder sb = new StringBuilder();
sb.append(resultBase64.getText().toString() + "\n");
sb.append(resultCpp.getText().toString() + "\n");
FileOutputStream fos = new FileOutputStream(new File("/sdcard", path));
FileOutputStream fos = new FileOutputStream(new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), path));
fos.write(sb.toString().getBytes());
fos.close();
Toast.makeText(MainActivity.this, "Saved to " + path, Toast.LENGTH_SHORT).show();
Expand Down