mirror of https://github.com/MISP/misp-bump
reformat code
parent
b52fe8ea51
commit
5ad8287b67
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.activities;
|
package lu.circl.mispbump.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
@ -34,6 +35,7 @@ import lu.circl.mispbump.models.SyncInformation;
|
||||||
import lu.circl.mispbump.models.UploadInformation;
|
import lu.circl.mispbump.models.UploadInformation;
|
||||||
import lu.circl.mispbump.security.DiffieHellman;
|
import lu.circl.mispbump.security.DiffieHellman;
|
||||||
|
|
||||||
|
|
||||||
public class ExchangeActivity extends AppCompatActivity {
|
public class ExchangeActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private PreferenceManager preferenceManager;
|
private PreferenceManager preferenceManager;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.activities;
|
package lu.circl.mispbump.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -24,6 +25,7 @@ import lu.circl.mispbump.auxiliary.PreferenceManager;
|
||||||
import lu.circl.mispbump.interfaces.OnRecyclerItemClickListener;
|
import lu.circl.mispbump.interfaces.OnRecyclerItemClickListener;
|
||||||
import lu.circl.mispbump.models.UploadInformation;
|
import lu.circl.mispbump.models.UploadInformation;
|
||||||
|
|
||||||
|
|
||||||
public class HomeActivity extends AppCompatActivity {
|
public class HomeActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private List<UploadInformation> uploadInformationList;
|
private List<UploadInformation> uploadInformationList;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.activities;
|
package lu.circl.mispbump.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Shader;
|
import android.graphics.Shader;
|
||||||
|
@ -34,6 +35,7 @@ import lu.circl.mispbump.models.restModels.Role;
|
||||||
import lu.circl.mispbump.models.restModels.User;
|
import lu.circl.mispbump.models.restModels.User;
|
||||||
import lu.circl.mispbump.security.KeyStoreWrapper;
|
import lu.circl.mispbump.security.KeyStoreWrapper;
|
||||||
|
|
||||||
|
|
||||||
public class ProfileActivity extends AppCompatActivity {
|
public class ProfileActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private CoordinatorLayout rootLayout;
|
private CoordinatorLayout rootLayout;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.activities;
|
package lu.circl.mispbump.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
@ -7,6 +8,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import lu.circl.mispbump.auxiliary.PreferenceManager;
|
import lu.circl.mispbump.auxiliary.PreferenceManager;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts either the login or home activity.
|
* Starts either the login or home activity.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.activities;
|
package lu.circl.mispbump.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -24,6 +25,7 @@ import lu.circl.mispbump.models.restModels.Organisation;
|
||||||
import lu.circl.mispbump.models.restModels.Server;
|
import lu.circl.mispbump.models.restModels.Server;
|
||||||
import lu.circl.mispbump.models.restModels.User;
|
import lu.circl.mispbump.models.restModels.User;
|
||||||
|
|
||||||
|
|
||||||
public class UploadActivity extends AppCompatActivity {
|
public class UploadActivity extends AppCompatActivity {
|
||||||
|
|
||||||
public static String EXTRA_UPLOAD_INFO = "uploadInformation";
|
public static String EXTRA_UPLOAD_INFO = "uploadInformation";
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.activities;
|
package lu.circl.mispbump.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -29,6 +30,7 @@ import lu.circl.mispbump.fragments.UploadCredentialsFragment;
|
||||||
import lu.circl.mispbump.fragments.UploadSettingsFragment;
|
import lu.circl.mispbump.fragments.UploadSettingsFragment;
|
||||||
import lu.circl.mispbump.models.UploadInformation;
|
import lu.circl.mispbump.models.UploadInformation;
|
||||||
|
|
||||||
|
|
||||||
public class UploadInfoActivity extends AppCompatActivity {
|
public class UploadInfoActivity extends AppCompatActivity {
|
||||||
|
|
||||||
public static String EXTRA_UPLOAD_INFO_UUID = "uploadInformationUuid";
|
public static String EXTRA_UPLOAD_INFO_UUID = "uploadInformationUuid";
|
||||||
|
@ -92,7 +94,8 @@ public class UploadInfoActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void negative() {}
|
public void negative() {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.adapters;
|
package lu.circl.mispbump.adapters;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -18,6 +19,7 @@ import lu.circl.mispbump.R;
|
||||||
import lu.circl.mispbump.interfaces.OnRecyclerItemClickListener;
|
import lu.circl.mispbump.interfaces.OnRecyclerItemClickListener;
|
||||||
import lu.circl.mispbump.models.UploadInformation;
|
import lu.circl.mispbump.models.UploadInformation;
|
||||||
|
|
||||||
|
|
||||||
public class UploadInfoAdapter extends RecyclerView.Adapter<UploadInfoAdapter.ViewHolder> {
|
public class UploadInfoAdapter extends RecyclerView.Adapter<UploadInfoAdapter.ViewHolder> {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
|
@ -114,5 +116,4 @@ public class UploadInfoAdapter extends RecyclerView.Adapter<UploadInfoAdapter.Vi
|
||||||
syncStatus = itemView.findViewById(R.id.syncStatus);
|
syncStatus = itemView.findViewById(R.id.syncStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package lu.circl.mispbump.auxiliary;
|
package lu.circl.mispbump.auxiliary;
|
||||||
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ import lu.circl.mispbump.R;
|
||||||
import lu.circl.mispbump.models.SyncInformation;
|
import lu.circl.mispbump.models.SyncInformation;
|
||||||
import lu.circl.mispbump.security.DiffieHellman;
|
import lu.circl.mispbump.security.DiffieHellman;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and show dialogs.
|
* Creates and show dialogs.
|
||||||
* Automatically takes care of using the UI Thread.
|
* Automatically takes care of using the UI Thread.
|
||||||
|
@ -134,8 +135,8 @@ public class DialogManager {
|
||||||
* Dialog to display a received public key.
|
* Dialog to display a received public key.
|
||||||
*
|
*
|
||||||
* @param syncInformation {@link SyncInformation}
|
* @param syncInformation {@link SyncInformation}
|
||||||
* @param context needed to build and show the dialog
|
* @param context needed to build and show the dialog
|
||||||
* @param callback {@link IDialogFeedback}
|
* @param callback {@link IDialogFeedback}
|
||||||
*/
|
*/
|
||||||
public static void syncInformationDialog(SyncInformation syncInformation, Context context, final IDialogFeedback callback) {
|
public static void syncInformationDialog(SyncInformation syncInformation, Context context, final IDialogFeedback callback) {
|
||||||
|
|
||||||
|
@ -216,7 +217,6 @@ public class DialogManager {
|
||||||
*/
|
*/
|
||||||
public static void loginHelpDialog(Context context) {
|
public static void loginHelpDialog(Context context) {
|
||||||
final AlertDialog.Builder adb = new AlertDialog.Builder(context);
|
final AlertDialog.Builder adb = new AlertDialog.Builder(context);
|
||||||
// adb.setTitle(R.string.app_name);
|
|
||||||
adb.setMessage(R.string.login_help_text);
|
adb.setMessage(R.string.login_help_text);
|
||||||
adb.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
adb.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -304,6 +304,7 @@ public class DialogManager {
|
||||||
*/
|
*/
|
||||||
public interface IDialogFeedback {
|
public interface IDialogFeedback {
|
||||||
void positive();
|
void positive();
|
||||||
|
|
||||||
void negative();
|
void negative();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.auxiliary;
|
package lu.circl.mispbump.auxiliary;
|
||||||
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
@ -37,6 +38,7 @@ import retrofit2.Response;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
import retrofit2.converter.gson.GsonConverterFactory;
|
import retrofit2.converter.gson.GsonConverterFactory;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of the RetroFit2 Misp client.
|
* Implementation of the RetroFit2 Misp client.
|
||||||
* In order to conveniently use this api some wrapper interfaces are implemented to return the requested API endpoint as java object.
|
* In order to conveniently use this api some wrapper interfaces are implemented to return the requested API endpoint as java object.
|
||||||
|
@ -634,4 +636,4 @@ public class MispRestClient {
|
||||||
|
|
||||||
void failure(String error);
|
void failure(String error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.auxiliary;
|
package lu.circl.mispbump.auxiliary;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
|
@ -26,6 +27,7 @@ import lu.circl.mispbump.models.restModels.Role;
|
||||||
import lu.circl.mispbump.models.restModels.User;
|
import lu.circl.mispbump.models.restModels.User;
|
||||||
import lu.circl.mispbump.security.KeyStoreWrapper;
|
import lu.circl.mispbump.security.KeyStoreWrapper;
|
||||||
|
|
||||||
|
|
||||||
public class PreferenceManager {
|
public class PreferenceManager {
|
||||||
|
|
||||||
private static final String PREFERENCES_FILE = "user_settings";
|
private static final String PREFERENCES_FILE = "user_settings";
|
||||||
|
@ -229,7 +231,8 @@ public class PreferenceManager {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
KeyStoreWrapper keyStoreWrapper = new KeyStoreWrapper(KeyStoreWrapper.USER_CREDENTIALS_ALIAS);
|
KeyStoreWrapper keyStoreWrapper = new KeyStoreWrapper(KeyStoreWrapper.USER_CREDENTIALS_ALIAS);
|
||||||
Type type = new TypeToken<Pair<String, String>>() {}.getType();
|
Type type = new TypeToken<Pair<String, String>>() {
|
||||||
|
}.getType();
|
||||||
String serializedCreds = keyStoreWrapper.decrypt(preferences.getString(USER_CREDENTIALS, ""));
|
String serializedCreds = keyStoreWrapper.decrypt(preferences.getString(USER_CREDENTIALS, ""));
|
||||||
return new Gson().fromJson(serializedCreds, type);
|
return new Gson().fromJson(serializedCreds, type);
|
||||||
} catch (InvalidKeyException | InvalidAlgorithmParameterException | NoSuchPaddingException | BadPaddingException | IllegalBlockSizeException | NoSuchAlgorithmException e) {
|
} catch (InvalidKeyException | InvalidAlgorithmParameterException | NoSuchPaddingException | BadPaddingException | IllegalBlockSizeException | NoSuchAlgorithmException e) {
|
||||||
|
@ -359,4 +362,4 @@ public class PreferenceManager {
|
||||||
editor.clear();
|
editor.clear();
|
||||||
editor.apply();
|
editor.apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.auxiliary;
|
package lu.circl.mispbump.auxiliary;
|
||||||
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
|
@ -13,6 +14,7 @@ import com.google.zxing.common.BitMatrix;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
public class QrCodeGenerator {
|
public class QrCodeGenerator {
|
||||||
|
|
||||||
private Activity callingActivity;
|
private Activity callingActivity;
|
||||||
|
@ -32,7 +34,7 @@ public class QrCodeGenerator {
|
||||||
size = displaySize.y;
|
size = displaySize.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = (int)(size * 0.8);
|
size = (int) (size * 0.8);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
|
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
package lu.circl.mispbump.auxiliary;
|
package lu.circl.mispbump.auxiliary;
|
||||||
|
|
||||||
|
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
||||||
public class RandomString {
|
public class RandomString {
|
||||||
@SuppressWarnings("SpellCheckingInspection")
|
@SuppressWarnings("SpellCheckingInspection")
|
||||||
private static final String upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
private static final String upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
package lu.circl.mispbump.auxiliary
|
package lu.circl.mispbump.auxiliary
|
||||||
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.*
|
||||||
import android.graphics.BitmapShader
|
|
||||||
import android.graphics.Canvas
|
|
||||||
import android.graphics.ColorFilter
|
|
||||||
import android.graphics.Paint
|
|
||||||
import android.graphics.PixelFormat
|
|
||||||
import android.graphics.Shader
|
|
||||||
import android.graphics.drawable.BitmapDrawable
|
import android.graphics.drawable.BitmapDrawable
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
|
|
||||||
|
@ -46,4 +40,4 @@ class TileDrawable(drawable: Drawable, tileMode: Shader.TileMode) : Drawable() {
|
||||||
return bmp
|
return bmp
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.TextureView;
|
import android.view.TextureView;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link TextureView} that can be adjusted to a specified aspect ratio.
|
* A {@link TextureView} that can be adjusted to a specified aspect ratio.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.customViews;
|
package lu.circl.mispbump.customViews;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
@ -9,7 +10,6 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||||
|
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||||
|
|
||||||
import java.util.ConcurrentModificationException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can disable touch input on bottom sheet.
|
* Can disable touch input on bottom sheet.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.customViews;
|
package lu.circl.mispbump.customViews;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
@ -8,6 +9,7 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
|
|
||||||
public class ExtendedViewPager extends ViewPager {
|
public class ExtendedViewPager extends ViewPager {
|
||||||
|
|
||||||
private boolean swipeEnabled;
|
private boolean swipeEnabled;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.customViews;
|
package lu.circl.mispbump.customViews;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
@ -7,6 +8,7 @@ import android.widget.FrameLayout;
|
||||||
|
|
||||||
import lu.circl.mispbump.R;
|
import lu.circl.mispbump.R;
|
||||||
|
|
||||||
|
|
||||||
public class FixedAspectRatioFrameLayout extends FrameLayout {
|
public class FixedAspectRatioFrameLayout extends FrameLayout {
|
||||||
private int mAspectRatioWidth;
|
private int mAspectRatioWidth;
|
||||||
private int mAspectRatioHeight;
|
private int mAspectRatioHeight;
|
||||||
|
@ -56,4 +58,4 @@ public class FixedAspectRatioFrameLayout extends FrameLayout {
|
||||||
MeasureSpec.makeMeasureSpec(finalWidth, MeasureSpec.EXACTLY),
|
MeasureSpec.makeMeasureSpec(finalWidth, MeasureSpec.EXACTLY),
|
||||||
MeasureSpec.makeMeasureSpec(finalHeight, MeasureSpec.EXACTLY));
|
MeasureSpec.makeMeasureSpec(finalHeight, MeasureSpec.EXACTLY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.customViews;
|
package lu.circl.mispbump.customViews;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.text.method.PasswordTransformationMethod;
|
import android.text.method.PasswordTransformationMethod;
|
||||||
|
@ -13,6 +14,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
|
||||||
import lu.circl.mispbump.R;
|
import lu.circl.mispbump.R;
|
||||||
|
|
||||||
|
|
||||||
public class MaterialPasswordView extends ConstraintLayout {
|
public class MaterialPasswordView extends ConstraintLayout {
|
||||||
|
|
||||||
private TextView titleView, passwordView;
|
private TextView titleView, passwordView;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.customViews;
|
package lu.circl.mispbump.customViews;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
@ -13,6 +14,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
|
||||||
import lu.circl.mispbump.R;
|
import lu.circl.mispbump.R;
|
||||||
|
|
||||||
|
|
||||||
public class MaterialPreferenceSwitch extends ConstraintLayout {
|
public class MaterialPreferenceSwitch extends ConstraintLayout {
|
||||||
|
|
||||||
private View rootView;
|
private View rootView;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.customViews;
|
package lu.circl.mispbump.customViews;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
@ -14,6 +15,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
|
||||||
import lu.circl.mispbump.R;
|
import lu.circl.mispbump.R;
|
||||||
|
|
||||||
|
|
||||||
public class MaterialPreferenceText extends ConstraintLayout {
|
public class MaterialPreferenceText extends ConstraintLayout {
|
||||||
|
|
||||||
private View rootView;
|
private View rootView;
|
||||||
|
@ -32,7 +34,7 @@ public class MaterialPreferenceText extends ConstraintLayout {
|
||||||
|
|
||||||
icon = view.findViewById(R.id.material_preference_src);
|
icon = view.findViewById(R.id.material_preference_src);
|
||||||
int imageRes = a.getResourceId(R.styleable.MaterialPreferenceText_pref_icon, 0x0);
|
int imageRes = a.getResourceId(R.styleable.MaterialPreferenceText_pref_icon, 0x0);
|
||||||
if (imageRes != 0x0){
|
if (imageRes != 0x0) {
|
||||||
icon.setImageResource(imageRes);
|
icon.setImageResource(imageRes);
|
||||||
} else {
|
} else {
|
||||||
icon.setVisibility(GONE);
|
icon.setVisibility(GONE);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.customViews;
|
package lu.circl.mispbump.customViews;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
|
@ -15,6 +16,7 @@ import androidx.core.widget.ImageViewCompat;
|
||||||
|
|
||||||
import lu.circl.mispbump.R;
|
import lu.circl.mispbump.R;
|
||||||
|
|
||||||
|
|
||||||
public class UploadAction extends ConstraintLayout {
|
public class UploadAction extends ConstraintLayout {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
|
@ -64,6 +66,7 @@ public class UploadAction extends ConstraintLayout {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays an error message for the upload action.
|
* Displays an error message for the upload action.
|
||||||
|
*
|
||||||
* @param error a string to show or null to hide
|
* @param error a string to show or null to hide
|
||||||
*/
|
*/
|
||||||
public void setError(String error) {
|
public void setError(String error) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.fragments;
|
package lu.circl.mispbump.fragments;
|
||||||
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
@ -62,6 +63,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
import lu.circl.mispbump.R;
|
import lu.circl.mispbump.R;
|
||||||
import lu.circl.mispbump.customViews.AutoFitTextureView;
|
import lu.circl.mispbump.customViews.AutoFitTextureView;
|
||||||
|
|
||||||
|
|
||||||
public class CameraFragment extends Fragment implements ActivityCompat.OnRequestPermissionsResultCallback {
|
public class CameraFragment extends Fragment implements ActivityCompat.OnRequestPermissionsResultCallback {
|
||||||
|
|
||||||
private class ImageProcessingThread extends Thread {
|
private class ImageProcessingThread extends Thread {
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package lu.circl.mispbump.fragments;
|
package lu.circl.mispbump.fragments;
|
||||||
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.preference.PreferenceFragmentCompat;
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
|
|
||||||
import lu.circl.mispbump.R;
|
import lu.circl.mispbump.R;
|
||||||
|
|
||||||
|
|
||||||
public class PreferencesFragment extends PreferenceFragmentCompat {
|
public class PreferencesFragment extends PreferenceFragmentCompat {
|
||||||
@Override
|
@Override
|
||||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package lu.circl.mispbump.fragments;
|
package lu.circl.mispbump.fragments;
|
||||||
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentPagerAdapter;
|
import androidx.fragment.app.FragmentPagerAdapter;
|
||||||
|
|
||||||
|
|
||||||
public class SyncFragmentAdapter extends FragmentPagerAdapter {
|
public class SyncFragmentAdapter extends FragmentPagerAdapter {
|
||||||
|
|
||||||
public CameraFragment cameraFragment_1, cameraFragment_2;
|
public CameraFragment cameraFragment_1, cameraFragment_2;
|
||||||
|
|
|
@ -18,12 +18,15 @@ import lu.circl.mispbump.customViews.MaterialPasswordView;
|
||||||
import lu.circl.mispbump.customViews.MaterialPreferenceText;
|
import lu.circl.mispbump.customViews.MaterialPreferenceText;
|
||||||
import lu.circl.mispbump.models.UploadInformation;
|
import lu.circl.mispbump.models.UploadInformation;
|
||||||
|
|
||||||
|
|
||||||
public class UploadCredentialsFragment extends Fragment {
|
public class UploadCredentialsFragment extends Fragment {
|
||||||
|
|
||||||
private View rootLayout;
|
private View rootLayout;
|
||||||
private UploadInformation uploadInformation;
|
private UploadInformation uploadInformation;
|
||||||
|
|
||||||
public UploadCredentialsFragment() {}
|
public UploadCredentialsFragment() {
|
||||||
|
}
|
||||||
|
|
||||||
public UploadCredentialsFragment(UploadInformation uploadInformation) {
|
public UploadCredentialsFragment(UploadInformation uploadInformation) {
|
||||||
this.uploadInformation = uploadInformation;
|
this.uploadInformation = uploadInformation;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package lu.circl.mispbump.fragments;
|
package lu.circl.mispbump.fragments;
|
||||||
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -13,6 +13,7 @@ import lu.circl.mispbump.R;
|
||||||
import lu.circl.mispbump.customViews.MaterialPreferenceSwitch;
|
import lu.circl.mispbump.customViews.MaterialPreferenceSwitch;
|
||||||
import lu.circl.mispbump.models.UploadInformation;
|
import lu.circl.mispbump.models.UploadInformation;
|
||||||
|
|
||||||
|
|
||||||
public class UploadSettingsFragment extends Fragment {
|
public class UploadSettingsFragment extends Fragment {
|
||||||
|
|
||||||
private MaterialPreferenceSwitch allowSelfSigned, push, pull, cache;
|
private MaterialPreferenceSwitch allowSelfSigned, push, pull, cache;
|
||||||
|
@ -85,4 +86,4 @@ public class UploadSettingsFragment extends Fragment {
|
||||||
public void setCache(boolean cache) {
|
public void setCache(boolean cache) {
|
||||||
this.cache.setChecked(cache);
|
this.cache.setChecked(cache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.interfaces;
|
package lu.circl.mispbump.interfaces;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lu.circl.mispbump.models.restModels.MispOrganisation;
|
import lu.circl.mispbump.models.restModels.MispOrganisation;
|
||||||
|
@ -16,6 +17,7 @@ import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
import retrofit2.http.Path;
|
import retrofit2.http.Path;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RetroFit2 interface for communication with misp instances
|
* RetroFit2 interface for communication with misp instances
|
||||||
*/
|
*/
|
||||||
|
@ -61,4 +63,4 @@ public interface MispRestInterface {
|
||||||
|
|
||||||
@POST("servers/add")
|
@POST("servers/add")
|
||||||
Call<Server> addServer(@Body Server server);
|
Call<Server> addServer(@Body Server server);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package lu.circl.mispbump.interfaces;
|
package lu.circl.mispbump.interfaces;
|
||||||
|
|
||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
|
||||||
public interface OnRecyclerItemClickListener<T> {
|
public interface OnRecyclerItemClickListener<T> {
|
||||||
void onClick(View v, T item);
|
void onClick(View v, T item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package lu.circl.mispbump.models;
|
package lu.circl.mispbump.models;
|
||||||
|
|
||||||
|
|
||||||
import lu.circl.mispbump.models.restModels.Organisation;
|
import lu.circl.mispbump.models.restModels.Organisation;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Class that holds the information needed synchronize two misp instances.
|
* A Class that holds the information needed synchronize two misp instances.
|
||||||
* This class can be serialized and passed via QR code.
|
* This class can be serialized and passed via QR code.
|
||||||
|
@ -14,7 +16,8 @@ public class SyncInformation {
|
||||||
public String syncUserAuthkey;
|
public String syncUserAuthkey;
|
||||||
public String baseUrl;
|
public String baseUrl;
|
||||||
|
|
||||||
public SyncInformation() {}
|
public SyncInformation() {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.models;
|
package lu.circl.mispbump.models;
|
||||||
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
@ -8,6 +9,7 @@ import java.util.Date;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
public class UploadInformation {
|
public class UploadInformation {
|
||||||
|
|
||||||
public enum SyncStatus {
|
public enum SyncStatus {
|
||||||
|
@ -37,6 +39,7 @@ public class UploadInformation {
|
||||||
public void setCurrentSyncStatus(SyncStatus status) {
|
public void setCurrentSyncStatus(SyncStatus status) {
|
||||||
currentSyncStatus = status;
|
currentSyncStatus = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SyncStatus getCurrentSyncStatus() {
|
public SyncStatus getCurrentSyncStatus() {
|
||||||
return currentSyncStatus;
|
return currentSyncStatus;
|
||||||
}
|
}
|
||||||
|
@ -44,6 +47,7 @@ public class UploadInformation {
|
||||||
public void setLocal(SyncInformation local) {
|
public void setLocal(SyncInformation local) {
|
||||||
this.local = local;
|
this.local = local;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SyncInformation getLocal() {
|
public SyncInformation getLocal() {
|
||||||
return local;
|
return local;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +55,7 @@ public class UploadInformation {
|
||||||
public void setRemote(SyncInformation remote) {
|
public void setRemote(SyncInformation remote) {
|
||||||
this.remote = remote;
|
this.remote = remote;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SyncInformation getRemote() {
|
public SyncInformation getRemote() {
|
||||||
return remote;
|
return remote;
|
||||||
}
|
}
|
||||||
|
@ -58,6 +63,7 @@ public class UploadInformation {
|
||||||
public UUID getUuid() {
|
public UUID getUuid() {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUuid(UUID uuid) {
|
public void setUuid(UUID uuid) {
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
}
|
}
|
||||||
|
@ -65,12 +71,15 @@ public class UploadInformation {
|
||||||
public void setDate() {
|
public void setDate() {
|
||||||
setDate(Calendar.getInstance().getTime());
|
setDate(Calendar.getInstance().getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDate(Date date) {
|
public void setDate(Date date) {
|
||||||
this.date = date;
|
this.date = date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getDate() {
|
public Date getDate() {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDateString() {
|
public String getDateString() {
|
||||||
SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy", Locale.getDefault());
|
SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy", Locale.getDefault());
|
||||||
return df.format(date);
|
return df.format(date);
|
||||||
|
@ -79,6 +88,7 @@ public class UploadInformation {
|
||||||
public boolean isAllowSelfSigned() {
|
public boolean isAllowSelfSigned() {
|
||||||
return allowSelfSigned;
|
return allowSelfSigned;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllowSelfSigned(boolean allowSelfSigned) {
|
public void setAllowSelfSigned(boolean allowSelfSigned) {
|
||||||
this.allowSelfSigned = allowSelfSigned;
|
this.allowSelfSigned = allowSelfSigned;
|
||||||
}
|
}
|
||||||
|
@ -86,6 +96,7 @@ public class UploadInformation {
|
||||||
public boolean isPull() {
|
public boolean isPull() {
|
||||||
return pull;
|
return pull;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPull(boolean pull) {
|
public void setPull(boolean pull) {
|
||||||
this.pull = pull;
|
this.pull = pull;
|
||||||
}
|
}
|
||||||
|
@ -93,6 +104,7 @@ public class UploadInformation {
|
||||||
public boolean isPush() {
|
public boolean isPush() {
|
||||||
return push;
|
return push;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPush(boolean push) {
|
public void setPush(boolean push) {
|
||||||
this.push = push;
|
this.push = push;
|
||||||
}
|
}
|
||||||
|
@ -100,6 +112,7 @@ public class UploadInformation {
|
||||||
public boolean isCached() {
|
public boolean isCached() {
|
||||||
return cached;
|
return cached;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCached(boolean cached) {
|
public void setCached(boolean cached) {
|
||||||
this.cached = cached;
|
this.cached = cached;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package lu.circl.mispbump.models.restModels;
|
package lu.circl.mispbump.models.restModels;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
public class MispOrganisation {
|
public class MispOrganisation {
|
||||||
@SerializedName("Organisation")
|
@SerializedName("Organisation")
|
||||||
@Expose
|
@Expose
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package lu.circl.mispbump.models.restModels;
|
package lu.circl.mispbump.models.restModels;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
public class MispRole {
|
public class MispRole {
|
||||||
@SerializedName("Role")
|
@SerializedName("Role")
|
||||||
@Expose
|
@Expose
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
package lu.circl.mispbump.models.restModels;
|
package lu.circl.mispbump.models.restModels;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class MispServer {
|
public class MispServer {
|
||||||
|
|
||||||
public MispServer() {}
|
public MispServer() {
|
||||||
|
}
|
||||||
|
|
||||||
public MispServer(Server server, Organisation organisation, Organisation remoteOrganisation) {
|
public MispServer(Server server, Organisation organisation, Organisation remoteOrganisation) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
|
@ -27,4 +31,4 @@ public class MispServer {
|
||||||
@Expose
|
@Expose
|
||||||
public List<User> user;
|
public List<User> user;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package lu.circl.mispbump.models.restModels;
|
package lu.circl.mispbump.models.restModels;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
public class MispUser {
|
public class MispUser {
|
||||||
|
|
||||||
@SerializedName("User")
|
@SerializedName("User")
|
||||||
|
@ -12,4 +14,4 @@ public class MispUser {
|
||||||
public MispUser(User user) {
|
public MispUser(User user) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.models.restModels;
|
package lu.circl.mispbump.models.restModels;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Information gathered from Misp API about a organisation.
|
* Information gathered from Misp API about a organisation.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package lu.circl.mispbump.models.restModels;
|
package lu.circl.mispbump.models.restModels;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
public class Role {
|
public class Role {
|
||||||
@SerializedName("id")
|
@SerializedName("id")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
package lu.circl.mispbump.models.restModels;
|
package lu.circl.mispbump.models.restModels;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
public class Server {
|
public class Server {
|
||||||
|
|
||||||
public Server() {}
|
public Server() {
|
||||||
|
}
|
||||||
|
|
||||||
public Server(String name, String url, String authkey, Integer remote_org_id) {
|
public Server(String name, String url, String authkey, Integer remote_org_id) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package lu.circl.mispbump.models.restModels;
|
package lu.circl.mispbump.models.restModels;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
public static final int ROLE_ADMIN = 1;
|
public static final int ROLE_ADMIN = 1;
|
||||||
|
@ -122,4 +124,4 @@ public class User {
|
||||||
", date_modified='" + date_modified + '\'' +
|
", date_modified='" + date_modified + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package lu.circl.mispbump.models.restModels;
|
package lu.circl.mispbump.models.restModels;
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
||||||
public class Version {
|
public class Version {
|
||||||
|
|
||||||
@SerializedName("version")
|
@SerializedName("version")
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.security;
|
package lu.circl.mispbump.security;
|
||||||
|
|
||||||
|
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -22,6 +23,7 @@ import javax.crypto.NoSuchPaddingException;
|
||||||
import javax.crypto.spec.IvParameterSpec;
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides the functionality generate a shared secret key.
|
* This class provides the functionality generate a shared secret key.
|
||||||
* Furthermore it contains the encryption/decryption methods.
|
* Furthermore it contains the encryption/decryption methods.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package lu.circl.mispbump.security;
|
package lu.circl.mispbump.security;
|
||||||
|
|
||||||
|
|
||||||
import android.security.keystore.KeyGenParameterSpec;
|
import android.security.keystore.KeyGenParameterSpec;
|
||||||
import android.security.keystore.KeyProperties;
|
import android.security.keystore.KeyProperties;
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
|
@ -25,6 +26,7 @@ import javax.crypto.NoSuchPaddingException;
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
import javax.crypto.spec.GCMParameterSpec;
|
import javax.crypto.spec.GCMParameterSpec;
|
||||||
|
|
||||||
|
|
||||||
public class KeyStoreWrapper {
|
public class KeyStoreWrapper {
|
||||||
|
|
||||||
public static final String USER_INFO_ALIAS = "ALIAS_USER_INFO";
|
public static final String USER_INFO_ALIAS = "ALIAS_USER_INFO";
|
||||||
|
@ -257,4 +259,4 @@ public class KeyStoreWrapper {
|
||||||
byte[] iv;
|
byte[] iv;
|
||||||
byte[] data;
|
byte[] data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue