Fix the fix
This commit is contained in:
@ -8,9 +8,9 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "nl.privacydragon.bookwyrm"
|
||||
minSdk 23
|
||||
targetSdk 31
|
||||
versionCode 10
|
||||
versionName "1.3.3"
|
||||
targetSdk 33
|
||||
versionCode 11
|
||||
versionName "1.3.4"
|
||||
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
}
|
||||
@ -25,6 +25,7 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
namespace 'nl.privacydragon.bookwyrm'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
Binary file not shown.
BIN
app/release/Bookwyrm-v1.3.4.apk
Normal file
BIN
app/release/Bookwyrm-v1.3.4.apk
Normal file
Binary file not shown.
@ -11,8 +11,8 @@
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 10,
|
||||
"versionName": "1.3.3",
|
||||
"versionCode": 11,
|
||||
"versionName": "1.3.4",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="nl.privacydragon.bookwyrm">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
@ -256,7 +256,6 @@ public class HandlerActivity extends AppCompatActivity {
|
||||
intentIntegrator.setPrompt("SCAN");
|
||||
intentIntegrator.setBarcodeImageEnabled(false);
|
||||
intentIntegrator.initiateScan();
|
||||
|
||||
//return "blup";
|
||||
//return "bla";
|
||||
}
|
||||
@ -269,8 +268,14 @@ public class HandlerActivity extends AppCompatActivity {
|
||||
Toast.makeText(this, "cancelled", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Log.d("MainActivity", "Scanned");
|
||||
myWebView.loadUrl("Javascript:(function() {document.getElementById('tour-search').value = " + Result.getContents() + ";" + "document.getElementById('search_input').value = " + Result.getContents() + ";" +
|
||||
"document.getElementsByTagName('form')[0].submit(); ;})()");
|
||||
myWebView.loadUrl("Javascript:(function() {" +
|
||||
"try {" +
|
||||
"document.getElementById('tour-search').value = " + Result.getContents() + ";" +
|
||||
"} catch {" +
|
||||
"document.getElementById('search_input').value = " + Result.getContents() + ";" +
|
||||
"}" +
|
||||
"document.getElementsByTagName('form')[0].submit();" +
|
||||
";})()");
|
||||
LoadIndicator.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
SharedPreferences sharedPref = MainActivity.this.getSharedPreferences(getString(R.string.server), Context.MODE_PRIVATE);
|
||||
String defaultValue = "none";
|
||||
String server = sharedPref.getString(getString(R.string.server), defaultValue);
|
||||
if (server != "none") {
|
||||
if (!"none".equals(server)) {
|
||||
startActivity(new Intent(MainActivity.this, nl.privacydragon.bookwyrm.StartActivity.class));
|
||||
}
|
||||
}
|
||||
@ -54,9 +54,10 @@ public class MainActivity extends AppCompatActivity {
|
||||
String ALLOWED_CHARACTERS ="0123456789qwertyuiopasdfghjklzxcvbnm!@#$%^&*()_+=][{}";
|
||||
final Random random=new Random();
|
||||
final StringBuilder sb=new StringBuilder(12);
|
||||
for(int i = 0; i< 12; ++i)
|
||||
for(int i = 0; i< 12; ++i) {
|
||||
sb.append(ALLOWED_CHARACTERS.charAt(random.nextInt(ALLOWED_CHARACTERS.length())));
|
||||
return sb.toString();
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void LogIn(View view) throws IllegalBlockSizeException, BadPaddingException, KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException, UnrecoverableKeyException, NoSuchPaddingException, InvalidKeyException {
|
||||
@ -81,7 +82,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
keyGenerator.init(
|
||||
new KeyGenParameterSpec.Builder("BookWyrm",
|
||||
KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
|
||||
.setBlockModes(KeyProperties.BLOCK_MODE_GCM) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
|
||||
.setBlockModes(KeyProperties.BLOCK_MODE_GCM).setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
|
||||
.setRandomizedEncryptionRequired(false)
|
||||
.build());
|
||||
keyGenerator.generateKey();
|
||||
|
@ -88,48 +88,35 @@ public class StartActivity extends AppCompatActivity {
|
||||
//Then, load it. or something. To make sure that it can be used.
|
||||
try {
|
||||
keyStore.load(null);
|
||||
} catch (CertificateException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
} catch (CertificateException | IOException | NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//Next, retrieve the key to be used for the decryption.
|
||||
Key DragonLikeKey = null;
|
||||
try {
|
||||
DragonLikeKey = keyStore.getKey("BookWyrm", null);
|
||||
} catch (KeyStoreException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (UnrecoverableKeyException e) {
|
||||
} catch (KeyStoreException | NoSuchAlgorithmException | UnrecoverableKeyException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//Do something with getting the/a cipher or something.
|
||||
Cipher c = null;
|
||||
try {
|
||||
c = Cipher.getInstance("AES/GCM/NoPadding");
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchPaddingException e) {
|
||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//And then initiating the cipher, so it can be used.
|
||||
try {
|
||||
assert c != null;
|
||||
c.init(Cipher.DECRYPT_MODE, DragonLikeKey, new GCMParameterSpec(128, codeMagic.getBytes()));
|
||||
} catch (InvalidAlgorithmParameterException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvalidKeyException e) {
|
||||
} catch (InvalidAlgorithmParameterException | InvalidKeyException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//Decrypt the password!
|
||||
byte[] truePass = null;
|
||||
try {
|
||||
truePass = c.doFinal(Base64.decode(pass, Base64.DEFAULT));
|
||||
} catch (BadPaddingException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalBlockSizeException e) {
|
||||
} catch (BadPaddingException | IllegalBlockSizeException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//Convert the decrypted password back to a string.
|
||||
@ -177,7 +164,7 @@ public class StartActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
IntentIntegrator intentIntegrator = new IntentIntegrator(StartActivity.this);
|
||||
intentIntegrator.setDesiredBarcodeFormats(intentIntegrator.EAN_13);
|
||||
intentIntegrator.setDesiredBarcodeFormats(IntentIntegrator.EAN_13);
|
||||
intentIntegrator.setBeepEnabled(false);
|
||||
intentIntegrator.setCameraId(0);
|
||||
intentIntegrator.setPrompt("SCAN ISBN");
|
||||
@ -196,8 +183,14 @@ public class StartActivity extends AppCompatActivity {
|
||||
Toast.makeText(this, "cancelled", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Log.d("MainActivity", "Scanned");
|
||||
myWebView.loadUrl("Javascript:(function() {document.getElementById('tour-search').value = " + Result.getContents() + ";" + "document.getElementById('search_input').value = " + Result.getContents() + ";" +
|
||||
"document.getElementsByTagName('form')[0].submit(); ;})()");
|
||||
myWebView.loadUrl("Javascript:(function() {" +
|
||||
"try {" +
|
||||
"document.getElementById('tour-search').value = " + Result.getContents() + ";" +
|
||||
"} catch {" +
|
||||
"document.getElementById('search_input').value = " + Result.getContents() + ";" +
|
||||
"}" +
|
||||
"document.getElementsByTagName('form')[0].submit();" +
|
||||
";})()");
|
||||
LoadIndicator.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user