mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 14:15:14 +00:00
Explicit exceptions in NetworkPackage's encrypt/decrypt
This commit is contained in:
@@ -28,6 +28,7 @@ import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.kde.kdeconnect.Helpers.DeviceHelper;
|
||||
import org.kde.kdeconnect.UserInterface.MainSettingsActivity;
|
||||
@@ -35,6 +36,7 @@ import org.kde.kdeconnect.UserInterface.MainSettingsActivity;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.util.ArrayList;
|
||||
@@ -187,7 +189,7 @@ public class NetworkPackage {
|
||||
return np;
|
||||
}
|
||||
|
||||
public NetworkPackage encrypt(PublicKey publicKey) throws Exception {
|
||||
public NetworkPackage encrypt(PublicKey publicKey) throws GeneralSecurityException {
|
||||
|
||||
String serialized = serialize();
|
||||
|
||||
@@ -217,7 +219,7 @@ public class NetworkPackage {
|
||||
|
||||
}
|
||||
|
||||
public NetworkPackage decrypt(PrivateKey privateKey) throws Exception {
|
||||
public NetworkPackage decrypt(PrivateKey privateKey) throws GeneralSecurityException, JSONException {
|
||||
|
||||
JSONArray chunks = mBody.getJSONArray("data");
|
||||
|
||||
|
Reference in New Issue
Block a user