Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
5c8b038a99 | |||
4cfbee2524 | |||
6b44f589ac | |||
2c549830ed | |||
ad5a1dca8b | |||
8037938adf |
4
.idea/deploymentTargetDropDown.xml
generated
4
.idea/deploymentTargetDropDown.xml
generated
@ -7,11 +7,11 @@
|
|||||||
<deviceKey>
|
<deviceKey>
|
||||||
<Key>
|
<Key>
|
||||||
<type value="VIRTUAL_DEVICE_PATH" />
|
<type value="VIRTUAL_DEVICE_PATH" />
|
||||||
<value value="$USER_HOME$/.android/avd/Pixel_5_API_26.avd" />
|
<value value="$USER_HOME$/.android/avd/Pixel_2_API_24.avd" />
|
||||||
</Key>
|
</Key>
|
||||||
</deviceKey>
|
</deviceKey>
|
||||||
</Target>
|
</Target>
|
||||||
</targetSelectedWithDropDown>
|
</targetSelectedWithDropDown>
|
||||||
<timeTargetWasSelectedWithDropDown value="2022-04-24T09:01:51.756259Z" />
|
<timeTargetWasSelectedWithDropDown value="2023-01-19T17:01:06.009496Z" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@ -7,13 +7,13 @@
|
|||||||
<option name="testRunner" value="GRADLE" />
|
<option name="testRunner" value="GRADLE" />
|
||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleJvm" value="11" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="$PROJECT_DIR$/app" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -11,7 +11,7 @@
|
|||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
@ -5,7 +5,7 @@ It can also open links to userpages of Bookwyrm users and it can scan ISBN codes
|
|||||||
|
|
||||||
This application works on: Android 6 and above.
|
This application works on: Android 6 and above.
|
||||||
|
|
||||||
And if you want to know, I am `@StoryDragon@wyrms.de` on BookWyrm.
|
And if you want to know, I am [`@StoryDragon@wyrms.de`](https://wyrms.de/user/storydragon) on BookWyrm.
|
||||||
|
|
||||||
For the ISBN-scanning I use the library zxing-android-embedded.
|
For the ISBN-scanning I use the library zxing-android-embedded.
|
||||||
The barcode icon that is added for instances that do not have ISBN-scanning by default comes from the Remix Icon project.
|
The barcode icon that is added for instances that do not have ISBN-scanning by default comes from the Remix Icon project.
|
||||||
|
@ -3,14 +3,14 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 31
|
compileSdk 33
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "nl.privacydragon.bookwyrm"
|
applicationId "nl.privacydragon.bookwyrm"
|
||||||
minSdk 23
|
minSdk 23
|
||||||
targetSdk 31
|
targetSdk 33
|
||||||
versionCode 8
|
versionCode 11
|
||||||
versionName "1.3.1"
|
versionName "1.3.4"
|
||||||
|
|
||||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||||
}
|
}
|
||||||
@ -25,16 +25,17 @@ android {
|
|||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
namespace 'nl.privacydragon.bookwyrm'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
implementation 'androidx.appcompat:appcompat:1.6.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||||
implementation 'com.google.zxing:core:3.3.0'
|
implementation 'com.google.zxing:core:3.5.1'
|
||||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0@aar'
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0@aar'
|
||||||
//implementation 'com.github.yuriy-budiyev:code-scanner:2.1.2'
|
//implementation 'com.github.yuriy-budiyev:code-scanner:2.1.2'
|
||||||
|
|
||||||
|
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",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 8,
|
"versionCode": 11,
|
||||||
"versionName": "1.3.1",
|
"versionName": "1.3.4",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
package="nl.privacydragon.bookwyrm">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.camera" />
|
<uses-feature android:name="android.hardware.camera" />
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="android.webkit.WebView.MetricsOptOut"
|
|
||||||
android:value="true" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
android:icon="@mipmap/ic_launcher_wyrm"
|
android:icon="@mipmap/ic_launcher_wyrm"
|
||||||
@ -19,6 +15,9 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_wyrm_round"
|
android:roundIcon="@mipmap/ic_launcher_wyrm_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Bookwyrm">
|
android:theme="@style/Theme.Bookwyrm">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.webkit.WebView.MetricsOptOut"
|
||||||
|
android:value="true" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".HandlerActivity"
|
android:name=".HandlerActivity"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
@ -330,6 +329,182 @@
|
|||||||
android:host="library.cybre.city"
|
android:host="library.cybre.city"
|
||||||
android:pathPrefix="/user/" />
|
android:pathPrefix="/user/" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="books.storydragon.nl"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="reading.unbl.ink"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="velhaestante.com.br"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="bookwyrm.gatti.ninja"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="books.theunseen.city"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="lore.livellosegreto.it"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="books.jascha.wtf"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="bw.diaspodon.fr"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="bookwyrm.tilde.zone"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="ramblingreaders.org"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="libros.mistli.net"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="lectura.social"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="orreadi.com"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="bookishbook.club"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="bookwyrm.tech"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:scheme="https"
|
||||||
|
android:host="comelibros.club"
|
||||||
|
android:pathPrefix="/user/" />
|
||||||
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".StartActivity"
|
android:name=".StartActivity"
|
||||||
|
@ -70,6 +70,7 @@ public class HandlerActivity extends AppCompatActivity {
|
|||||||
// End of auto-generated stuff
|
// End of auto-generated stuff
|
||||||
LoadIndicator = (ProgressBar) findViewById(R.id.progressBar3);
|
LoadIndicator = (ProgressBar) findViewById(R.id.progressBar3);
|
||||||
myWebView = (WebView) findViewById(R.id.webview);
|
myWebView = (WebView) findViewById(R.id.webview);
|
||||||
|
myWebView.setVisibility(View.GONE);
|
||||||
myWebView.getSettings().setJavaScriptEnabled(true);
|
myWebView.getSettings().setJavaScriptEnabled(true);
|
||||||
myWebView.getSettings().setDomStorageEnabled(true);
|
myWebView.getSettings().setDomStorageEnabled(true);
|
||||||
myWebView.addJavascriptInterface(new Object()
|
myWebView.addJavascriptInterface(new Object()
|
||||||
@ -176,6 +177,7 @@ public class HandlerActivity extends AppCompatActivity {
|
|||||||
myWebView.setWebViewClient(new HandlerActivity.MyWebViewClient() {
|
myWebView.setWebViewClient(new HandlerActivity.MyWebViewClient() {
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
LoadIndicator.setVisibility(View.GONE);
|
LoadIndicator.setVisibility(View.GONE);
|
||||||
|
myWebView.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
view.loadUrl("javascript:(function() { document.getElementById('id_password').value = '" + passw + "'; ;})()");
|
view.loadUrl("javascript:(function() { document.getElementById('id_password').value = '" + passw + "'; ;})()");
|
||||||
view.loadUrl("javascript:(function() { document.getElementById('id_localname').value = '" + name + "'; ;})()");
|
view.loadUrl("javascript:(function() { document.getElementById('id_localname').value = '" + name + "'; ;})()");
|
||||||
@ -216,7 +218,7 @@ public class HandlerActivity extends AppCompatActivity {
|
|||||||
// Need to accept permissions to use the camera
|
// Need to accept permissions to use the camera
|
||||||
@Override
|
@Override
|
||||||
public void onPermissionRequest(PermissionRequest request) {
|
public void onPermissionRequest(PermissionRequest request) {
|
||||||
String permission = Manifest.permission.CAMERA;
|
String permission = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||||
int grant = ContextCompat.checkSelfPermission(HandlerActivity.this, permission);
|
int grant = ContextCompat.checkSelfPermission(HandlerActivity.this, permission);
|
||||||
if (grant != PackageManager.PERMISSION_GRANTED) {
|
if (grant != PackageManager.PERMISSION_GRANTED) {
|
||||||
String[] permission_list = new String[1];
|
String[] permission_list = new String[1];
|
||||||
@ -226,7 +228,7 @@ public class HandlerActivity extends AppCompatActivity {
|
|||||||
request.grant(request.getResources());
|
request.grant(request.getResources());
|
||||||
final String[] requestedResources = request.getResources();
|
final String[] requestedResources = request.getResources();
|
||||||
for (String r : requestedResources) {
|
for (String r : requestedResources) {
|
||||||
if (r.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) {
|
if (r.equals(PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID)) {
|
||||||
request.grant(new String[]{PermissionRequest.RESOURCE_VIDEO_CAPTURE});
|
request.grant(new String[]{PermissionRequest.RESOURCE_VIDEO_CAPTURE});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -254,7 +256,6 @@ public class HandlerActivity extends AppCompatActivity {
|
|||||||
intentIntegrator.setPrompt("SCAN");
|
intentIntegrator.setPrompt("SCAN");
|
||||||
intentIntegrator.setBarcodeImageEnabled(false);
|
intentIntegrator.setBarcodeImageEnabled(false);
|
||||||
intentIntegrator.initiateScan();
|
intentIntegrator.initiateScan();
|
||||||
|
|
||||||
//return "blup";
|
//return "blup";
|
||||||
//return "bla";
|
//return "bla";
|
||||||
}
|
}
|
||||||
@ -267,8 +268,14 @@ public class HandlerActivity extends AppCompatActivity {
|
|||||||
Toast.makeText(this, "cancelled", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "cancelled", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
Log.d("MainActivity", "Scanned");
|
Log.d("MainActivity", "Scanned");
|
||||||
myWebView.loadUrl("Javascript:(function() {document.getElementById('search_input').value = " + Result.getContents() + ";" +
|
myWebView.loadUrl("Javascript:(function() {" +
|
||||||
"document.getElementsByTagName('form')[0].submit(); ;})()");
|
"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);
|
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);
|
SharedPreferences sharedPref = MainActivity.this.getSharedPreferences(getString(R.string.server), Context.MODE_PRIVATE);
|
||||||
String defaultValue = "none";
|
String defaultValue = "none";
|
||||||
String server = sharedPref.getString(getString(R.string.server), defaultValue);
|
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));
|
startActivity(new Intent(MainActivity.this, nl.privacydragon.bookwyrm.StartActivity.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -54,9 +54,10 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
String ALLOWED_CHARACTERS ="0123456789qwertyuiopasdfghjklzxcvbnm!@#$%^&*()_+=][{}";
|
String ALLOWED_CHARACTERS ="0123456789qwertyuiopasdfghjklzxcvbnm!@#$%^&*()_+=][{}";
|
||||||
final Random random=new Random();
|
final Random random=new Random();
|
||||||
final StringBuilder sb=new StringBuilder(12);
|
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())));
|
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 {
|
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(
|
keyGenerator.init(
|
||||||
new KeyGenParameterSpec.Builder("BookWyrm",
|
new KeyGenParameterSpec.Builder("BookWyrm",
|
||||||
KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
|
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)
|
.setRandomizedEncryptionRequired(false)
|
||||||
.build());
|
.build());
|
||||||
keyGenerator.generateKey();
|
keyGenerator.generateKey();
|
||||||
|
@ -54,6 +54,7 @@ public class StartActivity extends AppCompatActivity {
|
|||||||
setContentView(R.layout.activity_start);
|
setContentView(R.layout.activity_start);
|
||||||
LoadIndicator = (ProgressBar) findViewById(R.id.progressBar3);
|
LoadIndicator = (ProgressBar) findViewById(R.id.progressBar3);
|
||||||
myWebView = (WebView) findViewById(R.id.webview);
|
myWebView = (WebView) findViewById(R.id.webview);
|
||||||
|
myWebView.setVisibility(View.GONE);
|
||||||
myWebView.getSettings().setJavaScriptEnabled(true);
|
myWebView.getSettings().setJavaScriptEnabled(true);
|
||||||
myWebView.addJavascriptInterface(new Object()
|
myWebView.addJavascriptInterface(new Object()
|
||||||
{
|
{
|
||||||
@ -87,48 +88,35 @@ public class StartActivity extends AppCompatActivity {
|
|||||||
//Then, load it. or something. To make sure that it can be used.
|
//Then, load it. or something. To make sure that it can be used.
|
||||||
try {
|
try {
|
||||||
keyStore.load(null);
|
keyStore.load(null);
|
||||||
} catch (CertificateException e) {
|
} catch (CertificateException | IOException | NoSuchAlgorithmException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
//Next, retrieve the key to be used for the decryption.
|
//Next, retrieve the key to be used for the decryption.
|
||||||
Key DragonLikeKey = null;
|
Key DragonLikeKey = null;
|
||||||
try {
|
try {
|
||||||
DragonLikeKey = keyStore.getKey("BookWyrm", null);
|
DragonLikeKey = keyStore.getKey("BookWyrm", null);
|
||||||
} catch (KeyStoreException e) {
|
} catch (KeyStoreException | NoSuchAlgorithmException | UnrecoverableKeyException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (UnrecoverableKeyException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
//Do something with getting the/a cipher or something.
|
//Do something with getting the/a cipher or something.
|
||||||
Cipher c = null;
|
Cipher c = null;
|
||||||
try {
|
try {
|
||||||
c = Cipher.getInstance("AES/GCM/NoPadding");
|
c = Cipher.getInstance("AES/GCM/NoPadding");
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchPaddingException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
//And then initiating the cipher, so it can be used.
|
//And then initiating the cipher, so it can be used.
|
||||||
try {
|
try {
|
||||||
|
assert c != null;
|
||||||
c.init(Cipher.DECRYPT_MODE, DragonLikeKey, new GCMParameterSpec(128, codeMagic.getBytes()));
|
c.init(Cipher.DECRYPT_MODE, DragonLikeKey, new GCMParameterSpec(128, codeMagic.getBytes()));
|
||||||
} catch (InvalidAlgorithmParameterException e) {
|
} catch (InvalidAlgorithmParameterException | InvalidKeyException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InvalidKeyException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
//Decrypt the password!
|
//Decrypt the password!
|
||||||
byte[] truePass = null;
|
byte[] truePass = null;
|
||||||
try {
|
try {
|
||||||
truePass = c.doFinal(Base64.decode(pass, Base64.DEFAULT));
|
truePass = c.doFinal(Base64.decode(pass, Base64.DEFAULT));
|
||||||
} catch (BadPaddingException e) {
|
} catch (BadPaddingException | IllegalBlockSizeException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalBlockSizeException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
//Convert the decrypted password back to a string.
|
//Convert the decrypted password back to a string.
|
||||||
@ -138,6 +126,7 @@ public class StartActivity extends AppCompatActivity {
|
|||||||
myWebView.setWebViewClient(new MyWebViewClient(){
|
myWebView.setWebViewClient(new MyWebViewClient(){
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
LoadIndicator.setVisibility(View.GONE);
|
LoadIndicator.setVisibility(View.GONE);
|
||||||
|
myWebView.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
view.loadUrl("javascript:(function() { document.getElementById('id_password_confirm').value = '" + passw + "'; ;})()");
|
view.loadUrl("javascript:(function() { document.getElementById('id_password_confirm').value = '" + passw + "'; ;})()");
|
||||||
view.loadUrl("javascript:(function() { document.getElementById('id_localname_confirm').value = '" + name + "'; ;})()");
|
view.loadUrl("javascript:(function() { document.getElementById('id_localname_confirm').value = '" + name + "'; ;})()");
|
||||||
@ -175,7 +164,7 @@ public class StartActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
IntentIntegrator intentIntegrator = new IntentIntegrator(StartActivity.this);
|
IntentIntegrator intentIntegrator = new IntentIntegrator(StartActivity.this);
|
||||||
intentIntegrator.setDesiredBarcodeFormats(intentIntegrator.EAN_13);
|
intentIntegrator.setDesiredBarcodeFormats(IntentIntegrator.EAN_13);
|
||||||
intentIntegrator.setBeepEnabled(false);
|
intentIntegrator.setBeepEnabled(false);
|
||||||
intentIntegrator.setCameraId(0);
|
intentIntegrator.setCameraId(0);
|
||||||
intentIntegrator.setPrompt("SCAN ISBN");
|
intentIntegrator.setPrompt("SCAN ISBN");
|
||||||
@ -194,8 +183,14 @@ public class StartActivity extends AppCompatActivity {
|
|||||||
Toast.makeText(this, "cancelled", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "cancelled", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
Log.d("MainActivity", "Scanned");
|
Log.d("MainActivity", "Scanned");
|
||||||
myWebView.loadUrl("Javascript:(function() {document.getElementById('search_input').value = " + Result.getContents() + ";" +
|
myWebView.loadUrl("Javascript:(function() {" +
|
||||||
"document.getElementsByTagName('form')[0].submit(); ;})()");
|
"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);
|
LoadIndicator.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
android:id="@+id/Instance"
|
android:id="@+id/Instance"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="1dp"
|
android:layout_marginEnd="1dp"
|
||||||
android:layout_marginBottom="262dp"
|
android:layout_marginBottom="262dp"
|
||||||
android:hint="bookwyrm.social"
|
android:hint="bookwyrm.social"
|
||||||
@ -41,7 +41,7 @@
|
|||||||
android:id="@+id/Username"
|
android:id="@+id/Username"
|
||||||
android:layout_width="409dp"
|
android:layout_width="409dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="1dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="1dp"
|
android:layout_marginEnd="1dp"
|
||||||
android:layout_marginBottom="284dp"
|
android:layout_marginBottom="284dp"
|
||||||
android:hint="Username"
|
android:hint="Username"
|
||||||
@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/Password"
|
android:id="@+id/Password"
|
||||||
android:layout_width="409dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="1dp"
|
android:layout_marginEnd="1dp"
|
||||||
@ -89,10 +89,10 @@
|
|||||||
android:id="@+id/textView2"
|
android:id="@+id/textView2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginTop="76dp"
|
android:layout_marginTop="76dp"
|
||||||
android:layout_marginEnd="185dp"
|
android:layout_marginEnd="185dp"
|
||||||
android:layout_marginBottom="35dp"
|
android:layout_marginBottom="10dp"
|
||||||
android:text="Instance. WITHOUT the https part"
|
android:text="Instance. WITHOUT the https part"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/Instance"
|
app:layout_constraintBottom_toTopOf="@+id/Instance"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@ -107,7 +107,7 @@
|
|||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
android:layout_marginEnd="41dp"
|
android:layout_marginEnd="41dp"
|
||||||
android:layout_marginBottom="35dp"
|
android:layout_marginBottom="10dp"
|
||||||
android:text="Username"
|
android:text="Username"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/Username"
|
app:layout_constraintBottom_toTopOf="@+id/Username"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@ -115,6 +115,21 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/Instance" />
|
app:layout_constraintTop_toBottomOf="@+id/Instance" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView6"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginEnd="340dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:text="Password"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/Password"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/Username" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button"
|
android:id="@+id/button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Theme.Bookwyrm" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="Theme.Bookwyrm" parent="Theme.AppCompat">
|
||||||
<!-- Primary brand color. -->
|
<!-- Primary brand color. -->
|
||||||
<item name="colorPrimary">#3298DC</item>
|
<item name="colorPrimary">#3298DC</item>
|
||||||
<item name="colorPrimaryDark">#1B557C</item>
|
<item name="colorPrimaryDark">#1B557C</item>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Theme.Bookwyrm" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="Theme.Bookwyrm" parent="Theme.AppCompat">
|
||||||
<!-- Primary brand color. -->
|
<!-- Primary brand color. -->
|
||||||
<item name="colorPrimary">#3298DC</item>
|
<item name="colorPrimary">#3298DC</item>
|
||||||
<item name="colorPrimaryDark">#1B557C</item>
|
<item name="colorPrimaryDark">#1B557C</item>
|
||||||
|
3
fastlane/metadata/android/en-US/changelogs/10.txt
Normal file
3
fastlane/metadata/android/en-US/changelogs/10.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
* Fixed a bug with the barcode scanning. Now you can scan barcodes again.
|
||||||
|
* Dependencies have been updated to newest versions.
|
||||||
|
* More Bookwyrm instances have been added.
|
5
fastlane/metadata/android/en-US/changelogs/11.txt
Normal file
5
fastlane/metadata/android/en-US/changelogs/11.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
The same as release 1.3.3, but not the one bug is actually fixed for real...
|
||||||
|
* Fixed a bug with the barcode scanning. Now you can scan barcodes again.
|
||||||
|
* Dependencies have been updated to newest versions.
|
||||||
|
* More Bookwyrm instances have been added.
|
||||||
|
|
2
fastlane/metadata/android/en-US/changelogs/9.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/9.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
* Changed the initial screen to dark mode.
|
||||||
|
* The login screen things are now better aligned.
|
Binary file not shown.
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 45 KiB |
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
#Mon Feb 14 18:09:26 CET 2022
|
#Mon Feb 14 18:09:26 CET 2022
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
Reference in New Issue
Block a user