Skip to content

Commit d99e0ac

Browse files
Merge pull request #106 from cconlon/v1.10
Prep for 1.10.0 Release
2 parents 3910024 + fb43575 commit d99e0ac

10 files changed

Lines changed: 105 additions & 29 deletions

File tree

IDE/Android/.idea/gradle.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ project should be used for reference only.
66
Tool and version information used when testing this project:
77

88
- Ubuntu 20.04.3 LTS
9-
- Android Studio Bumblebeea 2021.1.1 Patch 3
9+
- Android Studio Chipmunk 2021.2.1
1010
- Android Gradle Plugin Version: 4.2.2
1111
- Gradle Version: 7.1.3
12-
- API 28: Android 9.0 (Pie)
13-
- Emulator: Nexus 5X API 28
12+
- API 30: Android 11
13+
- Emulator: Pixel 5 API 31
1414

1515
The following sections outline steps required to run this example on an
1616
Android device or emulator.

IDE/Android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 28
4+
compileSdkVersion 30
55
defaultConfig {
66
applicationId "com.example.wolfssl"
7-
minSdkVersion 23
8-
targetSdkVersion 28
7+
minSdkVersion 30
8+
targetSdkVersion 30
99
versionCode 1
1010
versionName "1.0"
1111
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

IDE/Android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.example.wolfssl">
4-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
4+
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
55
<uses-permission android:name="android.permission.INTERNET"/>
66

77
<application
@@ -14,7 +14,6 @@
1414
<activity android:name=".MainActivity">
1515
<intent-filter>
1616
<action android:name="android.intent.action.MAIN" />
17-
1817
<category android:name="android.intent.category.LAUNCHER" />
1918
</intent-filter>
2019
</activity>

IDE/Android/app/src/main/java/com/example/wolfssl/MainActivity.java

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,22 @@
2222

2323
package com.example.wolfssl;
2424

25+
import android.content.Intent;
26+
import android.net.Uri;
27+
import android.os.Environment;
28+
import android.provider.Settings;
2529
import android.support.v7.app.AppCompatActivity;
2630
import android.os.Bundle;
31+
import android.view.View;
32+
import android.widget.Button;
2733
import android.widget.TextView;
28-
import android.Manifest;
29-
import android.content.pm.PackageManager;
3034

3135
import com.wolfssl.WolfSSL;
3236
import com.wolfssl.WolfSSLException;
3337
import com.wolfssl.provider.jsse.WolfSSLProvider;
3438
import com.wolfssl.provider.jsse.WolfSSLX509;
3539

3640
import java.io.FileInputStream;
37-
import java.io.FileNotFoundException;
3841
import java.io.IOException;
3942
import java.security.KeyStore;
4043
import java.security.KeyStoreException;
@@ -48,25 +51,38 @@
4851

4952
public class MainActivity extends AppCompatActivity {
5053

54+
private View.OnClickListener buttonListener = new View.OnClickListener() {
55+
@Override
56+
public void onClick(View v) {
57+
TextView tv = (TextView) findViewById(R.id.sample_text);
58+
59+
try {
60+
testLoadCert(tv);
61+
} catch (Exception e) {
62+
e.printStackTrace();
63+
}
64+
}
65+
};
66+
5167
@Override
5268
protected void onCreate(Bundle savedInstanceState) {
5369
int permission;
5470
super.onCreate(savedInstanceState);
5571
setContentView(R.layout.activity_main);
5672

73+
Button button = (Button) findViewById(R.id.button);
74+
button.setOnClickListener(buttonListener);
75+
5776
TextView tv = (TextView) findViewById(R.id.sample_text);
5877
tv.setText("wolfSSL JNI Android Studio Example App");
5978

6079

61-
permission = checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE);
62-
if (permission != PackageManager.PERMISSION_GRANTED) {
63-
requestPermissions(new String[] {Manifest.permission.READ_EXTERNAL_STORAGE},1);
64-
}
65-
66-
try {
67-
testLoadCert(tv);
68-
} catch (Exception e) {
69-
e.printStackTrace();
80+
if (Environment.isExternalStorageManager()) {
81+
} else {
82+
Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
83+
Uri uri = Uri.fromParts("package", getPackageName(), null);
84+
intent.setData(uri);
85+
startActivity(intent);
7086
}
7187
}
7288

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout
3-
xmlns:android="http://schemas.android.com/apk/res/android"
4-
xmlns:tools="http://schemas.android.com/tools"
2+
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
53
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
65
android:layout_width="match_parent"
76
android:layout_height="match_parent"
87
tools:context=".MainActivity">
98

9+
<Button
10+
android:id="@+id/button"
11+
android:layout_width="match_parent"
12+
android:layout_height="wrap_content"
13+
android:text="Load Cert File" />
14+
1015
<TextView
1116
android:id="@+id/sample_text"
12-
android:layout_width="wrap_content"
17+
android:layout_width="match_parent"
1318
android:layout_height="wrap_content"
19+
android:layout_marginTop="16dp"
20+
android:paddingVertical="16pt"
1421
android:text="Hello World!"
1522
app:layout_constraintBottom_toBottomOf="parent"
23+
app:layout_constraintHorizontal_bias="0.461"
1624
app:layout_constraintLeft_toLeftOf="parent"
1725
app:layout_constraintRight_toRightOf="parent"
18-
app:layout_constraintTop_toTopOf="parent" />
26+
app:layout_constraintTop_toTopOf="parent"
27+
app:layout_constraintVertical_bias="0.067" />
1928

2029
</android.support.constraint.ConstraintLayout>

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,30 @@ Additional instructions can be found on the wolfSSL.com website:
157157

158158
## Release Notes
159159

160+
### wolfSSL JNI Release 1.10.0 (8/11/2022)
161+
162+
Release 1.10.0 has bug fixes and new features including:
163+
164+
**JNI and JSSE Changes:**
165+
* Add SSLEngine.getApplicationProtocol(), fixes Undertow compatibility (PR 84)
166+
* Wrap wolfSSL\_UseALPN() at JNI level (PR 84)
167+
* Fix compile error for wolfSSL < 4.2.0 and wolfSSL\_set\_alpn\_protos() (PR 84)
168+
* Fix NullPointerException when no selected ALPN is available (PR 84)
169+
* Fix JNI build when wolfSSL compiled with --disable-filesystem (PR 104)
170+
* Fix SSLEngine compatibility with data larger than TLS record size (PR 105)
171+
* Refactor SSLEngine handshake status to be more inline with SunJSSE (PR 105)
172+
* Add verbose SSLEngine logging with "wolfsslengine.debug" property (PR 105)
173+
174+
**Documentation Changes**
175+
* Fix missing Javadoc warnings in ALPN code
176+
177+
**Example Changes:**
178+
* Update Android Studio IDE project to use Android 11 (SDK 30)
179+
180+
The wolfSSL JNI Manual is available at:
181+
http://www.wolfssl.com/documentation/wolfSSL-JNI-Manual.pdf. For build
182+
instructions and more detailed comments, please check the manual.
183+
160184
### wolfSSL JNI Release 1.9.0 (5/5/2022)
161185

162186
Release 1.9.0 has bug fixes and new features including:

build.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
$JUNIT_HOME/junit.jar
1212
</description>
1313

14+
<!-- versioning/manifest properties -->
15+
<property name="implementation.vendor" value="wolfSSL Inc." />
16+
<property name="implementation.title" value="wolfSSL JNI/JSSE" />
17+
<property name="implementation.version" value="1.10" />
18+
1419
<!-- set properties for this build -->
1520
<property name="src.dir" value="src/java/"/>
1621
<property name="native.dir" value="native"/>
@@ -157,6 +162,14 @@
157162

158163
<target name="jar">
159164
<jar jarfile="${lib.dir}/wolfssl.jar">
165+
<manifest>
166+
<attribute name="Implementation-Title"
167+
value="${implementation.title}" />
168+
<attribute name="Implementation-Version"
169+
value="${implementation.version}" />
170+
<attribute name="Implementation-Vendor"
171+
value="${implementation.vendor}" />
172+
</manifest>
160173
<fileset dir="${build.dir}">
161174
<include name="com/wolfssl/*.class"/>
162175
<include name="com/wolfssl/wolfcrypt/*.class"/>
@@ -165,7 +178,16 @@
165178
</target>
166179

167180
<target name="jar-jsse">
168-
<jar jarfile="${lib.dir}/wolfssl-jsse.jar" basedir="${build.dir}"></jar>
181+
<jar jarfile="${lib.dir}/wolfssl-jsse.jar" basedir="${build.dir}">
182+
<manifest>
183+
<attribute name="Implementation-Title"
184+
value="${implementation.title}" />
185+
<attribute name="Implementation-Version"
186+
value="${implementation.version}" />
187+
<attribute name="Implementation-Vendor"
188+
value="${implementation.vendor}" />
189+
</manifest>
190+
</jar>
169191
</target>
170192

171193
<target name="javadoc" description="generate documentation">

src/java/com/wolfssl/provider/jsse/WolfSSLProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public void errorCallback(int ok, int err, String hash) {
7373
* wolfSSL JSSE Provider class
7474
*/
7575
public WolfSSLProvider() {
76-
super("wolfJSSE", 1.8, "wolfSSL JSSE Provider");
77-
//super("wolfJSSE", "1.8", "wolfSSL JSSE Provider");
76+
super("wolfJSSE", 1.10, "wolfSSL JSSE Provider");
77+
//super("wolfJSSE", "1.10", "wolfSSL JSSE Provider");
7878

7979
/* load native wolfSSLJNI library */
8080
WolfSSL.loadLibrary();

0 commit comments

Comments
 (0)