Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvements to libProofMode use and setup
- Loading branch information
Showing
7 changed files
with
87 additions
and
42 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
56 changes: 56 additions & 0 deletions
56
android-libproofmode/src/main/java/org/witness/proofmode/ProofMode.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,56 @@ | ||
package org.witness.proofmode; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
|
||
import org.spongycastle.jce.provider.BouncyCastleProvider; | ||
import org.witness.proofmode.service.MediaListenerService; | ||
import org.witness.proofmode.service.MediaWatcher; | ||
import org.witness.proofmode.service.PhotosContentJob; | ||
import org.witness.proofmode.service.VideosContentJob; | ||
import org.witness.proofmode.util.SafetyNetCheck; | ||
|
||
import java.io.File; | ||
import java.security.Security; | ||
|
||
public class ProofMode { | ||
|
||
|
||
public final static String PROOF_FILE_TAG = ".proof.csv"; | ||
public final static String OPENPGP_FILE_TAG = ".asc"; | ||
|
||
static { | ||
Security.addProvider(new BouncyCastleProvider()); | ||
} | ||
|
||
private static boolean mInit = false; | ||
|
||
public synchronized static void init (Context context) | ||
{ | ||
if (mInit) | ||
return; | ||
|
||
if (android.os.Build.VERSION.SDK_INT >= 24) { | ||
PhotosContentJob.scheduleJob(context); | ||
VideosContentJob.scheduleJob(context); | ||
} | ||
else | ||
{ | ||
context.startService(new Intent(context, MediaListenerService.class)); | ||
} | ||
|
||
SafetyNetCheck.buildGoogleApiClient(context); | ||
|
||
mInit = true; | ||
} | ||
|
||
public static void generateProof (Context context, Uri uri) | ||
{ | ||
Intent intent = new Intent(); | ||
intent.setData(uri); | ||
new MediaWatcher().handleIntent(context, intent, true); | ||
} | ||
|
||
|
||
} |
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