Skip to content

Commit 94d9192

Browse files
committed
Recover support of older Android versions (starting from level 16)
1 parent 8abedea commit 94d9192

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<dependency>
4343
<groupId>io.github.astonbitecode</groupId>
4444
<artifactId>j4rs</artifactId>
45-
<version>0.11.0-java7</version>
45+
<version>0.11.2-java7</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>com.dropbox.core</groupId>

java/src/main/java/org/astonbitecode/rustkeylock/adapters/EntriesAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
import java.util.List;
1919

20-
import org.astonbitecode.rustkeylock.R;
2120
import org.astonbitecode.rustkeylock.api.JavaEntry;
21+
import org.astonbitecode.rustkeylock.R;
2222

2323
import android.app.Activity;
2424
import android.content.Context;

java/src/main/java/org/astonbitecode/rustkeylock/api/InterfaceWithRust.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import android.util.Log;
2020
import org.astonbitecode.j4rs.api.invocation.NativeCallbackToRustChannelSupport;
2121
import org.astonbitecode.rustkeylock.api.stubs.GuiResponse;
22-
import org.astonbitecode.rustkeylock.callbacks.*;
2322

2423
import java.util.List;
2524
import java.util.Map;
@@ -28,7 +27,7 @@
2827
public class InterfaceWithRust {
2928
private final String TAG = getClass().getName();
3029
public static final InterfaceWithRust INSTANCE = new InterfaceWithRust();
31-
private AtomicReference<NativeCallbackToRustChannelSupport> callback = new AtomicReference(null);
30+
private AtomicReference<NativeCallbackToRustChannelSupport> callback = new AtomicReference<>(null);
3231
private AtomicReference<Fragment> previousFragment = new AtomicReference<>(null);
3332

3433
private InterfaceWithRust() {

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
rust_keylock = {git="https://github.com/rust-keylock/rust-keylock-lib.git"}
13-
j4rs = "0.11.0"
13+
j4rs = "0.11"
1414
libc = "0.2"
1515
jni-sys = "0.3"
1616
serde = { version = "1.0", features = ["derive"] }

rust/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ pub extern fn Java_org_astonbitecode_rustkeylock_api_InterfaceWithRust_execute(
5151
_jni_env: *mut JNIEnv,
5252
_thiz: jobject,
5353
cert_file_path_java_string: jstring) {
54+
debug!("Executing rust-keylock native");
5455
match j4rs::JvmBuilder::new()
5556
.detach_thread_on_drop(false)
5657
.with_no_implicit_classpath()
5758
.with_native_lib_name("rustkeylockandroid")
5859
.build() {
5960
Ok(jvm) => {
61+
debug!("JVM is created ");
6062
if let Ok(cert_file_path) = j4rs::jstring_to_rust_string(&jvm, cert_file_path_java_string) {
6163
::std::env::set_var("SSL_CERT_FILE", cert_file_path);
6264
}

0 commit comments

Comments
 (0)