Code cleanup - most notably BitmessageService was cleaned up and doesn't use messaging anymore
This commit is contained in:
@ -28,15 +28,6 @@ import java.util.Scanner;
|
||||
* Helper class to work with Assets.
|
||||
*/
|
||||
public class Assets {
|
||||
public static String readToString(Context ctx, String name) {
|
||||
try {
|
||||
InputStream in = ctx.getAssets().open(name);
|
||||
return new Scanner(in, "UTF-8").useDelimiter("\\A").next();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> readSqlStatements(Context ctx, String name) {
|
||||
try {
|
||||
InputStream in = ctx.getAssets().open(name);
|
||||
|
@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2016 Christian Basler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package ch.dissem.apps.abit.util;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -32,7 +32,7 @@ import com.mikepenz.iconics.IconicsDrawable;
|
||||
*/
|
||||
public class Drawables {
|
||||
public static void addIcon(Context ctx, Menu menu, int menuItem, GoogleMaterial.Icon icon) {
|
||||
menu.findItem(menuItem).setIcon(new IconicsDrawable(ctx, icon).colorRes(R.color.primary_text_default_material_dark).actionBar());
|
||||
menu.findItem(menuItem).setIcon(new IconicsDrawable(ctx, icon).colorRes(R.color.colorPrimaryDarkText).actionBar());
|
||||
}
|
||||
|
||||
public static Bitmap toBitmap(Identicon identicon, int size) {
|
||||
|
@ -1,4 +1,3 @@
|
||||
package ch.dissem.apps.abit.util;
|
||||
/*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will Google be held liable for any damages
|
||||
@ -9,6 +8,8 @@ package ch.dissem.apps.abit.util;
|
||||
* freely, as long as the origin is not misrepresented.
|
||||
*/
|
||||
|
||||
package ch.dissem.apps.abit.util;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
@ -78,7 +79,7 @@ public final class PRNGFixes {
|
||||
// Mix in the device- and invocation-specific seed.
|
||||
Class.forName("org.apache.harmony.xnet.provider.jsse.NativeCrypto")
|
||||
.getMethod("RAND_seed", byte[].class)
|
||||
.invoke(null, generateSeed());
|
||||
.invoke(null, (Object) generateSeed());
|
||||
|
||||
// Mix output of Linux PRNG into OpenSSL's PRNG
|
||||
int bytesRead = (Integer) Class.forName(
|
||||
@ -169,6 +170,7 @@ public final class PRNGFixes {
|
||||
* {@link SecureRandomSpi} which passes all requests to the Linux PRNG
|
||||
* ({@code /dev/urandom}).
|
||||
*/
|
||||
@SuppressWarnings("JavaDoc")
|
||||
public static class LinuxPRNGSecureRandom extends SecureRandomSpi {
|
||||
|
||||
/*
|
||||
@ -241,6 +243,7 @@ public final class PRNGFixes {
|
||||
synchronized (sLock) {
|
||||
in = getUrandomInputStream();
|
||||
}
|
||||
//noinspection SynchronizationOnLocalVariableOrMethodParameter
|
||||
synchronized (in) {
|
||||
in.readFully(bytes);
|
||||
}
|
||||
|
@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2016 Christian Basler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package ch.dissem.apps.abit.util;
|
||||
|
||||
import android.content.Context;
|
||||
|
Reference in New Issue
Block a user