Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProofMode crashes consistently when generating proof #91

Closed
benhylau opened this issue Apr 25, 2022 · 7 comments
Closed

ProofMode crashes consistently when generating proof #91

benhylau opened this issue Apr 25, 2022 · 7 comments

Comments

@benhylau
Copy link

I am getting this whenever I try to generate a proof by going to Gallery, then sharing a photo to ProofMode and selecting SHARE ROBUST. My phone is a Nokia 6.1 running Android 10. The version of ProofMode is just downloaded fresh from Play store.

04-25 01:27:39.696 15558 15593 E AndroidRuntime: FATAL EXCEPTION: Thread-3
04-25 01:27:39.696 15558 15593 E AndroidRuntime: Process: org.witness.proofmode, PID: 15558
04-25 01:27:39.696 15558 15593 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.File.exists()' on a null object reference
04-25 01:27:39.696 15558 15593 E AndroidRuntime:        at org.witness.proofmode.ShareProofActivity.generateProofOutput(ShareProofActivity.java:657)
04-25 01:27:39.696 15558 15593 E AndroidRuntime:        at org.witness.proofmode.ShareProofActivity.shareProofClassic(ShareProofActivity.java:626)
04-25 01:27:39.696 15558 15593 E AndroidRuntime:        at org.witness.proofmode.ShareProofActivity.processUri(ShareProofActivity.java:564)
04-25 01:27:39.696 15558 15593 E AndroidRuntime:        at org.witness.proofmode.ShareProofActivity.shareProofAsync(ShareProofActivity.java:378)
04-25 01:27:39.696 15558 15593 E AndroidRuntime:        at org.witness.proofmode.ShareProofActivity.lambda$shareProof$2$org-witness-proofmode-ShareProofActivity(ShareProofActivity.java:305)
04-25 01:27:39.696 15558 15593 E AndroidRuntime:        at org.witness.proofmode.ShareProofActivity$$ExternalSyntheticLambda5.run(Unknown Source:6)
04-25 01:27:39.696 15558 15593 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:919)
04-25 01:27:39.699  1708 15594 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
04-25 01:27:39.699  1708  1764 W ActivityTaskManager:   Force finishing activity org.witness.proofmode/.ShareProofActivity
04-25 01:27:39.600  3644  5936 D FileOperator: Mode change to WRITE_MODE!
04-25 01:27:39.701  1708  1764 D ActivityTrigger: ActivityTrigger activityPauseTrigger
04-25 01:27:39.707  1708  1848 I ActivityManager: Showing crash dialog for package org.witness.proofmode u0

Choosing SHARE BASIC also does not work. I cannot generate a proof in any way.

@n8fr8
Copy link
Member

n8fr8 commented Apr 25, 2022

I don't understand how you are getting a null pointer there...

@n8fr8 n8fr8 added this to the Winter Sprint 2022 milestone Apr 25, 2022
@n8fr8
Copy link
Member

n8fr8 commented Apr 25, 2022

One clue is that the primary shareProof method isn't working, and it is falling back to "shareProofClassic" secondary approach.

@makew0rld
Copy link

makew0rld commented Apr 26, 2022

I did not experience this issue. Sharing a photo from my gallery, I was able to generate a robust proof and then share it with Signal. No crashing or issues.

Samsung Galaxy A50, Android 11, Proofmode 0.0.14-RC-3

@benhylau
Copy link
Author

benhylau commented Apr 26, 2022

I am on 0.0.14-RC-3 so fileMediaNotary is null here. The null is passed from here 😅

Related question. Why does my phone consistently fail shareProof?

        File fileMedia = new File(mediaPath);
        result = shareProof(mediaUri, fileMedia, shareUris, sb, fBatchProofOut, shareMedia);

        if (!result)
            result = shareProofClassic(mediaUri, mediaPath, shareUris, sb, fBatchProofOut, shareMedia);

See: https://github.com/guardianproject/proofmode/blob/0.0.14-RC-3/app/src/main/java/org/witness/proofmode/ShareProofActivity.java#L560-L564

@n8fr8
Copy link
Member

n8fr8 commented Apr 26, 2022

Thanks @benhylau . I was looking at a different branch of code, so had my line numbers off. Definitely shouldn't be null, and glad we can make a quick fix.

As for what shareProof fails... I'll add some more debugging so we can make it more important exactly what is failing. It could be related to some kind of post-processing of the photo (HDR, exif injection), it could be related to where it is storing the file (external vs internal), or the inability to persist the proof hash data.

@n8fr8
Copy link
Member

n8fr8 commented Apr 26, 2022

(Also another reason to convert all this code to Kotlin asap)

@n8fr8
Copy link
Member

n8fr8 commented Apr 27, 2022

New release for testing: https://github.com/guardianproject/proofmode/releases/tag/0.0.15-BETA-1

Resolves this.

@n8fr8 n8fr8 closed this as completed Apr 27, 2022
n8fr8 added a commit that referenced this issue Apr 27, 2022
…ms vs file paths

- whenever possible use URIs, only access via filepaths in order to get extra metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants