File tree Expand file tree Collapse file tree
src/de/halirutan/mathematica/errorreporting Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121
2222package de .halirutan .mathematica .errorreporting ;
2323
24+ import com .intellij .openapi .diagnostic .Logger ;
2425import com .intellij .openapi .diagnostic .SubmittedReportInfo ;
2526import com .intellij .openapi .diagnostic .SubmittedReportInfo .SubmissionStatus ;
2627import org .eclipse .egit .github .core .Issue ;
@@ -59,14 +60,16 @@ private AnonymousFeedback() {
5960 * of the created issue.
6061 */
6162 static SubmittedReportInfo sendFeedback (LinkedHashMap <String , String > environmentDetails ) {
63+ final Logger myLogger = Logger .getInstance (AnonymousFeedback .class .getName ());
6264
6365 final SubmittedReportInfo result ;
6466 try {
6567 final URL resource = AnonymousFeedback .class .getClassLoader ().getResource (tokenFile );
6668 if (resource == null ) {
69+ myLogger .info ("Could not find token file" );
6770 throw new IOException ("Could not decrypt access token" );
6871 }
69- final String gitAccessToken = GitHubAccessTokenScrambler .decrypt (resource . getFile () );
72+ final String gitAccessToken = GitHubAccessTokenScrambler .decrypt (resource );
7073 GitHubClient client = new GitHubClient ();
7174 client .setOAuth2Token (gitAccessToken );
7275 RepositoryId repoID = new RepositoryId (gitRepoUser , gitRepo );
Original file line number Diff line number Diff line change 2727import javax .crypto .spec .IvParameterSpec ;
2828import javax .crypto .spec .SecretKeySpec ;
2929import java .io .*;
30+ import java .net .URL ;
3031
3132/**
3233 * Provides functionality to encode and decode secret tokens to make them not directly readable. Let me be clear:
@@ -70,9 +71,9 @@ private static String encrypt(String value) {
7071 return null ;
7172 }
7273
73- static String decrypt (String file ) throws Exception {
74+ static String decrypt (URL file ) throws Exception {
7475 String in ;
75- final ObjectInputStream o = new ObjectInputStream (new FileInputStream ( file ));
76+ final ObjectInputStream o = new ObjectInputStream (file . openStream ( ));
7677 in = (String ) o .readObject ();
7778 IvParameterSpec iv = new IvParameterSpec (myInitVector .getBytes ("UTF-8" ));
7879 SecretKeySpec keySpec = new SecretKeySpec (myKey .getBytes ("UTF-8" ), "AES" );
You can’t perform that action at this time.
0 commit comments