From 4154924c70f99a5b5552bd6a4dc4366205e27447 Mon Sep 17 00:00:00 2001 From: kcw-grunt Date: Mon, 22 Nov 2021 23:01:44 -0800 Subject: [PATCH 1/9] Remove big headers --- .../tools/sqlite/BRDataSourceInterface.java | 26 +------------ .../tools/sqlite/BRSQLiteHelper.java | 39 ------------------- .../tools/sqlite/CurrencyDataSource.java | 27 +------------ .../tools/sqlite/MerkleBlockDataSource.java | 26 +------------ .../tools/sqlite/PeerDataSource.java | 30 -------------- .../tools/sqlite/TransactionDataSource.java | 27 +------------ 6 files changed, 4 insertions(+), 171 deletions(-) diff --git a/app/src/main/java/com/breadwallet/tools/sqlite/BRDataSourceInterface.java b/app/src/main/java/com/breadwallet/tools/sqlite/BRDataSourceInterface.java index 2080442de..45446e45e 100644 --- a/app/src/main/java/com/breadwallet/tools/sqlite/BRDataSourceInterface.java +++ b/app/src/main/java/com/breadwallet/tools/sqlite/BRDataSourceInterface.java @@ -1,32 +1,8 @@ package com.breadwallet.tools.sqlite; - import android.database.sqlite.SQLiteDatabase; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/24/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public interface BRDataSourceInterface { + public static final String TAG = BRDataSourceInterface.class.getName(); SQLiteDatabase openDatabase(); void closeDatabase(); diff --git a/app/src/main/java/com/breadwallet/tools/sqlite/BRSQLiteHelper.java b/app/src/main/java/com/breadwallet/tools/sqlite/BRSQLiteHelper.java index 1d6cc3f22..f381338ca 100644 --- a/app/src/main/java/com/breadwallet/tools/sqlite/BRSQLiteHelper.java +++ b/app/src/main/java/com/breadwallet/tools/sqlite/BRSQLiteHelper.java @@ -3,35 +3,9 @@ import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; -import android.util.Log; import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/25/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRSQLiteHelper extends SQLiteOpenHelper { private static final String TAG = BRSQLiteHelper.class.getName(); private static BRSQLiteHelper instance; @@ -107,31 +81,18 @@ public static BRSQLiteHelper getInstance(Context context) { CURRENCY_CODE + " text primary key," + CURRENCY_NAME + " text," + CURRENCY_RATE + " integer );"; - - @Override public void onCreate(SQLiteDatabase database) { database.execSQL(MB_DATABASE_CREATE); database.execSQL(TX_DATABASE_CREATE); database.execSQL(PEER_DATABASE_CREATE); database.execSQL(CURRENCY_DATABASE_CREATE); -// database.execSQL("PRAGMA journal_mode=WAL;"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Timber.e("Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); -// db.execSQL("DROP TABLE IF EXISTS " + MB_TABLE_NAME); -// db.execSQL("DROP TABLE IF EXISTS " + TX_TABLE_NAME); -// db.execSQL("DROP TABLE IF EXISTS " + PEER_TABLE_NAME); -// db.execSQL("DROP TABLE IF EXISTS " + CURRENCY_TABLE_NAME); -// db.execSQL(MB_DATABASE_CREATE); -// db.execSQL(TX_DATABASE_CREATE); -// db.execSQL(PEER_DATABASE_CREATE); -// db.execSQL(CURRENCY_DATABASE_CREATE); -// db.execSQL("PRAGMA journal_mode=WAL;"); onCreate(db); - } } diff --git a/app/src/main/java/com/breadwallet/tools/sqlite/CurrencyDataSource.java b/app/src/main/java/com/breadwallet/tools/sqlite/CurrencyDataSource.java index ee2d564bf..00d63cdac 100644 --- a/app/src/main/java/com/breadwallet/tools/sqlite/CurrencyDataSource.java +++ b/app/src/main/java/com/breadwallet/tools/sqlite/CurrencyDataSource.java @@ -1,30 +1,5 @@ package com.breadwallet.tools.sqlite; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/25/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - import android.content.ContentValues; import android.content.Context; import android.database.Cursor; @@ -41,7 +16,7 @@ import timber.log.Timber; public class CurrencyDataSource implements BRDataSourceInterface { - + private static final String TAG = CurrencyDataSource.class.getName(); private SQLiteDatabase database; private final BRSQLiteHelper dbHelper; diff --git a/app/src/main/java/com/breadwallet/tools/sqlite/MerkleBlockDataSource.java b/app/src/main/java/com/breadwallet/tools/sqlite/MerkleBlockDataSource.java index 252bf8905..3a1c3bbfc 100644 --- a/app/src/main/java/com/breadwallet/tools/sqlite/MerkleBlockDataSource.java +++ b/app/src/main/java/com/breadwallet/tools/sqlite/MerkleBlockDataSource.java @@ -1,30 +1,5 @@ package com.breadwallet.tools.sqlite; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/25/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - import android.content.ContentValues; import android.content.Context; import android.database.Cursor; @@ -43,6 +18,7 @@ import timber.log.Timber; public class MerkleBlockDataSource implements BRDataSourceInterface { + private static final String TAG = MerkleBlockDataSource.class.getName(); private AtomicInteger mOpenCounter = new AtomicInteger(); // Database fields diff --git a/app/src/main/java/com/breadwallet/tools/sqlite/PeerDataSource.java b/app/src/main/java/com/breadwallet/tools/sqlite/PeerDataSource.java index f73d8b462..beca2cbe3 100644 --- a/app/src/main/java/com/breadwallet/tools/sqlite/PeerDataSource.java +++ b/app/src/main/java/com/breadwallet/tools/sqlite/PeerDataSource.java @@ -1,30 +1,5 @@ package com.breadwallet.tools.sqlite; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/25/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - import android.content.ContentValues; import android.content.Context; import android.database.Cursor; @@ -160,10 +135,5 @@ public SQLiteDatabase openDatabase() { @Override public void closeDatabase() { -// if (mOpenCounter.decrementAndGet() == 0) { - // Closing database -// database.close(); - -// } } } \ No newline at end of file diff --git a/app/src/main/java/com/breadwallet/tools/sqlite/TransactionDataSource.java b/app/src/main/java/com/breadwallet/tools/sqlite/TransactionDataSource.java index 886e0feb5..19fd77307 100644 --- a/app/src/main/java/com/breadwallet/tools/sqlite/TransactionDataSource.java +++ b/app/src/main/java/com/breadwallet/tools/sqlite/TransactionDataSource.java @@ -1,30 +1,5 @@ package com.breadwallet.tools.sqlite; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/25/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - import android.content.ContentValues; import android.content.Context; import android.database.Cursor; @@ -42,7 +17,7 @@ import timber.log.Timber; public class TransactionDataSource implements BRDataSourceInterface { - + private static final String TAG = TransactionDataSource.class.getName(); private AtomicInteger mOpenCounter = new AtomicInteger(); // Database fields From 07bbab49b2433ea2ceee2e441cf2bb7602543e70 Mon Sep 17 00:00:00 2001 From: kcw-grunt Date: Mon, 22 Nov 2021 23:13:29 -0800 Subject: [PATCH 2/9] Removed CameraPlugin class - This class is a rememnant of the BRD plan. But it was dead code. - Image Saver was also removed. - Image Reader should be removed. --- .../activities/camera/CameraActivity.java | 50 +-- .../main/java/com/platform/HTTPServer.java | 5 - .../middlewares/plugins/CameraPlugin.java | 289 ------------------ app/src/main/res/values-da/strings.xml | 2 - app/src/main/res/values-de/strings.xml | 2 - app/src/main/res/values-es/strings.xml | 2 - app/src/main/res/values-fr/strings.xml | 2 - app/src/main/res/values-in/strings.xml | 2 - app/src/main/res/values-it/strings.xml | 2 - app/src/main/res/values-ja/strings.xml | 2 - app/src/main/res/values-ko/strings.xml | 2 - app/src/main/res/values-nl/strings.xml | 2 - app/src/main/res/values-pt/strings.xml | 2 - app/src/main/res/values-ru/strings.xml | 2 - app/src/main/res/values-sv/strings.xml | 2 - app/src/main/res/values-tr/strings.xml | 2 - app/src/main/res/values-zh-rCN/strings.xml | 2 - app/src/main/res/values-zh-rTW/strings.xml | 2 - app/src/main/res/values/strings.xml | 2 - 19 files changed, 4 insertions(+), 372 deletions(-) delete mode 100644 app/src/main/java/com/platform/middlewares/plugins/CameraPlugin.java diff --git a/app/src/main/java/com/breadwallet/presenter/activities/camera/CameraActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/camera/CameraActivity.java index 8d7134271..42d5896c0 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/camera/CameraActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/camera/CameraActivity.java @@ -46,7 +46,6 @@ import com.breadwallet.presenter.activities.BreadActivity; import com.breadwallet.presenter.activities.util.BRActivity; import com.breadwallet.tools.threads.BRExecutor; -import com.platform.middlewares.plugins.CameraPlugin; import java.io.File; import java.nio.ByteBuffer; @@ -251,7 +250,10 @@ public void onError(@NonNull CameraDevice cameraDevice, int error) { public void onImageAvailable(ImageReader reader) { if (imageTaken) return; imageTaken = true; - mBackgroundHandler.post(new ImageSaver(reader.acquireNextImage())); + //DEV: Breaking the path to remove the ImageSaver and the CameraPlugin + // This was going to update an image to a BRD server + //TODO: Remove the ImageReader in a subsequent commit + //mBackgroundHandler.post(new ImageSaver(reader.acquireNextImage())); } }; @@ -858,50 +860,6 @@ private void setAutoFlash(CaptureRequest.Builder requestBuilder) { } } - /** - * Saves a JPEG {@link Image} into the specified {@link File}. - */ - private static class ImageSaver implements Runnable { - - /** - * The JPEG image - */ - private final Image mImage; - - /** - * The file we save the image into. - */ - - public ImageSaver(Image image) { - mImage = image; - } - - @Override - public void run() { - Timber.d("run: "); - ByteBuffer buffer = mImage.getPlanes()[0].getBuffer(); - final byte[] bytes = new byte[buffer.remaining()]; - buffer.get(bytes); - BRExecutor.getInstance().forMainThreadTasks().execute(new Runnable() { - @Override - public void run() { - BRExecutor.getInstance().forLightWeightBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(1000); - CameraPlugin.handleCameraImageTaken(BreadActivity.getApp(), bytes); - } catch (InterruptedException e) { - Timber.e(e); - } - } - }); - app.finish(); - } - }); - } - } - /** * Compares two {@code Size}s based on their areas. */ diff --git a/app/src/main/java/com/platform/HTTPServer.java b/app/src/main/java/com/platform/HTTPServer.java index 8953ddda8..8dc59a756 100644 --- a/app/src/main/java/com/platform/HTTPServer.java +++ b/app/src/main/java/com/platform/HTTPServer.java @@ -15,7 +15,6 @@ import com.platform.middlewares.HTTPFileMiddleware; import com.platform.middlewares.HTTPIndexMiddleware; import com.platform.middlewares.HTTPRouter; -import com.platform.middlewares.plugins.CameraPlugin; import com.platform.middlewares.plugins.GeoLocationPlugin; import com.platform.middlewares.plugins.KVStorePlugin; import com.platform.middlewares.plugins.LinkPlugin; @@ -218,10 +217,6 @@ private static void setupIntegrations() { Plugin geoLocationPlugin = new GeoLocationPlugin(); httpRouter.appendPlugin(geoLocationPlugin); - // camera plugin - Plugin cameraPlugin = new CameraPlugin(); - httpRouter.appendPlugin(cameraPlugin); - // wallet plugin provides access to the wallet Plugin walletPlugin = new WalletPlugin(); httpRouter.appendPlugin(walletPlugin); diff --git a/app/src/main/java/com/platform/middlewares/plugins/CameraPlugin.java b/app/src/main/java/com/platform/middlewares/plugins/CameraPlugin.java deleted file mode 100644 index 7e435d352..000000000 --- a/app/src/main/java/com/platform/middlewares/plugins/CameraPlugin.java +++ /dev/null @@ -1,289 +0,0 @@ -package com.platform.middlewares.plugins; - -import android.Manifest; -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import androidx.core.app.ActivityCompat; -import androidx.core.content.ContextCompat; -import android.util.Base64; -import android.util.Log; - -import com.breadwallet.BreadApp; -import com.breadwallet.R; -import com.breadwallet.presenter.activities.camera.CameraActivity; -import com.breadwallet.presenter.customviews.BRDialogView; -import com.breadwallet.tools.animation.BRDialog; -import com.breadwallet.tools.crypto.CryptoHelper; -import com.breadwallet.tools.threads.BRExecutor; -import com.breadwallet.tools.util.BRConstants; -import com.platform.BRHTTPHelper; -import com.platform.interfaces.Plugin; - -import org.apache.commons.compress.utils.IOUtils; -import org.apache.commons.io.FileUtils; -import org.eclipse.jetty.continuation.Continuation; -import org.eclipse.jetty.continuation.ContinuationSupport; -import org.eclipse.jetty.server.Request; -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.UnsupportedEncodingException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/2/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class CameraPlugin implements Plugin { - private static Request globalBaseRequest; - private static Continuation continuation; - - @Override - public boolean handle(String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) { - - // GET /_camera/take_picture - // - // Optionally pass ?overlay= (see overlay ids below) to show an overlay - // in picture taking mode - // - // Status codes: - // - 200: Successful image capture - // - 204: User canceled image picker - // - 404: Camera is not available on this device - // - 423: Multiple concurrent take_picture requests. Only one take_picture request may be in flight at once. - // - - if (target.startsWith("/_camera/take_picture")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - final Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(404, "context is null", baseRequest, response); - } - - if (globalBaseRequest != null) { - Timber.i("handle: already taking a picture: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(423, null, baseRequest, response); - } - - PackageManager pm = app.getPackageManager(); - - if (!pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) { - Timber.i("handle: no camera available: "); - return BRHTTPHelper.handleError(404, null, baseRequest, response); - } - - globalBaseRequest = baseRequest; - continuation = ContinuationSupport.getContinuation(request); - continuation.suspend(response); - - try { - // Check if the camera permission is granted - if (ContextCompat.checkSelfPermission(app, - Manifest.permission.CAMERA) - != PackageManager.PERMISSION_GRANTED) { - // Should we show an explanation? - if (ActivityCompat.shouldShowRequestPermissionRationale(((Activity) app), - Manifest.permission.CAMERA)) { - BRDialog.showCustomDialog(app, app.getString(R.string.Send_cameraUnavailabeTitle_android), - app.getString(R.string.Send_cameraUnavailabeMessage_android), - app.getString(R.string.AccessibilityLabels_close), null, new BRDialogView.BROnClickListener() { - @Override - public void onClick(BRDialogView brDialogView) { - brDialogView.dismiss(); - } - }, null, null, 0); - } else { - // No explanation needed, we can request the permission. - ActivityCompat.requestPermissions(((Activity) app), - new String[]{Manifest.permission.CAMERA}, - BRConstants.CAMERA_REQUEST_ID); - globalBaseRequest = null; - } - } else { - // Permission is granted, open camera - Intent intent = new Intent(app, CameraActivity.class); - ((Activity) app).startActivityForResult(intent, BRConstants.REQUEST_IMAGE_CAPTURE); - ((Activity) app).overridePendingTransition(R.anim.fade_up, R.anim.fade_down); - } - } catch (Exception e) { - Timber.e(e); - } - - return true; - } else if (target.startsWith("/_camera/picture/")) { - Timber.i("handling: " + target + " " + baseRequest.getMethod()); - final Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(404, "context is null", baseRequest, response); - } - String id = target.replace("/_camera/picture/", ""); - byte[] pictureBytes = readPictureForId(app, id); - if (pictureBytes == null) { - Timber.i("handle: WARNING pictureBytes is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "pictureBytes is null", baseRequest, response); - } - byte[] imgBytes = pictureBytes; - String b64opt = request.getParameter("base64"); - String contentType = "image/jpeg"; - if (b64opt != null && !b64opt.isEmpty()) { - contentType = "text/plain"; - String b64 = "data:image/jpeg;base64," + Base64.encodeToString(pictureBytes, Base64.NO_WRAP); - try { - imgBytes = b64.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - Timber.e(e); - return BRHTTPHelper.handleError(500, null, baseRequest, response); - } - } - return BRHTTPHelper.handleSuccess(200, imgBytes, baseRequest, response, contentType); - } else return false; - } - - public static void handleCameraImageTaken(final Context context, final byte[] data) { - BRExecutor.getInstance().forLightWeightBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - Bitmap img = getResizedBitmap(BitmapFactory.decodeByteArray(data, 0, data.length), 1000); - Timber.i("handleCameraImageTaken: w:" + img.getWidth() + "h:" + img.getHeight()); - if (globalBaseRequest == null || continuation == null) { - //shit should now happen - Timber.i("handleCameraImageTaken: WARNING: " + continuation + " " + globalBaseRequest); - return; - } - try { - if (img == null) { - //no image - globalBaseRequest.setHandled(true); - ((HttpServletResponse) continuation.getServletResponse()).setStatus(204); - continuation.complete(); - return; - } - String id = writeToFile(context, img); - Timber.d("handleCameraImageTaken: %s", id); - if (id != null) { - JSONObject respJson = new JSONObject(); - try { - respJson.put("id", id); - } catch (JSONException e) { - Timber.e(e); - globalBaseRequest.setHandled(true); - try { - ((HttpServletResponse) continuation.getServletResponse()).sendError(500); - } catch (IOException e1) { - Timber.e(e1); - } - continuation.complete(); - return; - } - continuation.getServletResponse().setContentType("application/json"); - ((HttpServletResponse) continuation.getServletResponse()).setStatus(200); - BRHTTPHelper.handleSuccess(200, respJson.toString().getBytes(), globalBaseRequest, (HttpServletResponse) continuation.getServletResponse(), "application/json"); - continuation.complete(); - - } else { - Timber.i("handleCameraImageTaken: error writing image"); - try { - globalBaseRequest.setHandled(true); - ((HttpServletResponse) continuation.getServletResponse()).sendError(500); - continuation.complete(); - } catch (IOException e) { - Timber.e(e); - } - } - } finally { - globalBaseRequest = null; - continuation = null; - } - } - }); - } - - private static String writeToFile(Context context, Bitmap img) { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - try { - img.compress(Bitmap.CompressFormat.JPEG, 70, out); - String name = CryptoHelper.base58ofSha256(out.toByteArray()); - File storageDir = new File(context.getFilesDir().getAbsolutePath() + "/pictures/"); - File image = new File(storageDir, name + ".jpeg"); - FileUtils.writeByteArrayToFile(image, out.toByteArray()); - return name; - // PNG is a lossless format, the compression factor (100) is ignored - } catch (Exception e) { - Timber.e(e); - } finally { - try { - out.close(); - } catch (IOException e) { - Timber.e(e); - } - } - return null; - } - - public static Bitmap getResizedBitmap(Bitmap image, int maxSize) { - int width = image.getWidth(); - int height = image.getHeight(); - - float bitmapRatio = (float) width / (float) height; - if (bitmapRatio > 1) { - width = maxSize; - height = (int) (width / bitmapRatio); - } else { - height = maxSize; - width = (int) (height * bitmapRatio); - } - return Bitmap.createScaledBitmap(image, width, height, true); - } - - public byte[] readPictureForId(Context context, String id) { - Timber.d("readPictureForId: %s", id); - try { - //create FileInputStream object - FileInputStream fin = new FileInputStream(new File(context.getFilesDir().getAbsolutePath() + "/pictures/" + id + ".jpeg")); - - //create string from byte array - return IOUtils.toByteArray(fin); - } catch (FileNotFoundException e) { - Timber.e(e); - } catch (IOException ioe) { - Timber.e(ioe); - } - return null; - } -} diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 334ccabc3..88e5fedf1 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -120,8 +120,6 @@ Send Ja - - Centrer dit ID i boksen Beløb der skal sendes: diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 9c818365d..2df6b0e5e 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -120,8 +120,6 @@ Abschicken Ja - - Zentriere deinen Ausweis im Rechteck Betrag, welcher versendet werden soll: diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 311e8a025..512f3c8ae 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -120,8 +120,6 @@ Enviar - - Centra tu ID en el recuadro Cantidad a enviar: diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index a1b1697b5..59d68708c 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -120,8 +120,6 @@ Envoyer Oui - - Centrez votre identifiant dans le champ Montant à envoyer : diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 88fa48528..a213a3559 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -120,8 +120,6 @@ Kirimkan Iya - - Pusatkan ID Anda di dalam kotak Jumlah yang akan dikirim: diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 2c10c2b15..96a6e09c0 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -120,8 +120,6 @@ Invia - - Centra il tuo ID nel riquadro Somma da inviare: diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 7e55e6476..d0bc1978d 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -120,8 +120,6 @@ 提出 はい - - ご自身のIDをこのボックス内で中央に配置してください 送金する数量: diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 930df1780..b2575a763 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -120,8 +120,6 @@ 전송 - - 박스안에 귀하의 ID를 중앙에 두세요 보낼 금액: diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index f0427e3f1..201217e75 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -120,8 +120,6 @@ Indienen Ja - - Centreer je ID in het vak Bedrag om te Versturen: diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 9b4b764cf..32d5a396d 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -120,8 +120,6 @@ Submeter Sim - - Centre a sua ID na caixa Montante a enviar: diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 5cf3b8c59..a7acad874 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -120,8 +120,6 @@ Отправить Да - - Поместите ваш ID-номер в центр данного поля Сумма для отправки: diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 85d339719..19de25609 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -120,8 +120,6 @@ Överlämna Ja - - Centrera ditt ID i boxen Belopp att skicka: diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index faf31cef8..2693897d6 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -118,8 +118,6 @@ Sunmak Evet - - Kimliğinizi kutuda ortalayın Gönderilecek tutar: diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 2e9a97b1c..432591ec1 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -120,8 +120,6 @@ 提交 - - 将您的身份证号集中在方框中 发送金额: diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index d642e601c..705399e27 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -120,8 +120,6 @@ 提交 - - 將您的 ID 在方塊置中 寄送金額: diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b8d358af5..8da711596 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -118,8 +118,6 @@ Submit Yes - - Center your ID in the box Amount to Send: From e68deeb782c00c1e4f91ea668f9390dafee08ef4 Mon Sep 17 00:00:00 2001 From: kcw-grunt Date: Mon, 22 Nov 2021 23:20:34 -0800 Subject: [PATCH 3/9] code bump - to closely track the deletions --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 876c205d9..acad6dbc2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,7 +58,7 @@ android { applicationId = 'com.loafwallet' minSdkVersion 27 targetSdkVersion 30 - versionCode 647 + versionCode 648 versionName "v2.4.2" multiDexEnabled true archivesBaseName = "${versionName}(${versionCode})" From 1c51932b5d7c1fcaf9a327b61968aff3aadb4936 Mon Sep 17 00:00:00 2001 From: kcw-grunt Date: Mon, 22 Nov 2021 23:27:00 -0800 Subject: [PATCH 4/9] Removal of the GeoLocationPlugin code bump --- app/build.gradle | 2 +- .../main/java/com/platform/HTTPServer.java | 5 - .../plugins/GeoLocationPlugin.java | 248 ------------------ 3 files changed, 1 insertion(+), 254 deletions(-) delete mode 100644 app/src/main/java/com/platform/middlewares/plugins/GeoLocationPlugin.java diff --git a/app/build.gradle b/app/build.gradle index acad6dbc2..316351897 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,7 +58,7 @@ android { applicationId = 'com.loafwallet' minSdkVersion 27 targetSdkVersion 30 - versionCode 648 + versionCode 649 versionName "v2.4.2" multiDexEnabled true archivesBaseName = "${versionName}(${versionCode})" diff --git a/app/src/main/java/com/platform/HTTPServer.java b/app/src/main/java/com/platform/HTTPServer.java index 8dc59a756..6c8a658d5 100644 --- a/app/src/main/java/com/platform/HTTPServer.java +++ b/app/src/main/java/com/platform/HTTPServer.java @@ -15,7 +15,6 @@ import com.platform.middlewares.HTTPFileMiddleware; import com.platform.middlewares.HTTPIndexMiddleware; import com.platform.middlewares.HTTPRouter; -import com.platform.middlewares.plugins.GeoLocationPlugin; import com.platform.middlewares.plugins.KVStorePlugin; import com.platform.middlewares.plugins.LinkPlugin; import com.platform.middlewares.plugins.WalletPlugin; @@ -213,10 +212,6 @@ private static void setupIntegrations() { HTTPIndexMiddleware httpIndexMiddleware = new HTTPIndexMiddleware(); middlewares.add(httpIndexMiddleware); - // geo plugin provides access to onboard geo location functionality - Plugin geoLocationPlugin = new GeoLocationPlugin(); - httpRouter.appendPlugin(geoLocationPlugin); - // wallet plugin provides access to the wallet Plugin walletPlugin = new WalletPlugin(); httpRouter.appendPlugin(walletPlugin); diff --git a/app/src/main/java/com/platform/middlewares/plugins/GeoLocationPlugin.java b/app/src/main/java/com/platform/middlewares/plugins/GeoLocationPlugin.java deleted file mode 100644 index 9c9f00262..000000000 --- a/app/src/main/java/com/platform/middlewares/plugins/GeoLocationPlugin.java +++ /dev/null @@ -1,248 +0,0 @@ -package com.platform.middlewares.plugins; - -import android.Manifest; -import android.app.Activity; -import android.content.Context; -import android.content.pm.PackageManager; -import android.location.LocationManager; - -import androidx.core.app.ActivityCompat; -import androidx.core.content.ContextCompat; - -import com.breadwallet.BreadApp; -import com.breadwallet.tools.manager.BRSharedPrefs; -import com.breadwallet.tools.threads.BRExecutor; -import com.breadwallet.tools.util.BRConstants; -import com.platform.BRHTTPHelper; -import com.platform.GeoLocationManager; -import com.platform.interfaces.Plugin; - -import org.eclipse.jetty.continuation.Continuation; -import org.eclipse.jetty.continuation.ContinuationSupport; -import org.eclipse.jetty.server.Request; -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.IOException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/2/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class GeoLocationPlugin implements Plugin { - - private static Continuation continuation; - private static Request globalBaseRequest; - - public static void handleGeoPermission(final boolean granted) { - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - if (continuation == null) { - Timber.d("handleGeoPermission: WARNING continuation is null"); - return; - } - - try { - if (granted) { - globalBaseRequest.setHandled(true); - ((HttpServletResponse) continuation.getServletResponse()).setStatus(204); - - } else { - try { - Timber.d("handleGeoPermission: granted is false"); - globalBaseRequest.setHandled(true); - ((HttpServletResponse) continuation.getServletResponse()).sendError(400); - } catch (IOException e) { - Timber.e(e); - } - } - } finally { - continuation.complete(); - continuation = null; - globalBaseRequest = null; - } - } - }); - } - - - @Override - public boolean handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - if (target.startsWith("/_permissions/geo")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "context is null", baseRequest, response); - } - switch (request.getMethod()) { - // GET /_permissions/geo - // - // Call this method to retrieve the current permission status for geolocation. - // The returned JSON dictionary contains the following keys: - // - // "status" = "denied" | "restricted | "undetermined" | "inuse" | "always" - // "user_queried" = true | false - // "location_enabled" = true | false - // - // The status correspond to those found in the apple CLLocation documentation: http://apple.co/1O0lHFv - // - // "user_queried" indicates whether or not the user has already been asked for geolocation - // "location_enabled" indicates whether or not the user has geo location enabled on their phone - case "GET": - JSONObject jsonResult = new JSONObject(); - String status; - boolean enabled; - boolean permRequested = BRSharedPrefs.getGeoPermissionsRequested(app); - int permissionCheck = ContextCompat.checkSelfPermission(app, Manifest.permission.ACCESS_FINE_LOCATION); - if (permissionCheck == PackageManager.PERMISSION_GRANTED) { - status = "always"; - enabled = true; - } else { - Timber.d("handle: sending permission denied: " + target + " " + baseRequest.getMethod()); - status = permRequested ? "denied" : "undetermined"; - enabled = false; - } - try { - jsonResult.put("status", status); - jsonResult.put("user_queried", permRequested); - jsonResult.put("location_enabled", enabled); - return BRHTTPHelper.handleSuccess(200, jsonResult.toString().getBytes(), baseRequest, response, null); - } catch (JSONException e) { - Timber.e(e); - Timber.d("handle: failed to send permission status: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, null, baseRequest, response); - } - // POST /_permissions/geo - // - // Call this method to request the geo permission from the user. - // The request body should be a JSON dictionary containing a single key, "style" - // the value of which should be either "inuse" or "always" - these correspond to the - // two ways the user can authorize geo access to the app. "inuse" will request - // geo availability to the app when the app is foregrounded, and "always" will request - // full time geo availability to the app - case "POST": - if (ContextCompat.checkSelfPermission(app, Manifest.permission.ACCESS_FINE_LOCATION) - != PackageManager.PERMISSION_GRANTED) { - Timber.d("handle: requesting permissions: " + target + " " + baseRequest.getMethod()); - ActivityCompat.requestPermissions((Activity) app, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, BRConstants.GEO_REQUEST_ID); - } - BRSharedPrefs.putGeoPermissionsRequested(app, true); - continuation = ContinuationSupport.getContinuation(request); - continuation.suspend(response); - globalBaseRequest = baseRequest; - return true; - - } - } else if (target.startsWith("/_geo") && !target.startsWith("/_geosocket")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - // GET /_geo - // - // Calling this method will query CoreLocation for a location object. The returned value may not be returned - // very quick (sometimes getting a geo lock takes some time) so be sure to display to the user some status - // while waiting for a response. - // - // Response Object: - // - // "coordinates" = { "latitude": double, "longitude": double } - // "altitude" = double - // "description" = "a string representation of this object" - // "timestamp" = "ISO-8601 timestamp of when this location was generated" - // "horizontal_accuracy" = double - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "context is null", baseRequest, response); - } - - if (request.getMethod().equalsIgnoreCase("GET")) { - JSONObject obj = getAuthorizationError(app); - if (obj != null) { - Timber.d("handle: error getting location: " + obj.toString() + ", " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, obj.toString(), baseRequest, response); - } - - continuation = ContinuationSupport.getContinuation(request); - continuation.suspend(response); - GeoLocationManager.getInstance().getOneTimeGeoLocation(continuation, baseRequest); - return true; - } - } else if (target.startsWith("/_geosocket")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - // GET /_geosocket - // - // This opens up a websocket to the location manager. It will return a new location every so often (but with no - // predetermined interval) with the same exact structure that is sent via the GET /_geo call. - // - // It will start the location manager when there is at least one client connected and stop the location manager - // when the last client disconnects. - return true; - } - - return false; - } - - private JSONObject getAuthorizationError(Context app) { - String error = null; - - LocationManager lm = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); - boolean gps_enabled = false; - boolean network_enabled = false; - - try { - gps_enabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER); - } catch (Exception ignored) { - Timber.e(ignored); - } - - try { - network_enabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER); - } catch (Exception ignored) { - } - if (!gps_enabled && !network_enabled) { - error = "Location services are disabled"; - } - int permissionCheck = ContextCompat.checkSelfPermission(app, Manifest.permission.ACCESS_FINE_LOCATION); - if (permissionCheck != PackageManager.PERMISSION_GRANTED) { - error = "Location services are not authorized"; - } - - if (error != null) { - JSONObject obj = new JSONObject(); - try { - obj.put("error", error); - } catch (JSONException e) { - Timber.e(e); - } - return obj; - } else { - return null; - } - } -} From 6739b962b6ed29f22ec4d2117648974c377da6a9 Mon Sep 17 00:00:00 2001 From: kcw-grunt Date: Tue, 23 Nov 2021 01:05:41 -0800 Subject: [PATCH 5/9] Removed unused plugins - Deleted KVStore Plugin - Deleted Link Plugin - code bump --- app/build.gradle | 2 +- .../activities/settings/SettingsActivity.java | 30 +-- .../activities/settings/WebViewActivity.java | 3 +- .../main/java/com/platform/HTTPServer.java | 10 - .../middlewares/plugins/KVStorePlugin.java | 194 ------------------ .../middlewares/plugins/LinkPlugin.java | 177 ---------------- 6 files changed, 19 insertions(+), 397 deletions(-) delete mode 100644 app/src/main/java/com/platform/middlewares/plugins/KVStorePlugin.java delete mode 100644 app/src/main/java/com/platform/middlewares/plugins/LinkPlugin.java diff --git a/app/build.gradle b/app/build.gradle index 316351897..b5a529fb4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,7 +58,7 @@ android { applicationId = 'com.loafwallet' minSdkVersion 27 targetSdkVersion 30 - versionCode 649 + versionCode 650 versionName "v2.4.2" multiDexEnabled true archivesBaseName = "${versionName}(${versionCode})" diff --git a/app/src/main/java/com/breadwallet/presenter/activities/settings/SettingsActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/settings/SettingsActivity.java index a08d1483e..0c69d1454 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/settings/SettingsActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/settings/SettingsActivity.java @@ -49,7 +49,6 @@ protected void onCreate(Bundle savedInstanceState) { listView = findViewById(R.id.settings_list); } - public class SettingsListAdapter extends ArrayAdapter { private List items; @@ -116,8 +115,11 @@ public void onBackPressed() { } private void populateItems() { + + /*Wallet Title*/ items.add(new BRSettingsItem(getString(R.string.Settings_wallet), "", null, true)); + /*Import Title*/ items.add(new BRSettingsItem(getString(R.string.Settings_importTitle), "", v -> { Intent intent = new Intent(SettingsActivity.this, ImportActivity.class); startActivity(intent); @@ -125,14 +127,17 @@ private void populateItems() { }, false)); + /*Wipe Start_Recover Wallet*/ items.add(new BRSettingsItem(getString(R.string.Settings_wipe), "", v -> { Intent intent = new Intent(SettingsActivity.this, WipeActivity.class); startActivity(intent); overridePendingTransition(R.anim.enter_from_bottom, R.anim.empty_300); }, false)); + /*Manage Title*/ items.add(new BRSettingsItem(getString(R.string.Settings_manage), "", null, true)); + /*Fingerprint Limits*/ if (AuthManager.isFingerPrintAvailableAndSetup(this)) { items.add(new BRSettingsItem(getString(R.string.Settings_touchIdLimit_android), "", v -> AuthManager.getInstance().authPrompt(SettingsActivity.this, null, getString(R.string.VerifyPin_continueBody), true, false, new BRAuthCompletion() { @Override @@ -149,61 +154,60 @@ public void onCancel() { }), false)); } + /*Languages*/ items.add(new BRSettingsItem(getString(R.string.Settings_languages), null, v -> { ChangeLanguageBottomSheet fragment = new ChangeLanguageBottomSheet(); fragment.show(getSupportFragmentManager(), fragment.getTag()); }, false)); + /*Display Currency*/ items.add(new BRSettingsItem(getString(R.string.Settings_currency), BRSharedPrefs.getIso(this), v -> { Intent intent = new Intent(SettingsActivity.this, DisplayCurrencyActivity.class); startActivity(intent); overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left); }, false)); + /*Sync Blockchain*/ items.add(new BRSettingsItem(getString(R.string.Settings_sync), "", v -> { Intent intent = new Intent(SettingsActivity.this, SyncBlockchainActivity.class); startActivity(intent); overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left); }, false)); + /*SPACER*/ items.add(new BRSettingsItem("", "", null, true)); + /*Share Anonymous Data*/ items.add(new BRSettingsItem(getString(R.string.Settings_shareData), "", v -> { Intent intent = new Intent(SettingsActivity.this, ShareDataActivity.class); startActivity(intent); overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left); }, false)); - boolean eaEnabled = APIClient.getInstance(this).isFeatureEnabled(APIClient.FeatureFlags.EARLY_ACCESS.toString()); - eaEnabled = false; - if (eaEnabled) - items.add(new BRSettingsItem(getString(R.string.Settings_earlyAccess), "", v -> { - Intent intent = new Intent(SettingsActivity.this, WebViewActivity.class); - intent.putExtra(WebViewActivity.URL_EXTRA, HTTPServer.URL_EA); - Activity app = SettingsActivity.this; - app.startActivity(intent); - app.overridePendingTransition(R.anim.enter_from_bottom, R.anim.empty_300); - }, false)); - + /*About*/ items.add(new BRSettingsItem(getString(R.string.Settings_about), "", v -> { Intent intent = new Intent(SettingsActivity.this, AboutActivity.class); startActivity(intent); overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left); }, false)); + /*SPACER*/ items.add(new BRSettingsItem("", "", null, true)); + /*Advanced Settings*/ items.add(new BRSettingsItem(getString(R.string.Settings_advancedTitle), "", v -> { Intent intent = new Intent(SettingsActivity.this, AdvancedActivity.class); startActivity(intent); overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left); }, false)); - items.add(new BRSettingsItem("", "", null, true)); //just for a blank space + /*SPACER*/ + items.add(new BRSettingsItem("", "", null, true)); } @Override protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); } @Override diff --git a/app/src/main/java/com/breadwallet/presenter/activities/settings/WebViewActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/settings/WebViewActivity.java index 1cbbf2ecc..d74439fca 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/settings/WebViewActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/settings/WebViewActivity.java @@ -16,7 +16,6 @@ import com.breadwallet.tools.animation.BRAnimator; import com.breadwallet.tools.util.Utils; import com.platform.HTTPServer; -import com.platform.middlewares.plugins.LinkPlugin; import org.json.JSONException; import org.json.JSONObject; @@ -157,6 +156,7 @@ private boolean setupServerMode(String url) { @Override protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); } @Override @@ -180,6 +180,5 @@ protected void onResume() { protected void onPause() { super.onPause(); appVisible = false; - LinkPlugin.hasBrowser = false; } } diff --git a/app/src/main/java/com/platform/HTTPServer.java b/app/src/main/java/com/platform/HTTPServer.java index 6c8a658d5..3e64a1948 100644 --- a/app/src/main/java/com/platform/HTTPServer.java +++ b/app/src/main/java/com/platform/HTTPServer.java @@ -15,8 +15,6 @@ import com.platform.middlewares.HTTPFileMiddleware; import com.platform.middlewares.HTTPIndexMiddleware; import com.platform.middlewares.HTTPRouter; -import com.platform.middlewares.plugins.KVStorePlugin; -import com.platform.middlewares.plugins.LinkPlugin; import com.platform.middlewares.plugins.WalletPlugin; import org.eclipse.jetty.server.Request; @@ -215,14 +213,6 @@ private static void setupIntegrations() { // wallet plugin provides access to the wallet Plugin walletPlugin = new WalletPlugin(); httpRouter.appendPlugin(walletPlugin); - - // link plugin which allows opening links to other apps - Plugin linkPlugin = new LinkPlugin(); - httpRouter.appendPlugin(linkPlugin); - - // kvstore plugin provides access to the shared replicated kv store - Plugin kvStorePlugin = new KVStorePlugin(); - httpRouter.appendPlugin(kvStorePlugin); } } diff --git a/app/src/main/java/com/platform/middlewares/plugins/KVStorePlugin.java b/app/src/main/java/com/platform/middlewares/plugins/KVStorePlugin.java deleted file mode 100644 index 7d4dc7a7f..000000000 --- a/app/src/main/java/com/platform/middlewares/plugins/KVStorePlugin.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.platform.middlewares.plugins; - -import android.content.Context; - -import com.breadwallet.BreadApp; -import com.platform.APIClient; -import com.platform.BRHTTPHelper; -import com.platform.interfaces.Plugin; -import com.platform.kvstore.CompletionObject; -import com.platform.kvstore.RemoteKVStore; -import com.platform.kvstore.ReplicatedKVStore; -import com.platform.sqlite.KVItem; - -import org.eclipse.jetty.server.Request; -import org.json.JSONException; -import org.json.JSONObject; - -import java.text.SimpleDateFormat; -import java.util.Locale; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/1/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class KVStorePlugin implements Plugin { - - @Override - public boolean handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - if (target.startsWith("/_kv/")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - String key = target.replace("/_kv/", ""); - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "context is null", baseRequest, response); - } - if (key.isEmpty()) { - Timber.i("handle: missing key argument: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(400, null, baseRequest, response); - } - - RemoteKVStore remote = RemoteKVStore.getInstance(APIClient.getInstance(app)); - ReplicatedKVStore store = ReplicatedKVStore.getInstance(app, remote); - switch (request.getMethod()) { - case "GET": - Timber.d("handle: " + target + " " + baseRequest.getMethod() + ", key: " + key); - CompletionObject getObj = store.get(getKey(key), 0); - KVItem kv = getObj.kv; - - if (kv == null || kv.deleted > 0) { - Timber.w("handle: kv store does not contain the kv: %s", key); - return BRHTTPHelper.handleError(404, null, baseRequest, decorateResponse(0, 0, response)); - } - try { - JSONObject test = new JSONObject(new String(kv.value)); //just check for validity - } catch (JSONException e) { - Timber.e(e); - Timber.d("handle: the json is not valid: for key: " + key + ", " + target + " " + baseRequest.getMethod()); - store.delete(getKey(key), kv.version); - return BRHTTPHelper.handleError(404, null, baseRequest, decorateResponse(kv.version, kv.time, response)); - } - - if (kv.deleted > 0) { - Timber.w("handle: the key is gone: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(410, "Gone", baseRequest, decorateResponse(kv.version, kv.time, response)); - } - return BRHTTPHelper.handleSuccess(200, kv.value, baseRequest, decorateResponse(kv.version, kv.time, response), "application/json"); - case "PUT": - Timber.d("handle:" + target + " " + baseRequest.getMethod() + ", key: " + key); - // Read from request - byte[] rawData = BRHTTPHelper.getBody(request); - - if (rawData == null) { - Timber.i("handle: missing request body: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(400, null, baseRequest, response); - } - - String strVersion = request.getHeader("if-none-match"); - if (strVersion == null) { - Timber.i("handle: missing If-None-Match header, set to `0` if creating a new key: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(400, null, baseRequest, response); - } - String ct = request.getHeader("content-type"); - if (ct == null || !ct.equalsIgnoreCase("application/json")) { - Timber.i("handle: can only set application/json request bodies: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(400, null, baseRequest, response); - } - - long version = Long.valueOf(strVersion); - - CompletionObject setObj = store.set(new KVItem(version, 0, getKey(key), rawData, System.currentTimeMillis(), 0)); - if (setObj.err != null) { - Timber.i("handle: error setting the key: " + key + ", err: " + setObj.err); - int errCode = transformErrorToResponseCode(setObj.err); - return BRHTTPHelper.handleError(errCode, null, baseRequest, response); - } - - return BRHTTPHelper.handleSuccess(204, null, baseRequest, decorateResponse(setObj.version, setObj.time, response), null); - case "DELETE": - Timber.d("handle: : " + target + " " + baseRequest.getMethod() + ", key: " + key); - strVersion = request.getHeader("if-none-match"); - Timber.d("handle: missing If-None-Match header: " + target + " " + baseRequest.getMethod()); - - if (strVersion == null) { - Timber.d("handle: if-none-match is missing, sending 400"); - return BRHTTPHelper.handleError(400, null, baseRequest, response); - } - - CompletionObject delObj; - try { - delObj = store.delete(getKey(key), Long.parseLong(strVersion)); - } catch (NumberFormatException e) { - Timber.e(e); - return BRHTTPHelper.handleError(500, null, baseRequest, response); - } - if (delObj == null || delObj.err != null) { - int err = 500; - - if (delObj != null) { - Timber.d("handle: error deleting key: " + key + ", err: " + delObj.err); - err = transformErrorToResponseCode(delObj.err); - } else { - Timber.d("handle: error deleting key: " + key + ", delObj is null"); - } - return BRHTTPHelper.handleError(err, null, baseRequest, response); - } - response.setHeader("ETag", String.valueOf(delObj.version)); - response.addHeader("Cache-Control", "max-age=0, must-revalidate"); - SimpleDateFormat dateFormat = new SimpleDateFormat( - "EEE, dd MMM yyyy HH:mm:ss z", Locale.US); - String rfc1123 = dateFormat.format(delObj.time); - response.setHeader("Last-Modified", rfc1123); - return BRHTTPHelper.handleSuccess(204, null, baseRequest, response, null); - } - } - - return false; - } - - private HttpServletResponse decorateResponse(long ver, long time, HttpServletResponse response) { - response.addHeader("Cache-Control", "max-age=0, must-revalidate"); - response.addHeader("ETag", String.valueOf(ver)); - - SimpleDateFormat dateFormat = new SimpleDateFormat( - "EEE, dd MMM yyyy HH:mm:ss z", Locale.US); - String rfc1123 = dateFormat.format(time); - response.setHeader("Content-Type", "application/json"); - response.addHeader("Last-Modified", rfc1123); - return response; - } - - private String getKey(String key) { - if (key == null) Timber.d("getKey: key is null"); - return "plat-" + key; - } - - private int transformErrorToResponseCode(CompletionObject.RemoteKVStoreError err) { - switch (err) { - case notFound: - return 404; - case conflict: - return 409; - default: - Timber.d("transformErrorToResponseCode: unexpected error: " + err.name()); - return 500; - } - } - -} diff --git a/app/src/main/java/com/platform/middlewares/plugins/LinkPlugin.java b/app/src/main/java/com/platform/middlewares/plugins/LinkPlugin.java deleted file mode 100644 index 1bad8ab0f..000000000 --- a/app/src/main/java/com/platform/middlewares/plugins/LinkPlugin.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.platform.middlewares.plugins; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.net.Uri; - -import com.breadwallet.BreadApp; -import com.breadwallet.R; -import com.breadwallet.presenter.activities.settings.WebViewActivity; -import com.breadwallet.tools.util.Utils; -import com.platform.BRHTTPHelper; -import com.platform.interfaces.Plugin; - -import org.eclipse.jetty.server.Request; -import org.json.JSONException; -import org.json.JSONObject; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/2/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class LinkPlugin implements Plugin { - public static boolean hasBrowser; - - @Override - public boolean handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - if (target.startsWith("/_open_url")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - String url = request.getParameter("url"); - - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "context is null", baseRequest, response); - } - - if (url != null && url.startsWith("tel")) { - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url.replace("/", ""))); - app.startActivity(intent); - } else { - Timber.e(new RuntimeException("could not handle url: " + url)); - } - - return BRHTTPHelper.handleSuccess(204, null, baseRequest, response, null); - } else if (target.startsWith("/_open_maps")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "context is null", baseRequest, response); - } - String address = baseRequest.getParameter("address"); - String fromPoint = baseRequest.getParameter("from_point"); - if (address == null || fromPoint == null) { - Timber.i("handle: bad request: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "bad request", baseRequest, response); - } - String uri = "http://maps.google.com/maps?q=" + fromPoint + "&daddr=" + address + "&mode=driving"; - Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)); - app.startActivity(Intent.createChooser(intent, "Select an application")); - return BRHTTPHelper.handleSuccess(204, null, baseRequest, response, null); - } else if (target.startsWith("/_browser")) { - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "context is null", baseRequest, response); - } - switch (request.getMethod()) { - case "GET": - // opens the in-app browser for the provided URL - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - - if (hasBrowser) - return BRHTTPHelper.handleError(409, "Conflict", baseRequest, response); - String getUrl = baseRequest.getParameter("url"); - if (Utils.isNullOrEmpty(getUrl)) - return BRHTTPHelper.handleError(400, "missing url param", baseRequest, response); - - Uri getUri = Uri.parse(getUrl); - if (getUri == null || getUri.toString().isEmpty()) - return BRHTTPHelper.handleError(400, "failed to escape url", baseRequest, response); - - hasBrowser = true; - Intent getInt = new Intent(app, WebViewActivity.class); - getInt.putExtra(WebViewActivity.URL_EXTRA, getUri.toString()); - app.startActivity(getInt); - ((Activity) app).overridePendingTransition(R.anim.enter_from_bottom, R.anim.fade_down); - return BRHTTPHelper.handleSuccess(204, null, baseRequest, response, null); - case "POST": - // opens a browser with a customized request object - // params: - // { - // "url": "http://myirl.com", - // "method": "POST", - // "body": "stringified request body...", - // "headers": {"X-Header": "Blerb"} - // "closeOn": "http://someurl", - // } - // Only the "url" parameter is required. If only the "url" parameter - // is supplied the request acts exactly like the GET /_browser resource above - // - // When the "closeOn" parameter is provided the web view will automatically close - // if the browser navigates to this exact URL. It is useful for oauth redirects - // and the like - - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - - if (hasBrowser) - return BRHTTPHelper.handleError(409, "Conflict", baseRequest, response); - - byte[] body = BRHTTPHelper.getBody(request); - - if (Utils.isNullOrEmpty(body)) - return BRHTTPHelper.handleError(400, "missing body", baseRequest, response); - - JSONObject json; - try { - json = new JSONObject(new String(body)); //TODO: just check for validity - } catch (JSONException e) { - Timber.e(e, "handle: the json is not valid: %s %s", target, baseRequest.getMethod()); - return BRHTTPHelper.handleError(400, "could not deserialize json object ", baseRequest, response); - } - - //check all the params - String postUrl; - try { - postUrl = json.getString("url"); - String method = json.getString("method"); - String strBody = json.getString("body"); - String headers = json.getString("headers"); - String closeOn = json.getString("closeOn"); - if (Utils.isNullOrEmpty(postUrl) || Utils.isNullOrEmpty(method) || - Utils.isNullOrEmpty(strBody) || Utils.isNullOrEmpty(headers) || Utils.isNullOrEmpty(closeOn)) - return BRHTTPHelper.handleError(400, "malformed json:" + json.toString(), baseRequest, response); - } catch (JSONException e) { - Timber.e(e); - return BRHTTPHelper.handleError(400, "malformed json:" + json.toString(), baseRequest, response); - } - - hasBrowser = true; - Intent postInt = new Intent(app, WebViewActivity.class); - postInt.putExtra(WebViewActivity.URL_EXTRA, postUrl); - postInt.putExtra(WebViewActivity.JSON_EXTRA, json.toString()); - app.startActivity(postInt); - ((Activity) app).overridePendingTransition(R.anim.enter_from_bottom, R.anim.fade_down); - return BRHTTPHelper.handleSuccess(204, null, baseRequest, response, null); - } - } - return false; - } -} From ee0c8450071f98d1a2bf6d0c8c60726290596558 Mon Sep 17 00:00:00 2001 From: kcw-grunt Date: Tue, 23 Nov 2021 01:32:07 -0800 Subject: [PATCH 6/9] Removed WebActivity class -Not being used. code bump --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 5 - .../activities/settings/WebViewActivity.java | 184 ------------------ .../presenter/fragments/FragmentMenu.java | 39 +--- 4 files changed, 6 insertions(+), 224 deletions(-) delete mode 100644 app/src/main/java/com/breadwallet/presenter/activities/settings/WebViewActivity.java diff --git a/app/build.gradle b/app/build.gradle index b5a529fb4..1f8d5ca88 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,7 +58,7 @@ android { applicationId = 'com.loafwallet' minSdkVersion 27 targetSdkVersion 30 - versionCode 650 + versionCode 651 versionName "v2.4.2" multiDexEnabled true archivesBaseName = "${versionName}(${versionCode})" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ef96b7487..f458e5127 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -182,11 +182,6 @@ android:launchMode="singleTask" android:screenOrientation="portrait"> - - ()); - } else if (method.equalsIgnoreCase("post")) { - webView.postUrl(url, body); // TODO: find a way to add the headers to the post request too - } else { - throw new NullPointerException("unexpected method: " + method); - } - } catch (JSONException e) { - Timber.e(e, "request: Failed to parse json or not enough params: %s", jsonString); - } - } - - private void navigate(String to) { - String js = String.format("window.location = \'%s\';", to); - webView.evaluateJavascript(js, new ValueCallback() { - @Override - public void onReceiveValue(String value) { - Timber.d("onReceiveValue: %s", value); - } - }); - } - - private boolean setupServerMode(String url) { - if (url.equalsIgnoreCase(HTTPServer.URL_BUY)) { - HTTPServer.mode = HTTPServer.ServerMode.BUY; - } else if (url.equalsIgnoreCase(HTTPServer.URL_SUPPORT)) { - HTTPServer.mode = HTTPServer.ServerMode.SUPPORT; - } else if (url.equalsIgnoreCase(HTTPServer.URL_EA)) { - HTTPServer.mode = HTTPServer.ServerMode.EA; - } else { - Timber.d("setupServerMode: unknown url: %s", url); - return false; - } - return true; - } - - @Override - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - } - - @Override - public void onBackPressed() { - if (ActivityUTILS.isLast(this)) { - BRAnimator.startBreadActivity(this, false); - } else { - super.onBackPressed(); - } - overridePendingTransition(R.anim.fade_up, R.anim.exit_to_bottom); - } - - @Override - protected void onResume() { - super.onResume(); - appVisible = true; - app = this; - } - - @Override - protected void onPause() { - super.onPause(); - appVisible = false; - } -} diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentMenu.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentMenu.java index 67b25005c..b7e2291c6 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentMenu.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentMenu.java @@ -25,7 +25,6 @@ import com.breadwallet.R; import com.breadwallet.presenter.activities.settings.SecurityCenterActivity; import com.breadwallet.presenter.activities.settings.SettingsActivity; -import com.breadwallet.presenter.activities.settings.WebViewActivity; import com.breadwallet.presenter.entities.BRMenuItem; import com.breadwallet.tools.animation.BRAnimator; import com.breadwallet.tools.animation.SlideDetector; @@ -36,31 +35,6 @@ import java.util.ArrayList; import java.util.List; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentMenu extends Fragment { public TextView mTitle; @@ -82,37 +56,34 @@ public View onCreateView(LayoutInflater inflater, }); itemList = new ArrayList<>(); - boolean buyBitcoinEnabled = APIClient.getInstance(getActivity()).isFeatureEnabled(APIClient.FeatureFlags.BUY_BITCOIN.toString()); - if (buyBitcoinEnabled) { - itemList.add(new BRMenuItem(getString(R.string.MenuButton_buy), R.drawable.buy_bitcoin, v -> { - Intent intent = new Intent(getActivity(), WebViewActivity.class); - intent.putExtra(WebViewActivity.URL_EXTRA, HTTPServer.URL_BUY); - launchActivity(intent); - })); - } + /* Security Center */ itemList.add(new BRMenuItem(getString(R.string.MenuButton_security), R.drawable.ic_shield, v -> { Intent intent = new Intent(getActivity(), SecurityCenterActivity.class); launchActivity(intent); })); + /* Customer Support */ itemList.add(new BRMenuItem(getString(R.string.MenuButton_support), R.drawable.faq_question_black, v -> { CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); CustomTabsIntent customTabsIntent = builder.build(); customTabsIntent.launchUrl(getContext(), Uri.parse(BRConstants.CUSTOMER_SUPPORT_LINK)); })); + /* Settings */ itemList.add(new BRMenuItem(getString(R.string.MenuButton_settings), R.drawable.ic_settings, v -> { Intent intent = new Intent(getActivity(), SettingsActivity.class); launchActivity(intent); })); + /* Lock Wallet */ itemList.add(new BRMenuItem(getString(R.string.MenuButton_lock), R.drawable.ic_lock, v -> { final Activity from = getActivity(); from.getFragmentManager().popBackStack(); BRAnimator.startBreadActivity(from, true); })); + /* Close button*/ rootView.findViewById(R.id.close_button).setOnClickListener(v -> { Activity app = getActivity(); app.getFragmentManager().popBackStack(); From faf4254d2a53248bdbe5672cb7538507ac34ac35 Mon Sep 17 00:00:00 2001 From: kcw-grunt Date: Tue, 23 Nov 2021 13:44:09 -0800 Subject: [PATCH 7/9] Removed More unsused code - Removed BitID - Removed GeoLocation Code - Removed inspection results - Removed WithdrawBCHActivity - code bump --- app/build.gradle | 2 +- .../breadwallet/platform/PlatformTests.java | 17 - app/src/main/AndroidManifest.xml | 5 - .../activities/camera/ScanQRActivity.java | 3 +- .../activities/intro/IntroActivity.java | 2 - .../settings/WithdrawBchActivity.java | 254 ----------- .../activities/util/ActivityUTILS.java | 33 -- .../presenter/activities/util/BRActivity.java | 22 - .../presenter/fragments/FragmentSend.kt | 29 +- .../tools/manager/AnalyticsManager.java | 11 - .../tools/security/AuthManager.java | 2 +- .../breadwallet/tools/security/PostAuth.java | 10 - .../breadwallet/tools/util/BRConstants.java | 7 - .../java/com/jniwrappers/BRBIP32Sequence.java | 24 - .../main/java/com/jniwrappers/BRBase58.java | 26 -- app/src/main/java/com/platform/APIClient.java | 200 +-------- .../com/platform/BRGeoWebSocketHandler.java | 62 --- .../java/com/platform/GeoLocationManager.java | 250 ----------- .../main/java/com/platform/HTTPServer.java | 8 - .../middlewares/plugins/WalletPlugin.java | 2 - .../main/java/com/platform/tools/BRBitId.java | 424 ------------------ 21 files changed, 5 insertions(+), 1388 deletions(-) delete mode 100644 app/src/main/java/com/breadwallet/presenter/activities/settings/WithdrawBchActivity.java delete mode 100644 app/src/main/java/com/platform/BRGeoWebSocketHandler.java delete mode 100644 app/src/main/java/com/platform/GeoLocationManager.java delete mode 100644 app/src/main/java/com/platform/tools/BRBitId.java diff --git a/app/build.gradle b/app/build.gradle index 1f8d5ca88..3b745a861 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,7 +58,7 @@ android { applicationId = 'com.loafwallet' minSdkVersion 27 targetSdkVersion 30 - versionCode 651 + versionCode 652 versionName "v2.4.2" multiDexEnabled true archivesBaseName = "${versionName}(${versionCode})" diff --git a/app/src/androidTest/java/com/breadwallet/platform/PlatformTests.java b/app/src/androidTest/java/com/breadwallet/platform/PlatformTests.java index 1098db3bb..f136bde02 100644 --- a/app/src/androidTest/java/com/breadwallet/platform/PlatformTests.java +++ b/app/src/androidTest/java/com/breadwallet/platform/PlatformTests.java @@ -11,7 +11,6 @@ import com.breadwallet.tools.util.Utils; import com.jniwrappers.BRKey; import com.platform.APIClient; -import com.platform.tools.BRBitId; import org.apache.commons.io.IOUtils; import org.junit.Assert; @@ -271,20 +270,4 @@ public void testBZip2() { Assert.assertNotEquals(compressedData.length, decompressedData.length); } - @Test - public void testBitIdSignature() { - BRKey key = new BRKey("c4c9b99b714074736b65d9faab39145949894233a09d8100b91104750a82d31f"); - String message = "https://breadwallet.com/bitid?nonce=123456789"; - String expectedSig = "ICWek6XEVxu/1/x+TtWk178t6uFcToH019RWNnS+JEeJOr2XGkZKQwsSqEvJ7l3sfhUoX1jm4uWP7nmlyG5Y10E="; - String sig = BRBitId.signMessage(message, key); - Log.e(TAG, "sig: " + sig); - String expectedAddress = "mjBrDFeeX9moESGiRZZGeYrsUSNuvgwDVV"; - String address = key.address(); - Log.e(TAG, "address: " + address); - Assert.assertEquals(expectedAddress, address); - Assert.assertNotNull(sig); - Assert.assertEquals(expectedSig.length(), sig.length()); - Assert.assertEquals(expectedSig, sig); - } - } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f458e5127..0e01a4595 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -197,11 +197,6 @@ android:launchMode="singleTask" android:screenOrientation="portrait"> - - - * Created by Mihail Gutan on 4/27/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class ActivityUTILS { - private static void setStatusBarColor(Activity app, int color) { - if (app == null) return; - Window window = app.getWindow(); - window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); - window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - window.setStatusBarColor(app.getColor(color)); - } - //return true if the app does need to show the disabled wallet screen public static boolean isAppSafe(Activity app) { return app instanceof SetPinActivity || app instanceof InputWordsActivity; diff --git a/app/src/main/java/com/breadwallet/presenter/activities/util/BRActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/util/BRActivity.java index 4098a6a09..1ed0a1e42 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/util/BRActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/util/BRActivity.java @@ -26,7 +26,6 @@ import com.breadwallet.tools.util.LocaleHelper; import com.breadwallet.wallet.BRWalletManager; import com.platform.HTTPServer; -import com.platform.tools.BRBitId; import timber.log.Timber; @@ -99,13 +98,6 @@ public void run() { }); } break; - case BRConstants.REQUEST_PHRASE_BITID: - if (resultCode == RESULT_OK) { - PostAuth.getInstance().onBitIDAuth(BRActivity.this, true); - - } - break; - case BRConstants.PAYMENT_PROTOCOL_REQUEST_CODE: if (resultCode == RESULT_OK) { PostAuth.getInstance().onPaymentProtocolRequest(this, true); @@ -146,8 +138,6 @@ public void run() { String result = data.getStringExtra("result"); if (BitcoinUrlHandler.isBitcoinUrl(result)) BitcoinUrlHandler.processRequest(BRActivity.this, result); - else if (BRBitId.isBitId(result)) - BRBitId.signBitID(BRActivity.this, result, null); else Timber.i("onActivityResult: not litecoin address NOR bitID"); } @@ -155,18 +145,6 @@ else if (BRBitId.isBitId(result)) } break; - case BRConstants.SCANNER_BCH_REQUEST: - if (resultCode == Activity.RESULT_OK) { - new Handler().postDelayed(new Runnable() { - @Override - public void run() { - String result = data.getStringExtra("result"); - PostAuth.getInstance().onSendBch(BRActivity.this, true, result); - } - }, 500); - - } - break; case BRConstants.PUT_PHRASE_NEW_WALLET_REQUEST_CODE: if (resultCode == RESULT_OK) { diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSend.kt b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSend.kt index 1cb2b34d7..9a236b007 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSend.kt +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSend.kt @@ -43,34 +43,7 @@ import timber.log.Timber import java.math.BigDecimal import java.util.regex.Pattern -/** - * BreadWallet - * - * - * Created by Mihail Gutan @breadwallet.com> on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - * - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ + class FragmentSend : Fragment() { private lateinit var backgroundLayout: ScrollView private lateinit var signalLayout: LinearLayout diff --git a/app/src/main/java/com/breadwallet/tools/manager/AnalyticsManager.java b/app/src/main/java/com/breadwallet/tools/manager/AnalyticsManager.java index 201402ab1..174f829c5 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/AnalyticsManager.java +++ b/app/src/main/java/com/breadwallet/tools/manager/AnalyticsManager.java @@ -6,13 +6,6 @@ import com.breadwallet.tools.util.BRConstants; import com.google.firebase.analytics.FirebaseAnalytics; -/** - * Litewallet - * Created by Kerry Washington on 3/11/20 - * email: mrkerrywashington@icloud.com - * Copyright © 2020 Litecoin Foundation. All rights reserved. - */ - public final class AnalyticsManager { private static FirebaseAnalytics instance; @@ -32,10 +25,6 @@ public static void logCustomEvent(@BRConstants.Event String customEvent) { public static void logCustomEventWithParams(@BRConstants.Event String customEvent, Bundle params) { instance.logEvent(customEvent, params); } - - public static void logEvent(String eventString) { - instance.logEvent(eventString, null); - } } diff --git a/app/src/main/java/com/breadwallet/tools/security/AuthManager.java b/app/src/main/java/com/breadwallet/tools/security/AuthManager.java index 03f11008e..aabaa0601 100644 --- a/app/src/main/java/com/breadwallet/tools/security/AuthManager.java +++ b/app/src/main/java/com/breadwallet/tools/security/AuthManager.java @@ -106,7 +106,7 @@ public void run() { } public void authFail(Context app) { - + //TODO: Check if this cruft from the BRD implementation } public boolean isWalletDisabled(Activity app) { diff --git a/app/src/main/java/com/breadwallet/tools/security/PostAuth.java b/app/src/main/java/com/breadwallet/tools/security/PostAuth.java index 97ca582c2..c08cf3f4a 100644 --- a/app/src/main/java/com/breadwallet/tools/security/PostAuth.java +++ b/app/src/main/java/com/breadwallet/tools/security/PostAuth.java @@ -12,7 +12,6 @@ import com.breadwallet.presenter.activities.PaperKeyProveActivity; import com.breadwallet.presenter.activities.SetPinActivity; import com.breadwallet.presenter.activities.intro.WriteDownActivity; -import com.breadwallet.presenter.activities.settings.WithdrawBchActivity; import com.breadwallet.presenter.activities.util.ActivityUTILS; import com.breadwallet.presenter.customviews.BRDialogView; import com.breadwallet.presenter.entities.PaymentItem; @@ -27,7 +26,6 @@ import com.breadwallet.wallet.BRWalletManager; import com.platform.APIClient; import com.platform.entities.TxMetaData; -import com.platform.tools.BRBitId; import com.platform.tools.KVStoreManager; import java.io.IOException; @@ -140,10 +138,6 @@ public void onPhraseProveAuth(Activity app, boolean authAsked) { app.overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left); } - public void onBitIDAuth(Activity app, boolean authenticated) { - BRBitId.completeBitID(app, authenticated); - } - public void onRecoverWalletAuth(Activity app, boolean authAsked) { if (phraseForKeyStore == null) { Timber.e(new NullPointerException("onRecoverWalletAuth: phraseForKeyStore is null")); @@ -313,10 +307,6 @@ public void run() { } finally { if (response != null) response.close(); } - if (!success) { - BRSharedPrefs.putBCHTxId(app, ""); - WithdrawBchActivity.updateUi(app); - } final String finalTitle = title; final String finalMessage = message; diff --git a/app/src/main/java/com/breadwallet/tools/util/BRConstants.java b/app/src/main/java/com/breadwallet/tools/util/BRConstants.java index 65c81074c..75e845041 100644 --- a/app/src/main/java/com/breadwallet/tools/util/BRConstants.java +++ b/app/src/main/java/com/breadwallet/tools/util/BRConstants.java @@ -46,7 +46,6 @@ public class BRConstants { * Permissions */ public static final int CAMERA_REQUEST_ID = 34; - public static final int GEO_REQUEST_ID = 35; /** * Request codes for auth @@ -57,7 +56,6 @@ public class BRConstants { public static final int PUT_PHRASE_NEW_WALLET_REQUEST_CODE = 114; public static final int PUT_PHRASE_RECOVERY_WALLET_REQUEST_CODE = 115; public static final int PAYMENT_PROTOCOL_REQUEST_CODE = 116; - public static final int REQUEST_PHRASE_BITID = 117; public static final int SEND_BCH_REQUEST = 118; public static final int PROVE_PHRASE_REQUEST = 119; @@ -65,15 +63,12 @@ public class BRConstants { * Request codes for take picture */ public static final int SCANNER_REQUEST = 201; - public static final int SCANNER_BCH_REQUEST = 202; - public static final int REQUEST_IMAGE_CAPTURE = 203; public static final String CANARY_STRING = "canary"; public static final String FIRST_ADDRESS = "firstAddress"; public static final String SECURE_TIME_PREFS = "secureTime"; public static final String FEE_KB_PREFS = "feeKb"; public static final String ECONOMY_FEE_KB_PREFS = "EconomyFeeKb"; - public static final String LITTLE_CIRCLE = "\u2022"; public static String SUPPORT_EMAIL = "support@litecoinfoundation.zendesk.com"; @@ -121,8 +116,6 @@ public class BRConstants { /** * Support Center article ids. */ - public static final String receive = "receive-litecoin"; - public static final String send = "send-litecoin"; public static final String loopBug = "android-loop-bug"; public static final String TWITTER_LINK = "https://twitter.com/Litewallet_App"; diff --git a/app/src/main/java/com/jniwrappers/BRBIP32Sequence.java b/app/src/main/java/com/jniwrappers/BRBIP32Sequence.java index 4c7940d0a..a0c188af6 100644 --- a/app/src/main/java/com/jniwrappers/BRBIP32Sequence.java +++ b/app/src/main/java/com/jniwrappers/BRBIP32Sequence.java @@ -1,29 +1,5 @@ package com.jniwrappers; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 1/24/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRBIP32Sequence { public static final String TAG = BRBIP32Sequence.class.getName(); diff --git a/app/src/main/java/com/jniwrappers/BRBase58.java b/app/src/main/java/com/jniwrappers/BRBase58.java index e7445d03a..11e881827 100644 --- a/app/src/main/java/com/jniwrappers/BRBase58.java +++ b/app/src/main/java/com/jniwrappers/BRBase58.java @@ -1,29 +1,5 @@ package com.jniwrappers; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/11/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRBase58 { public static final String TAG = BRBase58.class.getName(); @@ -38,6 +14,4 @@ public static BRBase58 getInstance() { } return instance; } - -// public native String base58Encode(byte[] data); } diff --git a/app/src/main/java/com/platform/APIClient.java b/app/src/main/java/com/platform/APIClient.java index 8d300203a..d8ef1c291 100644 --- a/app/src/main/java/com/platform/APIClient.java +++ b/app/src/main/java/com/platform/APIClient.java @@ -62,31 +62,6 @@ import static com.breadwallet.tools.util.BRCompressor.gZipExtract; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/29/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class APIClient { // proto is the transport protocol to use for talking to the API (either http or https) @@ -109,8 +84,6 @@ public class APIClient { private static final String BUNDLES_FOLDER = String.format("/%s", BUNDLES); - private static String BREAD_FILE; - private static String BREAD_EXTRACTED; private static final boolean PRINT_FILES = false; private SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); @@ -118,32 +91,8 @@ public class APIClient { private boolean platformUpdating = false; private AtomicInteger itemsLeftToUpdate = new AtomicInteger(0); - public static HTTPServer server; - private Context ctx; - public enum FeatureFlags { - BUY_BITCOIN("buy-litecoin"), - EARLY_ACCESS("early-access"); - - private final String text; - - /** - * @param text - */ - private FeatureFlags(final String text) { - this.text = text; - } - - /* (non-Javadoc) - * @see java.lang.Enum#toString() - */ - @Override - public String toString() { - return text; - } - } - public static synchronized APIClient getInstance(Context context) { if (ourInstance == null) ourInstance = new APIClient(context); return ourInstance; @@ -154,8 +103,6 @@ private APIClient(Context context) { itemsLeftToUpdate = new AtomicInteger(0); if (0 != (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)) { BREAD_POINT = "bread-frontend-staging"; - BREAD_FILE = String.format("/%s.tar", BREAD_POINT); - BREAD_EXTRACTED = String.format("%s-extracted", BREAD_POINT); } } @@ -427,74 +374,6 @@ private Request authenticateRequest(Request request) { return request; } - public void updateBundle() { -// if (ActivityUTILS.isMainThread()) { -// throw new NetworkOnMainThreadException(); -// } -// File bundleFile = new File(getBundleResource(ctx, BREAD_FILE)); -// Log.d(TAG, "updateBundle: " + bundleFile); -// if (bundleFile.exists()) { -// Log.d(TAG, bundleFile + ": updateBundle: exists"); -// -// byte[] bFile = new byte[0]; -// try { -// FileInputStream in = new FileInputStream(bundleFile); -// bFile = IOUtils.toByteArray(in); -// in.close(); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// -// String latestVersion = getLatestVersion(); -// String currentTarVersion = null; -// byte[] hash = CryptoHelper.sha256(bFile); -// -// currentTarVersion = Utils.bytesToHex(hash); -// Log.d(TAG, bundleFile + ": updateBundle: version of the current tar: " + currentTarVersion); -// // FileHelper.printDirectoryTree(new File(getExtractedPath(ctx, null))); -// if (latestVersion != null) { -// if (latestVersion.equals(currentTarVersion)) { -// Log.d(TAG, bundleFile + ": updateBundle: have the latest version"); -// tryExtractTar(); -// } else { -// Log.d(TAG, bundleFile + ": updateBundle: don't have the most recent version, download diff"); -// downloadDiff(currentTarVersion); -// tryExtractTar(); -// } -// } else { -// Log.d(TAG, bundleFile + ": updateBundle: latestVersion is null"); -// } -// // FileHelper.printDirectoryTree(new File(getExtractedPath(ctx, null))); -// -// } else { -// Log.d(TAG, bundleFile + ": updateBundle: bundle doesn't exist, downloading new copy"); -// long startTime = System.currentTimeMillis(); -// Request request = new Request.Builder() -// .url(String.format("%s/assets/bundles/%s/download", BASE_URL, BREAD_POINT)) -// .get().build(); -// Response response = null; -// byte[] body; -// try { -// response = sendRequest(request, false, 0); -// Log.d(TAG, bundleFile + ": updateBundle: Downloaded, took: " + (System.currentTimeMillis() - startTime)); -// body = writeBundleToFile(response); -// } finally { -// if (response != null) response.close(); -// } -// if (Utils.isNullOrEmpty(body)) { -// Log.e(TAG, "updateBundle: body is null, returning."); -// return; -// } -// -// boolean b = tryExtractTar(); -// if (!b) { -// Log.e(TAG, "updateBundle: Failed to extract tar"); -// } -// } -// -// logFiles("updateBundle after", ctx); - } - public String getLatestVersion() { if (ActivityUTILS.isMainThread()) { throw new NetworkOnMainThreadException(); @@ -548,7 +427,6 @@ public void downloadDiff(String currentTarVersion) { Timber.d("downloadDiff: trying to write to file"); FileUtils.writeByteArrayToFile(patchFile, patchBytes); tempFile = new File(getBundleResource(ctx, BREAD_POINT + "-2temp.tar")); - boolean a = tempFile.createNewFile(); File bundleFile = new File(getBundleResource(ctx, BREAD_POINT + ".tar")); FileUI.patch(bundleFile, tempFile, patchFile); byte[] updatedBundleBytes = IOUtils.toByteArray(new FileInputStream(tempFile)); @@ -636,89 +514,15 @@ public boolean tryExtractTar() { } - public void updateFeatureFlag() { - // if (ActivityUTILS.isMainThread()) { - // throw new NetworkOnMainThreadException(); - // } - // String furl = "/me/features"; - // Request req = new Request.Builder() - // .url(buildUrl(furl)) - // .get().build(); - // Response res = sendRequest(req, true, 0); - // if (res == null) { - // Log.e(TAG, "updateFeatureFlag: error fetching features"); - // return; - // } - // - // if (!res.isSuccessful()) { - // Log.e(TAG, "updateFeatureFlag: request was unsuccessful: " + res.code() + ":" + res.message()); - // return; - // } - // - // try { - // String j = res.body().string(); - // if (j.isEmpty()) { - // Log.e(TAG, "updateFeatureFlag: JSON empty"); - // return; - // } - // - // JSONArray arr = new JSONArray(j); - // for (int i = 0; i < arr.length(); i++) { - // try { - // JSONObject obj = arr.getJSONObject(i); - // String name = obj.getString("name"); - // String description = obj.getString("description"); - // boolean selected = obj.getBoolean("selected"); - // boolean enabled = obj.getBoolean("enabled"); - // boolean isPrivate = obj.getBoolean("private"); - // BRSharedPrefs.putFeatureEnabled(ctx, enabled, name); - // } catch (Exception e) { - // Log.e(TAG, "malformed feature at position: " + i + ", whole json: " + j, e); - // } - // - // } - // } catch (IOException | JSONException e) { - // Log.e(TAG, "updateFeatureFlag: failed to pull up features"); - // e.printStackTrace(); - // } finally { - // res.close(); - // } - - } - public boolean isBreadChallenge(Response resp) { String challenge = resp.header("www-authenticate"); return challenge != null && challenge.startsWith("bread"); } - public boolean isFeatureEnabled(String feature) { - boolean b = BRSharedPrefs.getFeatureEnabled(ctx, feature); - return b; - } - public String buildUrl(String path) { return BASE_URL + path; } - private class LoggingInterceptor implements Interceptor { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - Request request = chain.request(); - - long t1 = System.nanoTime(); - Timber.d("Sending request %s on %s%n%s", - request.url(), chain.connection(), request.headers()); - - Response response = chain.proceed(request); - - long t2 = System.nanoTime(); - Timber.d("Received response for %s in %.1fms%n%s", - response.request().url(), (t2 - t1) / 1e6d, response.headers()); - - return response; - } - } - public void updatePlatform() { if (platformUpdating) { Timber.i("updatePlatform: platform already Updating!"); @@ -733,7 +537,6 @@ public void run() { Thread.currentThread().setName("UpdateBundle"); final long startTime = System.currentTimeMillis(); APIClient apiClient = APIClient.getInstance(ctx); - apiClient.updateBundle(); long endTime = System.currentTimeMillis(); Timber.d("updateBundle %s: DONE in %sms", BREAD_POINT, endTime - startTime); itemFinished(); @@ -752,7 +555,6 @@ public void run() { Thread.currentThread().setName("updateFeatureFlag"); final long startTime = System.currentTimeMillis(); APIClient apiClient = APIClient.getInstance(ctx); - apiClient.updateFeatureFlag(); long endTime = System.currentTimeMillis(); Timber.d("updateFeatureFlag: DONE in %sms", endTime - startTime); itemFinished(); @@ -821,7 +623,7 @@ public String getBundleResource(Context app, String path) { //returns the extracted folder or the path in it public String getExtractedPath(Context app, String path) { - String extracted = app.getFilesDir().getAbsolutePath() + "/" + BREAD_EXTRACTED; + String extracted = app.getFilesDir().getAbsolutePath(); if (Utils.isNullOrEmpty(path)) { return extracted; } else { diff --git a/app/src/main/java/com/platform/BRGeoWebSocketHandler.java b/app/src/main/java/com/platform/BRGeoWebSocketHandler.java deleted file mode 100644 index 54d994798..000000000 --- a/app/src/main/java/com/platform/BRGeoWebSocketHandler.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.platform; - -import org.eclipse.jetty.websocket.api.Session; -import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; -import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; -import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; -import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; -import org.eclipse.jetty.websocket.api.annotations.WebSocket; - -import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 1/19/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -@WebSocket -public class BRGeoWebSocketHandler { - - @OnWebSocketClose - public void onClose(int statusCode, String reason) { - Timber.d("GeoSocketClosed: statusCode=%s, reason=%s", statusCode, reason); - GeoLocationManager.getInstance().stopGeoSocket(); - } - - @OnWebSocketError - public void onError(Throwable t) { - Timber.e(t, "GeoSocketError"); - GeoLocationManager.getInstance().stopGeoSocket(); - } - - @OnWebSocketConnect - public void onConnect(Session session) { - Timber.d("GeoSocketConnected: %s", session.getRemoteAddress().getAddress()); - GeoLocationManager.getInstance().startGeoSocket(session); - } - - @OnWebSocketMessage - public void onMessage(String message) { - Timber.d("GeoSocketMessage: %s", message); - } -} diff --git a/app/src/main/java/com/platform/GeoLocationManager.java b/app/src/main/java/com/platform/GeoLocationManager.java deleted file mode 100644 index 64a23eeb3..000000000 --- a/app/src/main/java/com/platform/GeoLocationManager.java +++ /dev/null @@ -1,250 +0,0 @@ -package com.platform; - -import android.Manifest; -import android.content.Context; -import android.content.pm.PackageManager; -import android.location.Location; -import android.location.LocationListener; -import android.location.LocationManager; -import android.os.Bundle; - -import androidx.core.app.ActivityCompat; - -import com.breadwallet.BreadApp; -import com.breadwallet.tools.threads.BRExecutor; -import com.breadwallet.tools.util.Utils; - -import org.eclipse.jetty.continuation.Continuation; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.websocket.api.Session; -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.IOException; - -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 1/12/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class GeoLocationManager { - private Session session; - private Continuation continuation; - private Request baseRequest; - private LocationManager locationManager; - - private static GeoLocationManager instance; - - public static GeoLocationManager getInstance() { - if (instance == null) instance = new GeoLocationManager(); - return instance; - } - - public void getOneTimeGeoLocation(Continuation cont, Request req) { - this.continuation = cont; - this.baseRequest = req; - final Context app = BreadApp.getBreadContext(); - if (app == null) - return; - locationManager = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); - if (locationManager == null) { - Timber.i("getOneTimeGeoLocation: locationManager is null!"); - return; - } - BRExecutor.getInstance().forMainThreadTasks().execute(new Runnable() { - @Override - public void run() { - if (ActivityCompat.checkSelfPermission(app, Manifest.permission.ACCESS_FINE_LOCATION) != - PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(app, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - Timber.e(new RuntimeException("getOneTimeGeoLocation, can't happen")); - return; - } - locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener); - locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); - } - }); - } - - void startGeoSocket(Session sess) { - session = sess; - - final Context app = BreadApp.getBreadContext(); - if (app == null) - return; - final LocationManager locationManager = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); - - BRExecutor.getInstance().forMainThreadTasks().execute(new Runnable() { - @Override - public void run() { - if (ActivityCompat.checkSelfPermission(app, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(app, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - Timber.e(new RuntimeException("startGeoSocket, can't happen")); - return; - } - locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000, 0, socketLocationListener); - locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, socketLocationListener); - } - }); - } - - public void stopGeoSocket() { - final Context app = BreadApp.getBreadContext(); - if (app == null) - return; - final LocationManager locationManager = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); - BRExecutor.getInstance().forMainThreadTasks().execute(new Runnable() { - @Override - public void run() { - if (ActivityCompat.checkSelfPermission(app, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(app, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - RuntimeException ex = new RuntimeException("stopGeoSocket, can't happen"); - Timber.e(ex); - throw ex; - } - locationManager.removeUpdates(socketLocationListener); - } - }); - } - - // Define a listener that responds to location updates - private LocationListener socketLocationListener = new LocationListener() { - private boolean sending; - - public void onLocationChanged(Location location) { - // Called when a new location is found by the network location provider. - if (sending) return; - sending = true; - if (session != null && session.isOpen()) { - final String jsonLocation = getJsonLocation(location); - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - try { - session.getRemote().sendString(jsonLocation); - } catch (IOException e) { - Timber.e(e); - } finally { - sending = false; - } - } - }); - } else { - sending = false; - } - } - - public void onStatusChanged(String provider, int status, Bundle extras) { - } - - public void onProviderEnabled(String provider) { - } - - public void onProviderDisabled(String provider) { - } - }; - - private LocationListener locationListener = new LocationListener() { - private boolean processing; - - public void onLocationChanged(final Location location) { - if (processing) return; - processing = true; - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - // Called when a new location is found by the network location provider. - if (continuation != null && baseRequest != null) { - String jsonLocation = getJsonLocation(location); - try { - if (!Utils.isNullOrEmpty(jsonLocation)) { - try { - ((HttpServletResponse) continuation.getServletResponse()).setStatus(200); - continuation.getServletResponse().getOutputStream().write(jsonLocation.getBytes("UTF-8")); - baseRequest.setHandled(true); - continuation.complete(); - continuation = null; - } catch (IOException e) { - Timber.e(e); - } - } else { - try { - ((HttpServletResponse) continuation.getServletResponse()).sendError(500); - baseRequest.setHandled(true); - continuation.complete(); - continuation = null; - } catch (IOException e) { - Timber.e(e); - } - Timber.e(new NullPointerException("onLocationChanged: " + jsonLocation)); - } - } catch (Exception e) { - Timber.e(e); - } finally { - processing = false; - Context app = BreadApp.getBreadContext(); - if (app == null || ActivityCompat.checkSelfPermission(app, Manifest.permission.ACCESS_FINE_LOCATION) - != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(app, - Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - Timber.d("onLocationChanged: PERMISSION DENIED for removeUpdates"); - } else { - locationManager.removeUpdates(locationListener); - } - } - } - } - }); - } - - public void onStatusChanged(String provider, int status, Bundle extras) { - } - - public void onProviderEnabled(String provider) { - } - - public void onProviderDisabled(String provider) { - } - }; - - public static String getJsonLocation(Location location) { - try { - JSONObject responseJson = new JSONObject(); - - JSONObject coordObj = new JSONObject(); - coordObj.put("latitude", location.getLatitude()); - coordObj.put("longitude", location.getLongitude()); - - responseJson.put("timestamp", location.getTime()); - responseJson.put("coordinate", coordObj); - responseJson.put("altitude", location.getAltitude()); - responseJson.put("horizontal_accuracy", location.getAccuracy()); - responseJson.put("description", ""); - return responseJson.toString(); - } catch (JSONException e) { - Timber.e(e); - } - return null; - - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/platform/HTTPServer.java b/app/src/main/java/com/platform/HTTPServer.java index 3e64a1948..4b5f88c33 100644 --- a/app/src/main/java/com/platform/HTTPServer.java +++ b/app/src/main/java/com/platform/HTTPServer.java @@ -89,16 +89,8 @@ private static void init() { HandlerCollection handlerCollection = new HandlerCollection(); - WebSocketHandler wsHandler = new WebSocketHandler() { - @Override - public void configure(WebSocketServletFactory factory) { - factory.register(BRGeoWebSocketHandler.class); - } - }; - ServerHandler serverHandler = new ServerHandler(); handlerCollection.addHandler(serverHandler); - handlerCollection.addHandler(wsHandler); server.setHandler(handlerCollection); diff --git a/app/src/main/java/com/platform/middlewares/plugins/WalletPlugin.java b/app/src/main/java/com/platform/middlewares/plugins/WalletPlugin.java index e53b294b5..9a9367049 100644 --- a/app/src/main/java/com/platform/middlewares/plugins/WalletPlugin.java +++ b/app/src/main/java/com/platform/middlewares/plugins/WalletPlugin.java @@ -11,7 +11,6 @@ import com.breadwallet.wallet.BRWalletManager; import com.platform.BRHTTPHelper; import com.platform.interfaces.Plugin; -import com.platform.tools.BRBitId; import org.apache.commons.compress.utils.IOUtils; import org.eclipse.jetty.continuation.Continuation; @@ -165,7 +164,6 @@ public boolean handle(String target, Request baseRequest, HttpServletRequest req continuation = ContinuationSupport.getContinuation(request); continuation.suspend(response); globalBaseRequest = baseRequest; - BRBitId.signBitID(app, null, obj); } catch (JSONException e) { Timber.e(e); return BRHTTPHelper.handleError(400, "failed to parse json", baseRequest, response); diff --git a/app/src/main/java/com/platform/tools/BRBitId.java b/app/src/main/java/com/platform/tools/BRBitId.java deleted file mode 100644 index 1e1451406..000000000 --- a/app/src/main/java/com/platform/tools/BRBitId.java +++ /dev/null @@ -1,424 +0,0 @@ -package com.platform.tools; - -import android.app.Activity; -import android.net.Uri; -import android.security.keystore.UserNotAuthenticatedException; -import android.util.Base64; - -import com.breadwallet.presenter.interfaces.BRAuthCompletion; -import com.breadwallet.tools.manager.BRSharedPrefs; -import com.breadwallet.tools.security.AuthManager; -import com.breadwallet.tools.security.BRKeyStore; -import com.breadwallet.tools.security.PostAuth; -import com.breadwallet.tools.threads.BRExecutor; -import com.breadwallet.tools.util.BRConstants; -import com.breadwallet.tools.util.TypesConverter; -import com.breadwallet.tools.util.Utils; -import com.breadwallet.wallet.BRWalletManager; -import com.jniwrappers.BRBIP32Sequence; -import com.jniwrappers.BRKey; -import com.platform.APIClient; -import com.platform.middlewares.plugins.WalletPlugin; - -import junit.framework.Assert; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import timber.log.Timber; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 1/25/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class BRBitId { - public static final String BITCOIN_SIGNED_MESSAGE_HEADER = "Litecoin Signed Message:\n"; - - private static String _bitUri; - private static String _bitIdUrl; - private static String _strToSign = null; - private static String _promptString = null; - private static int _index = 0; - private volatile static Map bitIdKeys = new HashMap<>(); - - public static boolean isBitId(String uri) { - try { - URI bitIdUri = new URI(uri); - if ("bitid".equals(bitIdUri.getScheme())) { - return true; - } - } catch (URISyntaxException e) { - Timber.e(e); - } - return false; - } - - public static void signBitID(final Activity app, String uri, JSONObject jsonBody) { - if (uri == null && jsonBody != null) { - try { - uri = jsonBody.getString("bitid_url"); - } catch (JSONException e) { - Timber.e(e); - } - } - - if (uri == null) { - Timber.i("signBitID: uri is null"); - return; - } - _bitUri = uri; - - final URI bitIdUri; - try { - bitIdUri = new URI(_bitUri); - } catch (URISyntaxException e) { - Timber.e(e, "signBitID: returning false"); - return; - } - - final String biUri = bitIdUri.getHost() == null ? bitIdUri.toString() : bitIdUri.getHost(); - final boolean authNeeded = !bitIdKeys.containsKey(biUri); - - if (jsonBody != null) { - try { - _promptString = jsonBody.getString("prompt_string"); - _bitIdUrl = jsonBody.getString("bitid_url"); - _index = jsonBody.getInt("bitid_index"); - _strToSign = jsonBody.getString("string_to_sign"); - } catch (JSONException e) { - Timber.e(e); - return; - } - } else if ("bitid".equals(bitIdUri.getScheme())) { - if (app == null) { - Timber.i("signBitID: app is null, returning true still"); - return; - } - _promptString = "BitID Authentication Request"; - } - - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - Timber.e(e); - } - - if (authNeeded) { - app.runOnUiThread(new Runnable() { - @Override - public void run() { - AuthManager.getInstance().authPrompt(app, _promptString, bitIdUri.getHost(), true, false, new BRAuthCompletion() { - @Override - public void onComplete() { - PostAuth.getInstance().onBitIDAuth(app, true); - } - - @Override - public void onCancel() { - PostAuth.getInstance().onBitIDAuth(app, false); - } - }); - } - }); - } else { - PostAuth.getInstance().onBitIDAuth(app, true); - } - } - }); - } - - public static void completeBitID(final Activity app, boolean authenticated) { - final byte[] phrase; - final byte[] nulTermPhrase; - final byte[] seed; - if (!authenticated) { - WalletPlugin.sendBitIdResponse(null, false); - return; - } - if (app == null) { - Timber.i("completeBitID: app is null"); - return; - } - if (_bitUri == null) { - Timber.i("completeBitID: _bitUri is null"); - return; - } - - final Uri uri = Uri.parse(_bitUri); - - try { - phrase = BRKeyStore.getPhrase(app, BRConstants.REQUEST_PHRASE_BITID); - } catch (UserNotAuthenticatedException e) { - return; - } - if (Utils.isNullOrEmpty(phrase)) throw new NullPointerException("cant happen"); - nulTermPhrase = TypesConverter.getNullTerminatedPhrase(phrase); - seed = BRWalletManager.getSeedFromPhrase(nulTermPhrase); - if (Utils.isNullOrEmpty(seed)) { - Timber.d("completeBitID: seed is null!"); - return; - } - - //run the callback - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - try { - if (_strToSign == null) { - //meaning it's a link handling - bitIdLink(app, uri, seed); - } else { - //meaning its the wallet plugin, glidera auth (platform) - bitIdPlatform(app, uri, seed); - } - } finally { - //release everything - _bitUri = null; - _strToSign = null; - _bitIdUrl = null; - _promptString = null; - _index = 0; - Arrays.fill(phrase, (byte) 0); - if (nulTermPhrase != null) Arrays.fill(nulTermPhrase, (byte) 0); - Arrays.fill(seed, (byte) 0); - } - } - }); - - } - - private static void bitIdPlatform(Activity app, Uri uri, byte[] seed) { - - final String biUri = uri.getHost() == null ? uri.toString() : uri.getHost(); - final byte[] key = BRBIP32Sequence.getInstance().bip32BitIDKey(seed, _index, biUri); - if (key == null) { - Timber.d("bitIdPlatform: key is null!"); - return; - } - if (_strToSign == null) { - Timber.d("bitIdPlatform: _strToSign is null!"); - return; - } - final String sig = BRBitId.signMessage(_strToSign, new BRKey(key)); - final String address = new BRKey(key).address(); - - JSONObject postJson = new JSONObject(); - Timber.d("GLIDERA: address:%s", address); - try { - postJson.put("address", address); - postJson.put("signature", sig); - } catch (JSONException e) { - Timber.e(e); - } - //keep auth off for this host for 60 seconds. - if (!bitIdKeys.containsKey(biUri)) { - bitIdKeys.put(biUri, true); - Timber.d("run: saved temporary sig for key: %s", biUri); - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(60000); - } catch (InterruptedException e) { - Timber.e(e); - } - Timber.d("run: removed temporary sig for key: %s", biUri); - if (bitIdKeys != null) - bitIdKeys.remove(biUri); - } - }); - } - WalletPlugin.sendBitIdResponse(postJson, true); - } - - private static void bitIdLink(Activity app, Uri uri, byte[] seed) { - String nonce = null; - String scheme = "https"; - - String u = uri.getQueryParameter("u"); - if (u != null && u.equalsIgnoreCase("1")) { - scheme = "http"; - } - String x = uri.getQueryParameter("x"); - if (Utils.isNullOrEmpty(x)) { - nonce = newNonce(app, uri.getHost() + uri.getPath()); // we are generating our own nonce - } else { - nonce = x; // service is providing a nonce - } - - String callbackUrl = String.format("%s://%s%s", scheme, uri.getHost(), uri.getPath()); - - // build a payload consisting of the signature, address and signed uri - String uriWithNonce = String.format("bitid://%s%s?x=%s", uri.getHost(), uri.getPath(), nonce); - - Timber.d("LINK: callbackUrl:" + callbackUrl); - final byte[] key = BRBIP32Sequence.getInstance().bip32BitIDKey(seed, _index, _bitUri); - - if (key == null) { - Timber.d("completeBitID: key is null!"); - return; - } - - final String sig = BRBitId.signMessage(uriWithNonce, new BRKey(key)); - final String address = new BRKey(key).address(); - Timber.d("LINK: address: %s", address); - JSONObject postJson = new JSONObject(); - try { - postJson.put("address", address); - postJson.put("signature", sig); - postJson.put("uri", uriWithNonce); - } catch (JSONException e) { - Timber.e(e); - } - - RequestBody requestBody = RequestBody.create(null, postJson.toString()); - Request request = new Request.Builder() - .url(callbackUrl + "?x=" + nonce) - .post(requestBody) - .header("Content-Type", "application/json") - .build(); - Response res = APIClient.getInstance(app).sendRequest(request, true, 0); - Timber.d("completeBitID: res.code: %s res.message: %s", res.code(), res.message()); - try { - Timber.d("completeBitID: body: %s", res.body().string()); - } catch (IOException e) { - Timber.e(e); - } finally { - res.close(); - } - } - - private static String newNonce(Activity app, String nonceKey) { - // load previous nonces. we save all nonces generated for each service - // so they are not used twice from the same device - List existingNonces = BRSharedPrefs.getBitIdNonces(app, nonceKey); - - String nonce = ""; - while (existingNonces.contains(Integer.valueOf(nonce))) { - nonce = String.valueOf(System.currentTimeMillis() / 1000); - } - existingNonces.add(Integer.valueOf(nonce)); - BRSharedPrefs.putBitIdNonces(app, existingNonces, nonceKey); - - return nonce; - } - - public static String signMessage(String message, BRKey key) { - byte[] signingData = formatMessageForBitcoinSigning(message); - - MessageDigest digest; - try { - digest = MessageDigest.getInstance("SHA-256"); - } catch (NoSuchAlgorithmException e) { - Timber.e(e); - return null; - } - byte[] sha256First = digest.digest(signingData); - byte[] sha256Second = digest.digest(sha256First); - byte[] signature = key.compactSign(sha256Second); - - return Base64.encodeToString(signature, Base64.NO_WRAP); - } - - private static byte[] formatMessageForBitcoinSigning(String message) { - byte[] headerBytes = null; - byte[] messageBytes = null; - - try { - headerBytes = BITCOIN_SIGNED_MESSAGE_HEADER.getBytes("UTF-8"); - messageBytes = message.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - Timber.e(e); - } - assert (headerBytes != null); - assert (messageBytes != null); - if (headerBytes == null || messageBytes == null) return new byte[0]; - - int cap = 1 + headerBytes.length + varIntSize(messageBytes.length) + messageBytes.length; - - ByteBuffer dataBuffer = ByteBuffer.allocate(cap).order(ByteOrder.LITTLE_ENDIAN); - dataBuffer.put((byte) headerBytes.length); //put header count - dataBuffer.put(headerBytes); //put the header - putVarInt(message.length(), dataBuffer); //put message count - dataBuffer.put(messageBytes); //put the message - byte[] result = dataBuffer.array(); - - Assert.assertEquals(cap, result.length); - - return result; - } - - /** - * Returns the encoding size in bytes of its input value. - * - * @param i the integer to be measured - * @return the encoding size in bytes of its input value - */ - private static int varIntSize(int i) { - int result = 0; - do { - result++; - i >>>= 7; - } while (i != 0); - return result; - } - - /** - * Encodes an integer in a variable-length encoding, 7 bits per byte, to a - * ByteBuffer sink. - * - * @param v the value to encode - * @param sink the ByteBuffer to add the encoded value - */ - private static void putVarInt(int v, ByteBuffer sink) { - while (true) { - int bits = v & 0x7f; - v >>>= 7; - if (v == 0) { - sink.put((byte) bits); - return; - } - sink.put((byte) (bits | 0x80)); - } - } -} From 4bbe847a06ee7b78d128033e18614d3cd50cef32 Mon Sep 17 00:00:00 2001 From: kcw-grunt Date: Mon, 29 Nov 2021 10:14:34 -0800 Subject: [PATCH 8/9] Removal of HTTPServer references... - removal of cruft - removed dead code - code number bump --- app/build.gradle | 2 +- .../activities/settings/SettingsActivity.java | 1 - .../presenter/activities/util/BRActivity.java | 32 --- .../presenter/fragments/FragmentMenu.java | 1 - .../fragments/FragmentRequestAmount.java | 28 --- .../presenter/fragments/FragmentSupport.java | 154 ------------ .../fragments/FragmentTransactionItem.java | 27 --- .../tools/animation/BRAnimator.java | 30 --- .../tools/security/BRKeyStore.java | 29 +-- app/src/main/java/com/platform/APIClient.java | 14 -- .../main/java/com/platform/HTTPServer.java | 210 ---------------- .../com/platform/interfaces/Middleware.java | 37 --- .../java/com/platform/interfaces/Plugin.java | 32 --- .../com/platform/middlewares/APIProxy.java | 177 -------------- .../middlewares/HTTPFileMiddleware.java | 210 ---------------- .../middlewares/HTTPIndexMiddleware.java | 86 ------- .../com/platform/middlewares/HTTPRouter.java | 60 ----- .../middlewares/plugins/WalletPlugin.java | 227 ------------------ 18 files changed, 4 insertions(+), 1353 deletions(-) delete mode 100644 app/src/main/java/com/breadwallet/presenter/fragments/FragmentSupport.java delete mode 100644 app/src/main/java/com/platform/HTTPServer.java delete mode 100644 app/src/main/java/com/platform/interfaces/Middleware.java delete mode 100644 app/src/main/java/com/platform/interfaces/Plugin.java delete mode 100644 app/src/main/java/com/platform/middlewares/APIProxy.java delete mode 100644 app/src/main/java/com/platform/middlewares/HTTPFileMiddleware.java delete mode 100644 app/src/main/java/com/platform/middlewares/HTTPIndexMiddleware.java delete mode 100644 app/src/main/java/com/platform/middlewares/HTTPRouter.java delete mode 100644 app/src/main/java/com/platform/middlewares/plugins/WalletPlugin.java diff --git a/app/build.gradle b/app/build.gradle index 3b745a861..a3f358085 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,7 +58,7 @@ android { applicationId = 'com.loafwallet' minSdkVersion 27 targetSdkVersion 30 - versionCode 652 + versionCode 653 versionName "v2.4.2" multiDexEnabled true archivesBaseName = "${versionName}(${versionCode})" diff --git a/app/src/main/java/com/breadwallet/presenter/activities/settings/SettingsActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/settings/SettingsActivity.java index 0c69d1454..715783336 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/settings/SettingsActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/settings/SettingsActivity.java @@ -23,7 +23,6 @@ import com.breadwallet.tools.manager.BRSharedPrefs; import com.breadwallet.tools.security.AuthManager; import com.platform.APIClient; -import com.platform.HTTPServer; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/breadwallet/presenter/activities/util/BRActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/util/BRActivity.java index 1ed0a1e42..46ee1d612 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/util/BRActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/util/BRActivity.java @@ -25,34 +25,8 @@ import com.breadwallet.tools.util.BRConstants; import com.breadwallet.tools.util.LocaleHelper; import com.breadwallet.wallet.BRWalletManager; -import com.platform.HTTPServer; - import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 5/23/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRActivity extends FragmentActivity { static { @@ -179,12 +153,6 @@ public static void init(Activity app) { BRAnimator.startBreadActivity(app, true); } } - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - HTTPServer.startServer(); - } - }); BreadApp.backgroundedTime = System.currentTimeMillis(); } diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentMenu.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentMenu.java index b7e2291c6..964363aa2 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentMenu.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentMenu.java @@ -30,7 +30,6 @@ import com.breadwallet.tools.animation.SlideDetector; import com.breadwallet.tools.util.BRConstants; import com.platform.APIClient; -import com.platform.HTTPServer; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentRequestAmount.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentRequestAmount.java index 1001cd1f4..d94467a1c 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentRequestAmount.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentRequestAmount.java @@ -39,34 +39,6 @@ import timber.log.Timber; -import static com.platform.HTTPServer.URL_SUPPORT; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentRequestAmount extends Fragment { private BRKeyboard keyboard; private StringBuilder amountBuilder; diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSupport.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSupport.java deleted file mode 100644 index fd4d0a8f6..000000000 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSupport.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.breadwallet.presenter.fragments; - -import android.app.Fragment; -import android.content.pm.ApplicationInfo; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.view.ViewTreeObserver; -import android.webkit.WebChromeClient; -import android.webkit.WebResourceRequest; -import android.webkit.WebSettings; -import android.webkit.WebView; -import android.webkit.WebViewClient; -import android.widget.LinearLayout; - -import androidx.annotation.Nullable; -import androidx.cardview.widget.CardView; - -import com.breadwallet.R; -import com.breadwallet.tools.animation.BRAnimator; -import com.breadwallet.tools.animation.SlideDetector; -import com.breadwallet.tools.util.Utils; -import com.platform.HTTPServer; - -import timber.log.Timber; - -import static com.platform.HTTPServer.URL_SUPPORT; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -public class FragmentSupport extends Fragment { - public LinearLayout backgroundLayout; - public CardView signalLayout; - WebView webView; - public static boolean appVisible = false; - private String onCloseUrl; - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_support, container, false); - backgroundLayout = rootView.findViewById(R.id.background_layout); - signalLayout = rootView.findViewById(R.id.signal_layout); - - signalLayout.setOnTouchListener(new SlideDetector(getContext(), signalLayout)); - - signalLayout.setLayoutTransition(BRAnimator.getDefaultTransition()); - - webView = rootView.findViewById(R.id.web_view); - webView.setWebChromeClient(new WebChromeClient()); - webView.setWebViewClient(new WebViewClient() { - @Override - public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { - Timber.d("shouldOverrideUrlLoading: %s %s", request.getUrl(), request.getMethod()); - if (onCloseUrl != null && request.getUrl().toString().equalsIgnoreCase(onCloseUrl)) { - getActivity().onBackPressed(); - onCloseUrl = null; - } else if (request.getUrl().toString().contains("_close")) { - getActivity().onBackPressed(); - } else { - view.loadUrl(request.getUrl().toString()); - } - - return true; - } - }); - - HTTPServer.mode = HTTPServer.ServerMode.SUPPORT; - String articleId = getArguments() == null ? null : getArguments().getString("articleId"); - - WebSettings webSettings = webView.getSettings(); - - if (0 != (getActivity().getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)) { - WebView.setWebContentsDebuggingEnabled(true); - } - webSettings.setDomStorageEnabled(true); - webSettings.setJavaScriptEnabled(true); - - String theUrl = URL_SUPPORT; - if (articleId != null && !articleId.isEmpty()) { - theUrl += "/article?slug=" + articleId; - } - - webView.loadUrl(theUrl); - - return rootView; - } - - @Override - public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - final ViewTreeObserver observer = signalLayout.getViewTreeObserver(); - observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { - @Override - public void onGlobalLayout() { - if (observer.isAlive()) { - observer.removeOnGlobalLayoutListener(this); - } - BRAnimator.animateBackgroundDim(backgroundLayout, false); - BRAnimator.animateSignalSlide(signalLayout, false, null); - } - }); - } - - @Override - public void onStop() { - super.onStop(); - BRAnimator.animateBackgroundDim(backgroundLayout, true); - BRAnimator.animateSignalSlide(signalLayout, true, new BRAnimator.OnSlideAnimationEnd() { - @Override - public void onAnimationEnd() { - if (getActivity() != null) { - try { - getActivity().getFragmentManager().popBackStack(); - } catch (Exception ignored) { - Timber.e(ignored); - } - } - } - }); - } - - @Override - public void onPause() { - super.onPause(); - Utils.hideKeyboard(getActivity()); - BRAnimator.supportIsShowing = false; - } -} \ No newline at end of file diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentTransactionItem.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentTransactionItem.java index 6ca253a6e..7a61b586b 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentTransactionItem.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentTransactionItem.java @@ -41,33 +41,6 @@ import timber.log.Timber; -import static com.platform.HTTPServer.URL_SUPPORT; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentTransactionItem extends Fragment { public TextView mTitle; private TextView mDescriptionText; diff --git a/app/src/main/java/com/breadwallet/tools/animation/BRAnimator.java b/app/src/main/java/com/breadwallet/tools/animation/BRAnimator.java index 497beeddc..142751566 100644 --- a/app/src/main/java/com/breadwallet/tools/animation/BRAnimator.java +++ b/app/src/main/java/com/breadwallet/tools/animation/BRAnimator.java @@ -39,7 +39,6 @@ import com.breadwallet.presenter.fragments.FragmentRequestAmount; import com.breadwallet.presenter.fragments.FragmentSend; import com.breadwallet.presenter.fragments.FragmentSignal; -import com.breadwallet.presenter.fragments.FragmentSupport; import com.breadwallet.presenter.fragments.FragmentTransactionDetails; import com.breadwallet.presenter.interfaces.BROnSignalCompletion; import com.breadwallet.tools.threads.BRExecutor; @@ -124,35 +123,6 @@ public static void showSendFragment(FragmentActivity app, final String bitcoinUr } } - public static void showSupportFragment(Activity app, String articleId) { - if (supportIsShowing) return; - supportIsShowing = true; - if (app == null) { - Timber.i("showSupportFragment: app is null"); - return; - } - FragmentSupport fragmentSupport = (FragmentSupport) app.getFragmentManager().findFragmentByTag(FragmentSupport.class.getName()); - if (fragmentSupport != null && fragmentSupport.isAdded()) { - app.getFragmentManager().popBackStack(); - return; - } - try { - fragmentSupport = new FragmentSupport(); - if (articleId != null && !articleId.isEmpty()) { - Bundle bundle = new Bundle(); - bundle.putString("articleId", articleId); - fragmentSupport.setArguments(bundle); - } - app.getFragmentManager().beginTransaction() - .setCustomAnimations(0, 0, 0, R.animator.plain_300) - .add(android.R.id.content, fragmentSupport, FragmentSend.class.getName()) - .addToBackStack(FragmentSend.class.getName()).commit(); - - } finally { - - } - } - public static void popBackStackTillEntry(Activity app, int entryIndex) { if (app.getFragmentManager() == null) { diff --git a/app/src/main/java/com/breadwallet/tools/security/BRKeyStore.java b/app/src/main/java/com/breadwallet/tools/security/BRKeyStore.java index 33e0b9eab..cbcabd69e 100644 --- a/app/src/main/java/com/breadwallet/tools/security/BRKeyStore.java +++ b/app/src/main/java/com/breadwallet/tools/security/BRKeyStore.java @@ -65,31 +65,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRKeyStore { private static final String KEY_STORE_PREFS_NAME = "keyStorePrefs"; @@ -184,6 +159,9 @@ private synchronized static boolean _setData(Context context, byte[] data, Strin secretKey = createKeys(alias, auth_required); inCipher.init(Cipher.ENCRYPT_MODE, secretKey); } else { + + Timber.d("KeyStore: is initialized"); + //see if the key is old format, create a new one if it is try { inCipher.init(Cipher.ENCRYPT_MODE, secretKey); @@ -976,7 +954,6 @@ public void onClick(View textView) { @Override public void run() { BRDialog.hideDialog(); - BRAnimator.showSupportFragment((Activity) app, BRConstants.loopBug); } }); } diff --git a/app/src/main/java/com/platform/APIClient.java b/app/src/main/java/com/platform/APIClient.java index d8ef1c291..854f3a695 100644 --- a/app/src/main/java/com/platform/APIClient.java +++ b/app/src/main/java/com/platform/APIClient.java @@ -561,20 +561,6 @@ public void run() { } }); - //update kvStore - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - Thread.currentThread().setName("updatePlatform"); - final long startTime = System.currentTimeMillis(); - APIClient apiClient = APIClient.getInstance(ctx); - apiClient.syncKvStore(); - long endTime = System.currentTimeMillis(); - Timber.d("syncKvStore: DONE in %sms", endTime - startTime); - itemFinished(); - } - }); - //update fee BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { @Override diff --git a/app/src/main/java/com/platform/HTTPServer.java b/app/src/main/java/com/platform/HTTPServer.java deleted file mode 100644 index 4b5f88c33..000000000 --- a/app/src/main/java/com/platform/HTTPServer.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.platform; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.net.Uri; -import android.util.Log; - -import com.breadwallet.BreadApp; -import com.breadwallet.tools.threads.BRExecutor; -import com.breadwallet.tools.util.Utils; -import com.platform.interfaces.Middleware; -import com.platform.interfaces.Plugin; -import com.platform.middlewares.APIProxy; -import com.platform.middlewares.HTTPFileMiddleware; -import com.platform.middlewares.HTTPIndexMiddleware; -import com.platform.middlewares.HTTPRouter; -import com.platform.middlewares.plugins.WalletPlugin; - -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.HandlerCollection; -import org.eclipse.jetty.websocket.server.WebSocketHandler; -import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory; - -import java.io.IOException; -import java.util.LinkedHashSet; -import java.util.Set; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/17/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class HTTPServer { - private static Set middlewares; - private static Server server; - public static final int PORT = 31120; - public static final String URL_EA = "http://localhost:" + PORT + "/ea"; - public static final String URL_BUY = "http://localhost:" + PORT + "/buy"; - public static final String URL_SUPPORT = "http://localhost:" + PORT + "/support"; - public static ServerMode mode; - - public enum ServerMode { - SUPPORT, - BUY, - EA - } - - public HTTPServer() { - init(); - } - - private static void init() { - middlewares = new LinkedHashSet<>(); - server = new Server(PORT); - try { - server.dump(System.err); - } catch (IOException e) { - Timber.e(e); - } - - HandlerCollection handlerCollection = new HandlerCollection(); - - ServerHandler serverHandler = new ServerHandler(); - handlerCollection.addHandler(serverHandler); - - server.setHandler(handlerCollection); - - setupIntegrations(); - - } - - public synchronized static void startServer() { - Timber.d("startServer"); - try { - if (server != null && server.isStarted()) { - return; - } - if (server == null) init(); - server.start(); - server.join(); - } catch (Exception ex) { - Timber.e(ex); - } - } - - public static void stopServer() { - Timber.d("stopServer"); - try { - if (server != null) - server.stop(); - } catch (Exception e) { - Timber.e(e); - } - server = null; - } - - public boolean isStarted() { - return server != null && server.isStarted(); - } - - private static class ServerHandler extends AbstractHandler { - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException { - boolean success; - success = dispatch(target, baseRequest, request, response); - if (!success) { - Timber.i("handle: NO MIDDLEWARE HANDLED THE REQUEST: %s", target); - } - } - } - - private static boolean dispatch(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - Timber.d("TRYING TO HANDLE: " + target + " (" + request.getMethod() + ")"); - final Context app = BreadApp.getBreadContext(); - boolean result = false; - if (target.equalsIgnoreCase("/_close")) { - if (app != null) { - BRExecutor.getInstance().forMainThreadTasks().execute(new Runnable() { - @Override - public void run() { - ((Activity) app).onBackPressed(); - } - }); - return BRHTTPHelper.handleSuccess(200, null, baseRequest, response, null); - } - return true; - } else if (target.toLowerCase().startsWith("/_email")) { - Timber.d("dispatch: uri: %s", baseRequest.getUri().toString()); - String address = Uri.parse(baseRequest.getUri().toString()).getQueryParameter("address"); - Timber.d("dispatch: address: %s", address); - if (Utils.isNullOrEmpty(address)) { - return BRHTTPHelper.handleError(400, "no address", baseRequest, response); - } - - Intent email = new Intent(Intent.ACTION_SEND); - email.putExtra(Intent.EXTRA_EMAIL, new String[]{address}); - - //need this to prompts email client only - email.setType("message/rfc822"); - - app.startActivity(Intent.createChooser(email, "Choose an Email client :")); - return BRHTTPHelper.handleSuccess(200, null, baseRequest, response, null); - } else if (target.toLowerCase().startsWith("/didload")) { - return BRHTTPHelper.handleSuccess(200, null, baseRequest, response, null); - } - - for (Middleware m : middlewares) { - result = m.handle(target, baseRequest, request, response); - if (result) { - String className = m.getClass().getName().substring(m.getClass().getName().lastIndexOf(".") + 1); - if (!className.contains("HTTPRouter")) - Timber.d("dispatch: " + className + " succeeded:" + request.getRequestURL()); - break; - } - } - return result; - } - - private static void setupIntegrations() { - // proxy api for signing and verification - APIProxy apiProxy = new APIProxy(); - middlewares.add(apiProxy); - - // http router for native functionality - HTTPRouter httpRouter = new HTTPRouter(); - middlewares.add(httpRouter); - - // basic file server for static assets - HTTPFileMiddleware httpFileMiddleware = new HTTPFileMiddleware(); - middlewares.add(httpFileMiddleware); - - // middleware to always return index.html for any unknown GET request (facilitates window.history style SPAs) - HTTPIndexMiddleware httpIndexMiddleware = new HTTPIndexMiddleware(); - middlewares.add(httpIndexMiddleware); - - // wallet plugin provides access to the wallet - Plugin walletPlugin = new WalletPlugin(); - httpRouter.appendPlugin(walletPlugin); - } - -} diff --git a/app/src/main/java/com/platform/interfaces/Middleware.java b/app/src/main/java/com/platform/interfaces/Middleware.java deleted file mode 100644 index 8e2c7ee76..000000000 --- a/app/src/main/java/com/platform/interfaces/Middleware.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.platform.interfaces; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import okhttp3.Request; -import okhttp3.Response; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/18/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public interface Middleware { - - boolean handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response); - -} diff --git a/app/src/main/java/com/platform/interfaces/Plugin.java b/app/src/main/java/com/platform/interfaces/Plugin.java deleted file mode 100644 index 753c95686..000000000 --- a/app/src/main/java/com/platform/interfaces/Plugin.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.platform.interfaces; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/1/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public interface Plugin { - boolean handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response); -} diff --git a/app/src/main/java/com/platform/middlewares/APIProxy.java b/app/src/main/java/com/platform/middlewares/APIProxy.java deleted file mode 100644 index f7612c730..000000000 --- a/app/src/main/java/com/platform/middlewares/APIProxy.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.platform.middlewares; - -import android.content.Context; - -import com.breadwallet.BreadApp; -import com.platform.APIClient; -import com.platform.interfaces.Middleware; - -import org.apache.commons.io.IOUtils; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Enumeration; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import okhttp3.Headers; -import okhttp3.MediaType; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import timber.log.Timber; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/19/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class APIProxy implements Middleware { - - private APIClient apiInstance; - private static final String MOUNT_POINT = "/_api"; - private final String SHOULD_VERIFY_HEADER = "x-should-verify"; - private final String SHOULD_AUTHENTICATE = "x-should-authenticate"; - private final String[] bannedSendHeaders = new String[]{ - SHOULD_VERIFY_HEADER, - SHOULD_AUTHENTICATE, - "connection", - "authorization", - "host", - "user-agent"}; - - private final String[] bannedReceiveHeaders = new String[]{ - "content-length", - "content-encoding", - "connection"}; - - public APIProxy() { - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("APIProxy: app is null!"); - } - apiInstance = APIClient.getInstance(app); - } - - @Override - public boolean handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - if (!target.startsWith(MOUNT_POINT)) return false; - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - String path = target.substring(MOUNT_POINT.length()); - String queryString = baseRequest.getQueryString(); - if (queryString != null && queryString.length() > 0) - path += "?" + queryString; - boolean auth = false; - Request req = mapToOkHttpRequest(baseRequest, path, request); - String authHeader = baseRequest.getHeader(SHOULD_AUTHENTICATE); - - if (authHeader != null && (authHeader.toLowerCase().equals("yes") || authHeader.toLowerCase().equals("true"))) { - auth = true; - } - - Response res = apiInstance.sendRequest(req, auth, 0); - try { - ResponseBody body = res.body(); - String cType = body.contentType() == null ? null : body.contentType().toString(); - String resString = null; - byte[] bodyBytes = new byte[0]; - try { - bodyBytes = body.bytes(); - resString = new String(bodyBytes); - } catch (IOException e) { - Timber.e(e); - } - - response.setContentType(cType); - Headers headers = res.headers(); - for (String s : headers.names()) { - if (Arrays.asList(bannedReceiveHeaders).contains(s.toLowerCase())) continue; - response.addHeader(s, res.header(s)); - } - response.setContentLength(bodyBytes.length); - - if (!res.isSuccessful()) { - Timber.d("RES IS NOT SUCCESSFUL: " + res.request().url() + ": " + res.code() + "(" + res.message() + ")"); - } - - try { - response.setStatus(res.code()); - if (cType != null && !cType.isEmpty()) - response.setContentType(cType); - response.getOutputStream().write(bodyBytes); - baseRequest.setHandled(true); - } catch (IOException e) { - Timber.e(e); - } - } finally { - if (res != null) res.close(); - } - return true; - - } - - private Request mapToOkHttpRequest(org.eclipse.jetty.server.Request baseRequest, String path, HttpServletRequest request) { - Request req; - Request.Builder builder = new Request.Builder() - .url(apiInstance.buildUrl(path)); - - Enumeration headerNames = baseRequest.getHeaderNames(); - while (headerNames.hasMoreElements()) { - String hName = headerNames.nextElement(); - if (Arrays.asList(bannedSendHeaders).contains(hName.toLowerCase())) continue; - builder.addHeader(hName, baseRequest.getHeader(hName)); - } - - byte[] bodyText = new byte[0]; - try { - bodyText = IOUtils.toByteArray(request.getInputStream()); - } catch (IOException e) { - Timber.e(e); - } - String contentType = baseRequest.getContentType() == null ? null : baseRequest.getContentType(); - RequestBody reqBody = RequestBody.create(contentType == null ? null : MediaType.parse(contentType), bodyText); - - switch (baseRequest.getMethod()) { - case "GET": - builder.get(); - break; - case "DELETE": - builder.delete(); - break; - case "POST": - builder.post(reqBody); - break; - case "PUT": - builder.put(reqBody); - break; - default: - Timber.d("mapToOkHttpRequest: WARNING: method: %s", baseRequest.getMethod()); - break; - } - - req = builder.build(); - return req; - } -} diff --git a/app/src/main/java/com/platform/middlewares/HTTPFileMiddleware.java b/app/src/main/java/com/platform/middlewares/HTTPFileMiddleware.java deleted file mode 100644 index ea06100e8..000000000 --- a/app/src/main/java/com/platform/middlewares/HTTPFileMiddleware.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.platform.middlewares; - -import android.content.Context; - -import com.breadwallet.BreadApp; -import com.breadwallet.tools.crypto.CryptoHelper; -import com.breadwallet.tools.util.TypesConverter; -import com.breadwallet.tools.util.Utils; -import com.platform.APIClient; -import com.platform.BRHTTPHelper; -import com.platform.interfaces.Middleware; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import okhttp3.Request; -import okhttp3.Response; -import timber.log.Timber; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/17/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class HTTPFileMiddleware implements Middleware { - private final static String DEBUG_URL = null; //modify for testing - - @Override - public boolean handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - if (target.equals("/")) return false; - if (target.equals("/favicon.ico")) { - return BRHTTPHelper.handleSuccess(200, null, baseRequest, response, null); - } - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.e("handle: app is null!"); - return true; - } - File temp = null; - byte[] body = null; - if (DEBUG_URL == null) { - // fetch the file locally - String requestedFile = APIClient.getInstance(app).getExtractedPath(app, target); - temp = new File(requestedFile); - if (temp.exists() && !temp.isDirectory()) { - Timber.d("handle: found bundle for:%s", target); - } else { - Timber.i("handle: no bundle found for: %s", target); - return false; - } - - Timber.i("handling: %s %s", target, baseRequest.getMethod()); - boolean modified = true; - byte[] md5 = CryptoHelper.md5(TypesConverter.long2byteArray(temp.lastModified())); - String hexEtag = Utils.bytesToHex(md5); - response.setHeader("ETag", hexEtag); - - // if the client sends an if-none-match header, determine if we have a newer version of the file - String etag = request.getHeader("if-none-match"); - if (etag != null && etag.equalsIgnoreCase(hexEtag)) modified = false; - - if (modified) { - try { - body = FileUtils.readFileToByteArray(temp); - } catch (IOException e) { - Timber.e(e); - } - if (body == null) { - return BRHTTPHelper.handleError(400, "could not read the file", baseRequest, response); - } - } else { - return BRHTTPHelper.handleSuccess(304, null, baseRequest, response, null); - } - response.setContentType(detectContentType(temp)); - - } else { - // download the file from the debug endpoint - String debugUrl = DEBUG_URL + target; - - Request debugRequest = new Request.Builder() - .url(debugUrl) - .get().build(); - Response debugResp = null; - try { - debugResp = APIClient.getInstance(app).sendRequest(debugRequest, false, 0); - if (debugResp != null) - body = debugResp.body().bytes(); - } catch (IOException e) { - Timber.e(e); - } finally { - debugResp.close(); - } - - } - - String rangeString = request.getHeader("range"); - if (!Utils.isNullOrEmpty(rangeString)) { - // Range header should match format "bytes=n-n,n-n,n-n...". If not, then return 416. - return handlePartialRequest(baseRequest, response, temp); - } else { - if (body == null) { - return BRHTTPHelper.handleError(404, "not found", baseRequest, response); - } else { - return BRHTTPHelper.handleSuccess(200, body, baseRequest, response, null); - } - } - - } - - private boolean handlePartialRequest(org.eclipse.jetty.server.Request request, HttpServletResponse response, File file) { - try { - String rangeHeader = request.getHeader("range"); - String rangeValue = rangeHeader.trim() - .substring("bytes=".length()); - int fileLength = (int) file.length(); - int start, end; - if (rangeValue.startsWith("-")) { - end = fileLength - 1; - start = fileLength - 1 - - Integer.parseInt(rangeValue.substring("-".length())); - } else { - String[] range = rangeValue.split("-"); - start = Integer.parseInt(range[0]); - end = range.length > 1 ? Integer.parseInt(range[1]) - : fileLength - 1; - } - if (end > fileLength - 1) { - end = fileLength - 1; - } - if (start <= end) { - int contentLength = end - start + 1; - response.setHeader("Content-Length", contentLength + ""); - response.setHeader("Content-Range", "bytes " + start + "-" - + end + "/" + fileLength); - byte[] respBody = Arrays.copyOfRange(FileUtils.readFileToByteArray(file), start, contentLength); - return BRHTTPHelper.handleSuccess(206, respBody, request, response, detectContentType(file)); - } - } catch (Exception e) { - Timber.e(e); - try { - request.setHandled(true); - response.getWriter().write("Invalid Range Header"); - response.sendError(400, "Bad Request"); - } catch (IOException e1) { - Timber.e(e1); - } - - return true; - } - return BRHTTPHelper.handleError(500, "unknown error", request, response); - } - - private String detectContentType(File file) { - String extension = FilenameUtils.getExtension(file.getAbsolutePath()); - switch (extension) { - case "ttf": - return "application/font-truetype"; - case "woff": - return "application/font-woff"; - case "otf": - return "application/font-opentype"; - case "svg": - return "image/svg+xml"; - case "html": - return "text/html"; - case "png": - return "image/png"; - case "jpeg": - return "image/jpeg"; - case "jpg": - return "image/jpeg"; - case "css": - return "text/css"; - case "js": - return "application/javascript"; - case "json": - return "application/json"; - default: - break; - } - return "application/octet-stream"; - } -} diff --git a/app/src/main/java/com/platform/middlewares/HTTPIndexMiddleware.java b/app/src/main/java/com/platform/middlewares/HTTPIndexMiddleware.java deleted file mode 100644 index 3586921cd..000000000 --- a/app/src/main/java/com/platform/middlewares/HTTPIndexMiddleware.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.platform.middlewares; - -import android.app.Activity; -import android.content.Context; -import android.util.Log; - -import com.breadwallet.BreadApp; -import com.platform.APIClient; -import com.platform.BRHTTPHelper; -import com.platform.HTTPServer; -import com.platform.interfaces.Middleware; - -import junit.framework.Assert; - -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.io.IOException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/19/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class HTTPIndexMiddleware implements Middleware { - - @Override - public boolean handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("handle: app is null!"); - return true; - } - - String indexFile = APIClient.getInstance(app).getExtractedPath(app, rTrim(target, "/") + "/index.html"); - - File temp = new File(indexFile); - if (!temp.exists()) { - return false; - } - - try { - byte[] body = FileUtils.readFileToByteArray(temp); - Assert.assertNotNull(body); - Assert.assertNotSame(body.length, 0); - response.setHeader("Content-Length", String.valueOf(body.length)); - return BRHTTPHelper.handleSuccess(200, body, baseRequest, response, "text/html;charset=utf-8"); - } catch (IOException e) { - Timber.e(e, "handle: error sending response: "); - return BRHTTPHelper.handleError(500, null, baseRequest, response); - } - } - - public String rTrim(String str, String piece) { - if (str.endsWith(piece)) { - return str.substring(str.lastIndexOf(piece), str.length()); - } - return str; - } -} diff --git a/app/src/main/java/com/platform/middlewares/HTTPRouter.java b/app/src/main/java/com/platform/middlewares/HTTPRouter.java deleted file mode 100644 index 0cbe732d4..000000000 --- a/app/src/main/java/com/platform/middlewares/HTTPRouter.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.platform.middlewares; - -import com.platform.interfaces.Middleware; -import com.platform.interfaces.Plugin; - -import java.util.LinkedHashSet; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/19/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class HTTPRouter implements Middleware { - Set plugins; - - public HTTPRouter() { - plugins = new LinkedHashSet<>(); - } - - @Override - public boolean handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - for (Plugin plugin : plugins) { - boolean success = plugin.handle(target, baseRequest, request, response); - if (success) { - Timber.d("plugin: " + plugin.getClass().getName().substring(plugin.getClass().getName().lastIndexOf(".") + 1) + " succeeded:" + request.getRequestURL()); - return true; - } - } - return false; - } - - public void appendPlugin(Plugin plugin) { - plugins.add(plugin); - } -} diff --git a/app/src/main/java/com/platform/middlewares/plugins/WalletPlugin.java b/app/src/main/java/com/platform/middlewares/plugins/WalletPlugin.java deleted file mode 100644 index 9a9367049..000000000 --- a/app/src/main/java/com/platform/middlewares/plugins/WalletPlugin.java +++ /dev/null @@ -1,227 +0,0 @@ -package com.platform.middlewares.plugins; - -import android.app.Activity; - -import com.breadwallet.BreadApp; -import com.breadwallet.tools.manager.BREventManager; -import com.breadwallet.tools.manager.BRSharedPrefs; -import com.breadwallet.tools.threads.BRExecutor; -import com.breadwallet.tools.util.BRConstants; -import com.breadwallet.tools.util.Utils; -import com.breadwallet.wallet.BRWalletManager; -import com.platform.BRHTTPHelper; -import com.platform.interfaces.Plugin; - -import org.apache.commons.compress.utils.IOUtils; -import org.eclipse.jetty.continuation.Continuation; -import org.eclipse.jetty.continuation.ContinuationSupport; -import org.eclipse.jetty.server.Request; -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.IOException; -import java.util.Currency; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/2/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class WalletPlugin implements Plugin { - private static Continuation continuation; - private static Request globalBaseRequest; - - @Override - public boolean handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - if (!target.startsWith("/_wallet")) return false; - Activity app = (Activity) BreadApp.getBreadContext(); - - if (target.startsWith("/_wallet/info") && request.getMethod().equalsIgnoreCase("get")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "context is null", baseRequest, response); - } - BRWalletManager wm = BRWalletManager.getInstance(); - JSONObject jsonResp = new JSONObject(); - try { - /**whether or not the users wallet is set up yet, or is currently locked*/ - jsonResp.put("no_wallet", wm.noWalletForPlatform(app)); - - /**the current receive address*/ - jsonResp.put("receive_address", BRWalletManager.getReceiveAddress()); - - /**how digits after the decimal point. 2 = bits 8 = btc 6 = mbtc*/ - jsonResp.put("ltc_denomiation_digits", BRSharedPrefs.getCurrencyUnit(app) == BRConstants.CURRENT_UNIT_LITECOINS ? 8 : 2); - - /**the users native fiat currency as an ISO 4217 code. Should be uppercased */ - jsonResp.put("local_currency_code", Currency.getInstance(Locale.getDefault()).getCurrencyCode().toUpperCase()); - return BRHTTPHelper.handleSuccess(200, jsonResp.toString().getBytes(), baseRequest, response, "application/json"); - } catch (JSONException e) { - Timber.e(e); - return BRHTTPHelper.handleError(500, "json error", baseRequest, response); - } - } else if (target.startsWith("/_wallet/_event") && request.getMethod().equalsIgnoreCase("get")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - byte[] rawData = BRHTTPHelper.getBody(request); - String name = target.replace("/_event/", ""); - - Timber.d("handle: body: %s", new String(rawData != null ? rawData : "null".getBytes())); - JSONObject json = null; - if (rawData != null) { - try { - json = new JSONObject(new String(rawData)); - } catch (JSONException e) { - Timber.e(e); - } - } - if (json != null) { - Map attr = new HashMap<>(); - while (json.keys().hasNext()) { - String key = json.keys().next(); - try { - attr.put(key, json.getString(key)); - } catch (JSONException e) { - Timber.e(e); - } - } - BREventManager.getInstance().pushEvent(name, attr); - } else { - BREventManager.getInstance().pushEvent(name); - } - return BRHTTPHelper.handleSuccess(200, null, baseRequest, response, null); - - } else if (target.startsWith("/_wallet/sign_bitid") && request.getMethod().equalsIgnoreCase("post")) { - Timber.d("handling: " + target + " " + baseRequest.getMethod()); - /** - * POST /_wallet/sign_bitid - - Sign a message using the user's BitID private key. Calling this WILL trigger authentication - - Request body: application/json - { - "prompt_string": "Sign in to My Service", // shown to the user in the authentication prompt - "string_to_sign": "https://bitid.org/bitid?x=2783408723", // the string to sign - "bitid_url": "https://bitid.org/bitid", // the bitid url for deriving the private key - "bitid_index": "0" // the bitid index as a string (just pass "0") - } - - Response body: application/json - { - "signature": "oibwaeofbawoefb" // base64-encoded signature - } - */ - if (app == null) { - Timber.i("handle: context is null: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(500, "context is null", baseRequest, response); - } - String contentType = request.getHeader("content-type"); - if (contentType == null || !contentType.equalsIgnoreCase("application/json")) { - Timber.d("handle: content type is not application/json: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(400, null, baseRequest, response); - } - String reqBody = null; - try { - reqBody = new String(IOUtils.toByteArray(request.getInputStream())); - } catch (IOException e) { - Timber.e(e); - } - if (Utils.isNullOrEmpty(reqBody)) { - Timber.d("handle: reqBody is empty: " + target + " " + baseRequest.getMethod()); - return BRHTTPHelper.handleError(400, null, baseRequest, response); - } - - try { - JSONObject obj = new JSONObject(reqBody); - continuation = ContinuationSupport.getContinuation(request); - continuation.suspend(response); - globalBaseRequest = baseRequest; - } catch (JSONException e) { - Timber.e(e); - return BRHTTPHelper.handleError(400, "failed to parse json", baseRequest, response); - } - - return true; - } - - Timber.d("handle: WALLET PLUGIN DID NOT HANDLE: %s %s", target, baseRequest.getMethod()); - return true; - } - - - public static void sendBitIdResponse(final JSONObject restJson, final boolean authenticated) { - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - try { - if (!authenticated) { - try { - ((HttpServletResponse) continuation.getServletResponse()).sendError(401); - } catch (IOException e) { - Timber.e(e, "sendBitIdResponse: failed to send error 401"); - } - return; - } - if (restJson == null || restJson.isNull("signature")) { - Timber.d("sendBitIdResponse: WARNING restJson is null: %s", restJson); - try { - ((HttpServletResponse) continuation.getServletResponse()).sendError(500, "json malformed or null"); - } catch (IOException e) { - Timber.e(e, "sendBitIdResponse: failed to send error 401"); - } - return; - } - if (continuation == null) { - Timber.d("sendBitIdResponse: WARNING continuation is null"); - return; - } - - try { - continuation.getServletResponse().setContentType("application/json"); - continuation.getServletResponse().setCharacterEncoding("UTF-8"); - continuation.getServletResponse().getWriter().print(restJson); - Timber.d("sendBitIdResponse: finished with writing to the response: %s", restJson); - } catch (Exception e) { - Timber.e(e, "sendBitIdResponse Failed to send json: "); - } - ((HttpServletResponse) continuation.getServletResponse()).setStatus(200); - } finally { - if (globalBaseRequest != null) - globalBaseRequest.setHandled(true); - if (continuation != null) - continuation.complete(); - continuation = null; - globalBaseRequest = null; - } - } - }); - } -} \ No newline at end of file From a32b4a16ededc2e13821007bb96f733ae96919d5 Mon Sep 17 00:00:00 2001 From: kcw-grunt Date: Tue, 7 Dec 2021 00:19:24 +0000 Subject: [PATCH 9/9] Refactor Removed BRHTTPHelper class Reduce cruft in APIClient - Some methods being used - Will reduce more in upcoming commits Removed the huge header Removed empty classes Removed excessive headers Remove references to BitID and BCH Renamed the GET url method Removed unused imports in APIClient Removed some KeyStore code --- app/build.gradle | 2 +- .../breadwallet/database/DatabaseTests.java | 26 - .../breadwallet/platform/KVStoreTests.java | 26 - .../breadwallet/platform/PlatformTests.java | 177 ------- .../breadwallet/presenter/ScanResultTest.java | 269 ---------- .../screenshots/JUnit4StyleTests.java | 120 ----- .../breadwallet/security/KeyStoreTests.java | 35 -- .../security/NewKeyStoreTests.java | 25 - .../com/breadwallet/wallet/WalletTests.java | 25 - .../main/java/com/breadwallet/BreadApp.java | 25 - .../exceptions/BRKeystoreErrorException.java | 24 - .../exceptions/CertificateChainNotFound.java | 25 - .../PaymentRequestExpiredException.java | 25 - .../presenter/activities/BreadActivity.java | 36 +- .../presenter/activities/LoginActivity.java | 2 - .../activities/camera/CameraActivity.java | 25 - .../activities/camera/ScanQRActivity.java | 25 - .../activities/intro/IntroActivity.java | 26 - .../presenter/customviews/BRButton.java | 24 - .../presenter/customviews/BRDialogView.java | 24 - .../presenter/customviews/BRKeyboard.java | 25 - .../customviews/BRLinearLayoutWithCaret.java | 24 - .../BRLockScreenConstraintLayout.java | 24 - .../customviews/BRNotificationBar.java | 24 - .../customviews/BRRelativeLayout.java | 24 - .../presenter/customviews/BRToast.java | 24 - .../presenter/entities/BRMenuItem.java | 24 - .../entities/BRMerkleBlockEntity.java | 25 - .../presenter/entities/BRPeerEntity.java | 26 - .../entities/BRSecurityCenterItem.java | 24 - .../presenter/entities/BRSettingsItem.java | 24 - .../entities/BRTransactionEntity.java | 26 - .../presenter/entities/BlockEntity.java | 26 - .../presenter/entities/CurrencyEntity.java | 26 - .../entities/ImportPrivKeyEntity.java | 26 - .../presenter/entities/PaymentItem.java | 25 - .../entities/PaymentRequestWrapper.java | 26 - .../presenter/entities/PeerEntity.java | 26 - .../presenter/entities/RequestObject.java | 26 - .../presenter/entities/TxItem.java | 25 - .../presenter/fragments/FragmentBuy.java | 25 - .../fragments/FragmentGreetings.java | 25 - .../fragments/FragmentPhraseWord.java | 29 -- .../presenter/fragments/FragmentPin.java | 25 - .../presenter/fragments/FragmentReceive.java | 25 - .../fragments/FragmentRequestAmount.java | 1 - .../presenter/fragments/FragmentSignal.java | 26 - .../fragments/FragmentTransactionDetails.java | 26 - .../interfaces/BRAuthCompletion.java | 24 - .../interfaces/BROnSignalCompletion.java | 24 - .../presenter/interfaces/BreadPayment.java | 24 - .../breadwallet/tools/adapter/CurAdapter.java | 26 - .../tools/adapter/TransactionListAdapter.java | 26 - .../adapter/TransactionPagerAdapter.java | 24 - .../tools/animation/BRAnimator.java | 26 - .../breadwallet/tools/animation/BRDialog.java | 24 - .../DecelerateOvershootInterpolator.java | 25 - .../tools/animation/SlideDetector.java | 25 - .../tools/animation/SpringAnimator.java | 25 - .../com/breadwallet/tools/crypto/Base58.java | 24 - .../tools/crypto/CryptoHelper.java | 25 - .../listeners/RecyclerItemClickListener.java | 24 - .../tools/listeners/SyncReceiver.java | 24 - .../tools/manager/BRApiManager.java | 36 +- .../tools/manager/BRClipboardManager.java | 25 - .../tools/manager/BREventManager.java | 24 - .../tools/manager/BRNotificationManager.java | 26 - .../tools/manager/BRSharedPrefs.java | 37 -- .../tools/manager/InternetManager.java | 26 - .../tools/manager/PromptManager.java | 24 - .../tools/manager/SyncManager.java | 24 - .../breadwallet/tools/manager/TxManager.java | 25 - .../com/breadwallet/tools/qrcode/QRUtils.java | 24 - .../tools/security/AuthManager.java | 25 - .../tools/security/BRErrorPipe.java | 146 ------ .../breadwallet/tools/security/BRSender.java | 24 - .../tools/security/BitcoinUrlHandler.java | 26 - .../breadwallet/tools/security/PostAuth.java | 118 ----- .../tools/security/RootHelper.java | 25 - .../tools/security/SmartValidator.java | 24 - .../security/X509CertificateValidator.java | 25 - .../breadwallet/tools/threads/BRExecutor.java | 24 - .../breadwallet/tools/threads/Examples.java | 24 - .../tools/threads/ImportPrivKeyTask.java | 25 - .../tools/threads/MainThreadExecutor.java | 24 - .../PaymentProtocolPostPaymentTask.java | 26 - .../tools/threads/PaymentProtocolTask.java | 26 - .../breadwallet/tools/threads/Priority.java | 24 - .../tools/threads/PriorityRunnable.java | 24 - .../tools/threads/PriorityThreadFactory.java | 24 - .../threads/PriorityThreadPoolExecutor.java | 24 - .../breadwallet/tools/util/BRCompressor.java | 24 - .../breadwallet/tools/util/BRConstants.java | 26 - .../breadwallet/tools/util/BRCurrency.java | 25 - .../breadwallet/tools/util/BRDateUtil.java | 24 - .../breadwallet/tools/util/BRExchange.java | 24 - .../breadwallet/tools/util/Bip39Reader.java | 25 - .../com/breadwallet/tools/util/BytesUtil.java | 25 - .../breadwallet/tools/util/CustomLogger.java | 25 - .../breadwallet/tools/util/FileHelper.java | 24 - .../breadwallet/tools/util/TrustedNode.java | 24 - .../tools/util/TypesConverter.java | 25 - .../com/breadwallet/tools/util/Utils.java | 25 - .../com/breadwallet/wallet/BRPeerManager.java | 25 - .../breadwallet/wallet/BRWalletManager.java | 27 +- app/src/main/java/com/jniwrappers/BRKey.java | 24 - app/src/main/java/com/platform/APIClient.java | 463 +----------------- .../main/java/com/platform/BRHTTPHelper.java | 84 ---- .../com/platform/entities/TxMetaData.java | 24 - .../com/platform/entities/WalletInfo.java | 36 +- .../platform/interfaces/KVStoreAdaptor.java | 26 - .../platform/kvstore/CompletionObject.java | 24 - .../com/platform/kvstore/RemoteKVStore.java | 25 - .../platform/kvstore/ReplicatedKVStore.java | 25 - .../main/java/com/platform/sqlite/KVItem.java | 26 - .../platform/sqlite/PlatformSqliteHelper.java | 25 - .../com/platform/tools/KVStoreManager.java | 109 +---- .../main/jni/transition/JNIBIP32Sequence.c | 3 - .../main/jni/transition/JNIBIP32Sequence.h | 3 - app/src/main/jni/transition/JNIBase58.c | 3 - app/src/main/jni/transition/JNIBase58.h | 3 - app/src/main/jni/transition/JNIKey.c | 3 - app/src/main/jni/transition/JNIKey.h | 3 - app/src/main/jni/transition/PeerManager.c | 23 - app/src/main/jni/transition/PeerManager.h | 23 - app/src/main/jni/transition/core.c | 27 - app/src/main/jni/transition/core.h | 23 - app/src/main/jni/transition/wallet.c | 23 - app/src/main/jni/transition/wallet.h | 22 - .../main/res/layout/activity_withdraw_bch.xml | 170 ------- app/src/main/res/values-da/strings.xml | 34 -- app/src/main/res/values-de/strings.xml | 34 -- app/src/main/res/values-es/strings.xml | 34 -- app/src/main/res/values-fr/strings.xml | 34 -- app/src/main/res/values-in/strings.xml | 34 -- app/src/main/res/values-it/strings.xml | 34 -- app/src/main/res/values-ja/strings.xml | 34 -- app/src/main/res/values-ko/strings.xml | 34 -- app/src/main/res/values-nl/strings.xml | 34 -- app/src/main/res/values-pt/strings.xml | 34 -- app/src/main/res/values-ru/strings.xml | 34 -- app/src/main/res/values-sv/strings.xml | 34 -- app/src/main/res/values-tr/strings.xml | 34 -- app/src/main/res/values-zh-rCN/strings.xml | 34 -- app/src/main/res/values-zh-rTW/strings.xml | 34 -- app/src/main/res/values/strings.xml | 34 -- app/src/test/java/PaperKeyTests.java | 24 - 147 files changed, 19 insertions(+), 5064 deletions(-) delete mode 100644 app/src/androidTest/java/com/breadwallet/presenter/ScanResultTest.java delete mode 100644 app/src/androidTest/java/com/breadwallet/screenshots/JUnit4StyleTests.java delete mode 100644 app/src/main/java/com/breadwallet/tools/security/BRErrorPipe.java delete mode 100644 app/src/main/java/com/platform/BRHTTPHelper.java delete mode 100644 app/src/main/res/layout/activity_withdraw_bch.xml diff --git a/app/build.gradle b/app/build.gradle index a3f358085..772c27937 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,7 +58,7 @@ android { applicationId = 'com.loafwallet' minSdkVersion 27 targetSdkVersion 30 - versionCode 653 + versionCode 670 versionName "v2.4.2" multiDexEnabled true archivesBaseName = "${versionName}(${versionCode})" diff --git a/app/src/androidTest/java/com/breadwallet/database/DatabaseTests.java b/app/src/androidTest/java/com/breadwallet/database/DatabaseTests.java index 6b79d1c0a..aff149c3a 100644 --- a/app/src/androidTest/java/com/breadwallet/database/DatabaseTests.java +++ b/app/src/androidTest/java/com/breadwallet/database/DatabaseTests.java @@ -29,32 +29,6 @@ import java.util.List; import java.util.concurrent.CountDownLatch; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/30/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - @RunWith(AndroidJUnit4.class) @LargeTest diff --git a/app/src/androidTest/java/com/breadwallet/platform/KVStoreTests.java b/app/src/androidTest/java/com/breadwallet/platform/KVStoreTests.java index 3377839ff..61e31d724 100644 --- a/app/src/androidTest/java/com/breadwallet/platform/KVStoreTests.java +++ b/app/src/androidTest/java/com/breadwallet/platform/KVStoreTests.java @@ -31,32 +31,6 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/30/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - @RunWith(AndroidJUnit4.class) @LargeTest public class KVStoreTests { diff --git a/app/src/androidTest/java/com/breadwallet/platform/PlatformTests.java b/app/src/androidTest/java/com/breadwallet/platform/PlatformTests.java index f136bde02..cbd143249 100644 --- a/app/src/androidTest/java/com/breadwallet/platform/PlatformTests.java +++ b/app/src/androidTest/java/com/breadwallet/platform/PlatformTests.java @@ -18,41 +18,7 @@ import org.junit.Test; import org.junit.runner.RunWith; -import java.io.File; -import java.io.FileInputStream; import java.io.IOException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; - -import static com.platform.APIClient.BREAD_POINT; -import okhttp3.Request; -import okhttp3.Response; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/30/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ @RunWith(AndroidJUnit4.class) public class PlatformTests { @@ -90,149 +56,6 @@ public void testFeePerKbFetch() { } - @Test - public void bundleExtractTest() { - APIClient apiClient = APIClient.getInstance(mActivityRule.getActivity()); - - Request request = new Request.Builder() - .url(String.format("%s/assets/bundles/%s/download", BASE_URL, BREAD_POINT)) - .get().build(); - - Response response = null; - response = apiClient.sendRequest(request, false, 0); - try { - apiClient.writeBundleToFile(response); - String extractFolderName = apiClient.getExtractedPath(mActivityRule.getActivity(), null); - apiClient.tryExtractTar(); - File temp = new File(extractFolderName); - int filesExtracted = temp.listFiles().length; - Log.e(TAG, "bundleExtractTest: filesExtracted: " + filesExtracted); - Assert.assertNotSame(filesExtracted, 0); - Log.e(TAG, "bundleExtractTest: "); - if (temp.isDirectory()) { - String[] children = temp.list(); - for (int i = 0; i < children.length; i++) { - new File(temp, children[i]).delete(); - } - } - } finally { - response.close(); - } - } - - @Test - public void bundleDownloadTest() { - APIClient apiClient = APIClient.getInstance(mActivityRule.getActivity()); - Request request = new Request.Builder() - .get() - .url("https://s3.amazonaws.com/breadwallet-assets/bread-buy/7f5bc5c6cc005df224a6ea4567e508491acaffdc2e4769e5262a52f5b785e261.tar").build(); - Response response = apiClient.sendRequest(request, false, 0); - try { - File bundleFile = new File(apiClient.getBundleResource(mActivityRule.getActivity(), BREAD_POINT + ".tar")); - apiClient.writeBundleToFile(response); - String latestVersion = apiClient.getLatestVersion(); - Assert.assertNotNull(latestVersion); - String currentTarVersion = getCurrentVersion(bundleFile); - Log.e(TAG, "bundleUpdateTest: latestVersion: " + latestVersion + ", currentTarVersion: " + currentTarVersion); - - Assert.assertNotNull(currentTarVersion); - Assert.assertNotEquals(latestVersion, currentTarVersion); - } finally { - response.close(); - } - } - - @Test - public void bundleUpdateTest() { - -// APIClient apiClient = APIClient.getInstance(mActivityRule.getActivity()); -// -// Request request = new Request.Builder() -// .get() -// .url("https://s3.amazonaws.com/breadwallet-assets/bread-buy/bundle.tar").build(); -// Response response = apiClient.sendRequest(request, false, 0); -// byte[] bundleFileOldBytes = apiClient.writeBundleToFile(response); -// -// request = new Request.Builder() -// .get() -// .url("https://s3.amazonaws.com/breadwallet-assets/bread-buy/bundle2.tar").build(); -// response = apiClient.sendRequest(request, false, 0); -// File bundleFileLatest = new File(mActivityRule.getActivity().getFilesDir().getAbsolutePath() + String.format("/%s/%s.tar", BUNDLES, BREAD_POINT + "-test")); -// apiClient.writeBundleToFile(response); -// -// request = new Request.Builder() -// .get() -// .url("https://s3.amazonaws.com/breadwallet-assets/bread-buy/bundle_bundle2.bspatch").build(); -// response = apiClient.sendRequest(request, false, 0); -// File patch = new File(mActivityRule.getActivity().getFilesDir().getAbsolutePath() + String.format("/%s/%s.bspatch", BUNDLES, "patch")); -// byte[] patchBytes = apiClient.writeBundleToFile(response); -// -// Assert.assertTrue(bundleFileOld.exists() && bundleFileOld.length() > 10); -// Assert.assertTrue(bundleFileLatest.exists() && bundleFileLatest.length() > 10); -// Assert.assertTrue(patch.exists() && patch.length() > 10); -// -// Log.e(TAG, "bundleUpdateTest: bundleFileOld.length(): " + bundleFileOld.length()); -// Log.e(TAG, "bundleUpdateTest: bundleFileLatest.length(): " + bundleFileLatest.length()); -// Log.e(TAG, "bundleUpdateTest: patch.length(): " + patch.length()); -// -// byte[] oldFileBytes = new byte[0]; -// byte[] correctFileBytes = new byte[0]; -// try { -// -// FileOutputStream outputStream = new FileOutputStream(mActivityRule.getActivity().getFilesDir().getAbsolutePath() + String.format("/%s/%s.tar", BUNDLES, BREAD_POINT)); -// Log.e(TAG, "bundleUpdateTest: beforeDiff"); -// -// Patch.patch(bundleFileOldBytes, patchBytes, outputStream); -// -// byte[] updatedBundleBytes = IOUtils.toByteArray(new FileInputStream(bundleFileOld)); -// Log.e(TAG, "bundleUpdateTest: updatedBundleBytes: " + updatedBundleBytes.length); -// -// oldFileBytes = IOUtils.toByteArray(new FileInputStream(bundleFileOld)); -// correctFileBytes = IOUtils.toByteArray(new FileInputStream(bundleFileLatest)); -// -// } catch (IOException | InvalidHeaderException | CompressorException e) { -// e.printStackTrace(); -// } finally { -// boolean delete = patch.delete(); -// Log.e(TAG, "WARNING bundleUpdateTest: deleting patch, file deleted: " + delete); -// } -// Log.e(TAG, "bundleUpdateTest: oldFileBytes: " + oldFileBytes.length + ", correctFileBytes: " + correctFileBytes.length); -// Assert.assertArrayEquals(oldFileBytes, correctFileBytes); -// Assert.assertTrue(oldFileBytes.length != 0 && correctFileBytes.length != 0); - - } - - private String getCurrentVersion(File bundleFile) { - byte[] bFile; - String currentTarVersion = null; - try { - bFile = IOUtils.toByteArray(new FileInputStream(bundleFile)); - Log.e(TAG, "bundleUpdateTest: bFile.length: " + bFile.length); - MessageDigest digest = MessageDigest.getInstance("SHA-256"); - byte[] hash = digest.digest(bFile); - currentTarVersion = Utils.bytesToHex(hash); - } catch (IOException | NoSuchAlgorithmException e) { - e.printStackTrace(); - } - return currentTarVersion; - } - - @Test - public void testGetToken() { - APIClient apiClient = APIClient.getInstance(mActivityRule.getActivity()); - String token = apiClient.getToken(); - Assert.assertNotNull(token); - Assert.assertNotEquals(token.length(), 0); - } - - @Test - public void testMeRequest() { - APIClient apiClient = APIClient.getInstance(mActivityRule.getActivity()); - Response response = apiClient.buyBitcoinMe(); - Assert.assertTrue(response.isSuccessful()); - response.close(); - } - @Test public void testGZIP() { String data = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip 11111111for the future, " + diff --git a/app/src/androidTest/java/com/breadwallet/presenter/ScanResultTest.java b/app/src/androidTest/java/com/breadwallet/presenter/ScanResultTest.java deleted file mode 100644 index d20ce85bf..000000000 --- a/app/src/androidTest/java/com/breadwallet/presenter/ScanResultTest.java +++ /dev/null @@ -1,269 +0,0 @@ -//package com.breadwallet.presenter; -// -//import android.support.test.rule.ActivityTestRule; -//import android.support.test.runner.AndroidJUnit4; -//import android.util.Log; -//import android.widget.Button; -//import android.widget.TextView; -// -//import com.breadwallet.R; -//import com.breadwallet.presenter.activities.MainActivity; -// -//import org.junit.Before; -//import org.junit.Rule; -//import org.junit.Test; -//import org.junit.runner.RunWith; -// -//import static android.support.test.espresso.Espresso.onView; -//import static android.support.test.espresso.action.ViewActions.clearText; -//import static android.support.test.espresso.action.ViewActions.click; -//import static android.support.test.espresso.action.ViewActions.typeText; -//import static android.support.test.espresso.matcher.ViewMatchers.withId; -//import static android.support.test.espresso.matcher.ViewMatchers.withText; -//import static junit.framework.Assert.assertTrue; -// -///** -// * BreadWallet -// *

-// * Created by Mihail on 8/28/15. -// * Copyright (c) 2015 Mihail Gutan -// *

-// * Permission is hereby granted, free of charge, to any person obtaining a copy -// * of this software and associated documentation files (the "Software"), to deal -// * in the Software without restriction, including without limitation the rights -// * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// * copies of the Software, and to permit persons to whom the Software is -// * furnished to do so, subject to the following conditions: -// *

-// * The above copyright notice and this permission notice shall be included in -// * all copies or substantial portions of the Software. -// *

-// * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// * THE SOFTWARE. -// */ -//@RunWith(AndroidJUnit4.class) -//public class ScanResultTest { -// private static final String TAG = ScanResultTest.class.getName(); -// private String testAddress = "mhBmRiqosSHR9YnPTKc3xXcvhEcKtjet2p"; -// MainActivity activity; -// Button copyAddressFromClipboard; -// -// @Rule -// public ActivityTestRule mActivityRule = new ActivityTestRule<>( -// MainActivity.class); -// -// @Before -// public void initStuff() { -// Log.e(TAG, "initStuff: "); -// activity = mActivityRule.getActivity(); -// onView(withId(R.id.address_edit_text)).perform(clearText()); -// copyAddressFromClipboard = (Button) activity.findViewById(R.id.main_button_pay_address_from_clipboard); -// onView(withId(R.id.address_edit_text)).perform(typeText(testAddress)); -// onView(withId(R.id.main_button_pay_address_from_clipboard)).perform(click()); -// } -// -// @Test -// public void testSeparator() { -// onView(withText("0")).perform(click());//0 -// TextView rightValue = (TextView) mActivityRule.getActivity().findViewById(R.id.right_textview); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0")); -// onView(withText(".")).perform(click());//0. -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.")); -// onView(withText("0")).perform(click());//0.0 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.0")); -// onView(withText("9")).perform(click());//0.09 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.09")); -// onView(withText("7")).perform(click());//0.09 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.09")); -// onView(withId(R.id.keyboard_back_button)).perform(click());//0.0 -// onView(withText("2")).perform(click());//0.02 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.02")); -// onView(withId(R.id.keyboard_back_button)).perform(click());//0.0 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.0")); -// onView(withId(R.id.keyboard_back_button)).perform(click());//0. -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.")); -// onView(withText("1")).perform(click());//0.1 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.1")); -// onView(withText("2")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText(".")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText(".")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText("0")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText("0")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText("0")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText(".")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText(".")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText(".")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText("4")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withText("5")).perform(click());//0.12 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.12")); -// onView(withId(R.id.keyboard_back_button)).perform(click());//0.1 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.1")); -// onView(withId(R.id.keyboard_back_button)).perform(click());//0. -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.")); -// onView(withId(R.id.keyboard_back_button)).perform(click());//0 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0")); -// onView(withText(".")).perform(click());//0. -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.")); -// onView(withText("8")).perform(click());//0.8 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.8")); -// onView(withText("0")).perform(click());//0.80 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.80")); -// onView(withId(R.id.keyboard_back_button)).perform(click());//0.8 -// onView(withId(R.id.keyboard_back_button)).perform(click());//0. -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.")); -// onView(withId(R.id.keyboard_back_button)).perform(click());//0 -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0")); -// } -// -// @Test -// public void testDigits() { -// TextView rightValue = (TextView) mActivityRule.getActivity().findViewById(R.id.right_textview); -// onView(withText("1")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("1")); -// onView(withText("2")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12")); -// onView(withText("3")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("123")); -// onView(withText("4")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("1234")); -// onView(withText("5")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345")); -// onView(withText("6")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("123456")); -// onView(withText("7")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("1234567")); -// onView(withText("8")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678")); -// onView(withText("9")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("123456789")); -// onView(withText("0")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("1234567890")); -// onView(withText("5")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905")); -// onView(withText("4")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("123456789054")); -// onView(withText("2")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("1234567890542")); -// onView(withText("8")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428"));//21,000,000,000,000 Max -// onView(withText("3")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428"));//should be same, no change, max reached -// onView(withText(".")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428.")); -// onView(withText("0")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428.0")); -// onView(withText("1")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428.01")); -// onView(withText("0")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428.01")); -// onView(withText(".")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428.01")); -// onView(withText(".")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428.01")); -// onView(withText(".")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428.01")); -// onView(withText(".")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("12345678905428.01")); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0")); -// onView(withText("0")).perform(click()); -// onView(withText("0")).perform(click()); -// onView(withText("0")).perform(click()); -// onView(withText("0")).perform(click()); -// onView(withText("0")).perform(click()); -// onView(withText("2")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("2")); -// -// } -// -// @Test -// public void testBackPress() { -// TextView rightValue = (TextView) mActivityRule.getActivity().findViewById(R.id.right_textview); -// onView(withText("0")).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0")); -// onView(withText("0")).perform(click()); -// onView(withText(".")).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0")); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withText(".")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("0.")); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withText("1")).perform(click()); -// onView(withText(".")).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("1")); -// onView(withText("1")).perform(click()); -// onView(withText(".")).perform(click()); -// onView(withText("0")).perform(click()); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase("11.0")); -// -// } -// -// @Test -// public void testCurrenciesSwitch() { -// TextView rightValue = (TextView) mActivityRule.getActivity().findViewById(R.id.right_textview); -// TextView leftValue = (TextView) mActivityRule.getActivity().findViewById(R.id.left_textview); -// -// onView(withText("9")).perform(click()); -// onView(withText("2")).perform(click()); -// onView(withText("2")).perform(click()); -// onView(withText(".")).perform(click()); -// onView(withText("0")).perform(click()); -// String leftVal = getCleanValue(leftValue.getText().toString()); -// onView(withId(R.id.left_textview)).perform(click()); -// assertTrue(getCleanValue(leftValue.getText().toString()).equalsIgnoreCase("922.0")); -// assertTrue(getCleanValue(rightValue.getText().toString()).equalsIgnoreCase(leftVal)); -// -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withId(R.id.keyboard_back_button)).perform(click()); -// onView(withText("1")).perform(click()); -// -// } -// -// private String getCleanValue(String str) { -// StringBuilder builder = new StringBuilder(); -// for (int i = 0; i < str.length(); i++) { -// char c = str.charAt(i); -// if (Character.isDigit(c) || c == '.') -// builder.append(c); -// } -// return builder.toString(); -// } -//} \ No newline at end of file diff --git a/app/src/androidTest/java/com/breadwallet/screenshots/JUnit4StyleTests.java b/app/src/androidTest/java/com/breadwallet/screenshots/JUnit4StyleTests.java deleted file mode 100644 index cdee8e2bd..000000000 --- a/app/src/androidTest/java/com/breadwallet/screenshots/JUnit4StyleTests.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.breadwallet.screenshots; - -import android.os.Build; -import androidx.test.espresso.Espresso; -import androidx.test.espresso.IdlingPolicies; -import androidx.test.rule.ActivityTestRule; - -import com.breadwallet.R; -import com.breadwallet.presenter.activities.BreadActivity; - -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -import java.util.concurrent.TimeUnit; - -import static androidx.test.espresso.Espresso.onData; -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.anything; -import static org.hamcrest.Matchers.hasEntry; -import static org.hamcrest.Matchers.hasToString; - -import tools.fastlane.screengrab.Screengrab; -import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy; -import tools.fastlane.screengrab.locale.LocaleTestRule; -import tools.fastlane.screengrab.locale.LocaleUtil; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/31/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -@RunWith(JUnit4.class) -public class JUnit4StyleTests { - @ClassRule - public static final LocaleTestRule localeTestRule = new LocaleTestRule(); - - @Rule - public ActivityTestRule activityRule = new ActivityTestRule<>(BreadActivity.class); - - @BeforeClass - public static void beforeClass() { - IdlingPolicies.setMasterPolicyTimeout(600, TimeUnit.SECONDS); - IdlingPolicies.setIdlingResourceTimeout(600, TimeUnit.SECONDS); - } - - @Before - public void setUp() { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - Screengrab.setDefaultScreenshotStrategy(new UiAutomatorScreenshotStrategy()); - } - activityRule.getActivity(); - LocaleUtil.changeDeviceLocaleTo(LocaleUtil.getTestLocale()); - } - - @After - public void tearDown() { - LocaleUtil.changeDeviceLocaleTo(LocaleUtil.getEndingLocale()); - } - - @Test - public void testTakeScreenshot() { - sleep(1000); - Screengrab.screenshot("transaction_list"); - onView(withId(R.id.menu_layout)).perform(click()); - clickMenu(0); -// sleep(1000); - Screengrab.screenshot("security_center"); - Espresso.pressBack(); - clickMenu(1); - sleep(1000); - Screengrab.screenshot("support"); - Espresso.pressBack(); - clickMenu(3); -// sleep(1000); - Screengrab.screenshot("unlock_screen"); - - } - - private void clickMenu(int pos) { - onData(anything()).inAdapterView(withId(R.id.menu_listview)).atPosition(pos).perform(click()); - } - - private void sleep(int milliseconds) { - try { - Thread.sleep(milliseconds); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/app/src/androidTest/java/com/breadwallet/security/KeyStoreTests.java b/app/src/androidTest/java/com/breadwallet/security/KeyStoreTests.java index b132ceccb..c7a589d99 100644 --- a/app/src/androidTest/java/com/breadwallet/security/KeyStoreTests.java +++ b/app/src/androidTest/java/com/breadwallet/security/KeyStoreTests.java @@ -17,31 +17,6 @@ import static com.breadwallet.tools.security.BRKeyStore.aliasObjectMap; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/20/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ @RunWith(AndroidJUnit4.class) public class KeyStoreTests { public static final String TAG = KeyStoreTests.class.getName(); @@ -180,16 +155,6 @@ public void setGetAuthKey() { Assert.assertArrayEquals(freshGet, freshGet); } - @Test - public void setGetToken() { - byte[] token = "26wZYDdvpmCrYZeUcxgqd1KquN4o6wXwLomBW5SjnwUqG".getBytes(); - BRKeyStore.putToken(token, mActivityRule.getActivity()); - assertFilesExist(BRKeyStore.TOKEN_ALIAS); - byte[] freshGet; - freshGet = BRKeyStore.getToken(mActivityRule.getActivity()); - Assert.assertArrayEquals(freshGet, freshGet); - } - @Test public void setGetWalletCreationTime() { int time = 1479686841; diff --git a/app/src/androidTest/java/com/breadwallet/security/NewKeyStoreTests.java b/app/src/androidTest/java/com/breadwallet/security/NewKeyStoreTests.java index 482003fa0..730c052bb 100644 --- a/app/src/androidTest/java/com/breadwallet/security/NewKeyStoreTests.java +++ b/app/src/androidTest/java/com/breadwallet/security/NewKeyStoreTests.java @@ -17,31 +17,6 @@ import static com.breadwallet.tools.security.BRKeyStore.PHRASE_ALIAS; import static com.breadwallet.tools.security.BRKeyStore.aliasObjectMap; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/20/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ @RunWith(AndroidJUnit4.class) public class NewKeyStoreTests { public static final String TAG = NewKeyStoreTests.class.getName(); diff --git a/app/src/androidTest/java/com/breadwallet/wallet/WalletTests.java b/app/src/androidTest/java/com/breadwallet/wallet/WalletTests.java index 50a2a3d9c..07bbbaab2 100644 --- a/app/src/androidTest/java/com/breadwallet/wallet/WalletTests.java +++ b/app/src/androidTest/java/com/breadwallet/wallet/WalletTests.java @@ -14,31 +14,6 @@ import static org.junit.Assert.assertEquals; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 4/29/16. - * Copyright (c) 2016 breadwallet llc - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class WalletTests { public static final String TAG = WalletTests.class.getName(); diff --git a/app/src/main/java/com/breadwallet/BreadApp.java b/app/src/main/java/com/breadwallet/BreadApp.java index ad8688c4d..19b2f3424 100644 --- a/app/src/main/java/com/breadwallet/BreadApp.java +++ b/app/src/main/java/com/breadwallet/BreadApp.java @@ -26,31 +26,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/22/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BreadApp extends Application { public static int DISPLAY_HEIGHT_PX; FingerprintManager mFingerprintManager; diff --git a/app/src/main/java/com/breadwallet/exceptions/BRKeystoreErrorException.java b/app/src/main/java/com/breadwallet/exceptions/BRKeystoreErrorException.java index 6d5a18ad8..dee23103f 100644 --- a/app/src/main/java/com/breadwallet/exceptions/BRKeystoreErrorException.java +++ b/app/src/main/java/com/breadwallet/exceptions/BRKeystoreErrorException.java @@ -1,29 +1,5 @@ package com.breadwallet.exceptions; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/20/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRKeystoreErrorException extends Exception { public static final String TAG = BRKeystoreErrorException.class.getName(); diff --git a/app/src/main/java/com/breadwallet/exceptions/CertificateChainNotFound.java b/app/src/main/java/com/breadwallet/exceptions/CertificateChainNotFound.java index f0a3df768..71d96725a 100644 --- a/app/src/main/java/com/breadwallet/exceptions/CertificateChainNotFound.java +++ b/app/src/main/java/com/breadwallet/exceptions/CertificateChainNotFound.java @@ -2,31 +2,6 @@ import java.security.GeneralSecurityException; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/16/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class CertificateChainNotFound extends GeneralSecurityException { public static final String TAG = CertificateChainNotFound.class.getName(); diff --git a/app/src/main/java/com/breadwallet/exceptions/PaymentRequestExpiredException.java b/app/src/main/java/com/breadwallet/exceptions/PaymentRequestExpiredException.java index db879306b..4306d72d0 100644 --- a/app/src/main/java/com/breadwallet/exceptions/PaymentRequestExpiredException.java +++ b/app/src/main/java/com/breadwallet/exceptions/PaymentRequestExpiredException.java @@ -2,31 +2,6 @@ import java.security.GeneralSecurityException; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/16/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class PaymentRequestExpiredException extends GeneralSecurityException { public static final String TAG = PaymentRequestExpiredException.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/activities/BreadActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/BreadActivity.java index a22c49e87..f392a5d84 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/BreadActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/BreadActivity.java @@ -61,31 +61,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 8/4/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BreadActivity extends BRActivity implements BRWalletManager.OnBalanceChanged, BRSharedPrefs.OnIsoChangedListener, TransactionDataSource.OnTxAddedListener, InternetManager.ConnectionReceiverListener { @@ -198,7 +173,7 @@ private void setUrlHandler(Intent intent) { Uri data = intent.getData(); if (data == null) return; String scheme = data.getScheme(); - if (scheme != null && (scheme.startsWith("litecoin") || scheme.startsWith("bitid"))) { + if (scheme != null && scheme.startsWith("litecoin")) { String str = intent.getDataString(); BitcoinUrlHandler.processRequest(this, str); } @@ -342,9 +317,6 @@ protected void onResume() { appVisible = true; app = this; addObservers(); - if (BRConstants.PLATFORM_ON) { - APIClient.getInstance(this).updatePlatform(); - } setupNetworking(); @@ -373,13 +345,7 @@ protected void onPause() { @Override protected void onDestroy() { super.onDestroy(); - unregisterReceiver(mConnectionReceiver); - - //sync the kv stores - if (BRConstants.PLATFORM_ON) { - BRExecutor.getInstance().forBackgroundTasks().execute(() -> APIClient.getInstance(BreadActivity.this).syncKvStore()); - } } private void initializeViews() { diff --git a/app/src/main/java/com/breadwallet/presenter/activities/LoginActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/LoginActivity.java index c252e7bf6..2ffd8c886 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/LoginActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/LoginActivity.java @@ -209,8 +209,6 @@ protected void onResume() { if (!BRWalletManager.getInstance().isCreated()) { BRExecutor.getInstance().forBackgroundTasks().execute(() -> BRWalletManager.getInstance().initWallet(LoginActivity.this)); } - if (PLATFORM_ON) - APIClient.getInstance(this).updatePlatform(); } @Override diff --git a/app/src/main/java/com/breadwallet/presenter/activities/camera/CameraActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/camera/CameraActivity.java index 42d5896c0..16deec487 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/camera/CameraActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/camera/CameraActivity.java @@ -59,31 +59,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/29/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class CameraActivity extends BRActivity implements View.OnClickListener, ActivityCompat.OnRequestPermissionsResultCallback { public static boolean appVisible = false; private static CameraActivity app; diff --git a/app/src/main/java/com/breadwallet/presenter/activities/camera/ScanQRActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/camera/ScanQRActivity.java index 3d8ae39f0..a99097726 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/camera/ScanQRActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/camera/ScanQRActivity.java @@ -22,31 +22,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/29/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class ScanQRActivity extends BRActivity implements ActivityCompat.OnRequestPermissionsResultCallback, QRCodeReaderView.OnQRCodeReadListener { private ImageView cameraGuide; private TextView descriptionText; diff --git a/app/src/main/java/com/breadwallet/presenter/activities/intro/IntroActivity.java b/app/src/main/java/com/breadwallet/presenter/activities/intro/IntroActivity.java index 5d403432d..d09704358 100644 --- a/app/src/main/java/com/breadwallet/presenter/activities/intro/IntroActivity.java +++ b/app/src/main/java/com/breadwallet/presenter/activities/intro/IntroActivity.java @@ -29,32 +29,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 8/4/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class IntroActivity extends BRActivity implements Serializable { public Button newWalletButton; public Button recoverWalletButton; diff --git a/app/src/main/java/com/breadwallet/presenter/customviews/BRButton.java b/app/src/main/java/com/breadwallet/presenter/customviews/BRButton.java index 5568c6e73..203f05ef9 100644 --- a/app/src/main/java/com/breadwallet/presenter/customviews/BRButton.java +++ b/app/src/main/java/com/breadwallet/presenter/customviews/BRButton.java @@ -27,30 +27,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 5/3/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ @SuppressLint("AppCompatCustomView") // we don't need to support older versions public class BRButton extends Button { private static final int ANIMATION_DURATION = 30; diff --git a/app/src/main/java/com/breadwallet/presenter/customviews/BRDialogView.java b/app/src/main/java/com/breadwallet/presenter/customviews/BRDialogView.java index 8fc2ac88e..a4abff5a0 100644 --- a/app/src/main/java/com/breadwallet/presenter/customviews/BRDialogView.java +++ b/app/src/main/java/com/breadwallet/presenter/customviews/BRDialogView.java @@ -23,30 +23,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/15/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRDialogView extends DialogFragment { private static final String TAG = BRDialogView.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/customviews/BRKeyboard.java b/app/src/main/java/com/breadwallet/presenter/customviews/BRKeyboard.java index 919182e3e..21f7438fb 100644 --- a/app/src/main/java/com/breadwallet/presenter/customviews/BRKeyboard.java +++ b/app/src/main/java/com/breadwallet/presenter/customviews/BRKeyboard.java @@ -21,31 +21,6 @@ import java.util.ArrayList; import java.util.List; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 2/22/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRKeyboard extends LinearLayout implements View.OnClickListener { public static final String TAG = BRKeyboard.class.getName(); List listeners = new ArrayList<>(); diff --git a/app/src/main/java/com/breadwallet/presenter/customviews/BRLinearLayoutWithCaret.java b/app/src/main/java/com/breadwallet/presenter/customviews/BRLinearLayoutWithCaret.java index d6c256b31..0bcd69872 100644 --- a/app/src/main/java/com/breadwallet/presenter/customviews/BRLinearLayoutWithCaret.java +++ b/app/src/main/java/com/breadwallet/presenter/customviews/BRLinearLayoutWithCaret.java @@ -12,30 +12,6 @@ import com.breadwallet.R; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 2/24/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRLinearLayoutWithCaret extends LinearLayout { public static final String TAG = BRLinearLayoutWithCaret.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/customviews/BRLockScreenConstraintLayout.java b/app/src/main/java/com/breadwallet/presenter/customviews/BRLockScreenConstraintLayout.java index 5ff4fcd01..a3df2f1a3 100644 --- a/app/src/main/java/com/breadwallet/presenter/customviews/BRLockScreenConstraintLayout.java +++ b/app/src/main/java/com/breadwallet/presenter/customviews/BRLockScreenConstraintLayout.java @@ -11,30 +11,6 @@ import com.breadwallet.R; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 2/24/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRLockScreenConstraintLayout extends ConstraintLayout { public static final String TAG = BRLockScreenConstraintLayout.class.getName(); private int width; diff --git a/app/src/main/java/com/breadwallet/presenter/customviews/BRNotificationBar.java b/app/src/main/java/com/breadwallet/presenter/customviews/BRNotificationBar.java index 895275fff..9817baf3a 100644 --- a/app/src/main/java/com/breadwallet/presenter/customviews/BRNotificationBar.java +++ b/app/src/main/java/com/breadwallet/presenter/customviews/BRNotificationBar.java @@ -11,30 +11,6 @@ import com.breadwallet.presenter.activities.BreadActivity; import com.breadwallet.tools.util.Utils; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 5/8/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRNotificationBar extends androidx.appcompat.widget.Toolbar { public BRNotificationBar(Context context) { diff --git a/app/src/main/java/com/breadwallet/presenter/customviews/BRRelativeLayout.java b/app/src/main/java/com/breadwallet/presenter/customviews/BRRelativeLayout.java index e0a9af349..1be33448d 100644 --- a/app/src/main/java/com/breadwallet/presenter/customviews/BRRelativeLayout.java +++ b/app/src/main/java/com/breadwallet/presenter/customviews/BRRelativeLayout.java @@ -4,30 +4,6 @@ import android.util.AttributeSet; import android.widget.RelativeLayout; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 2/24/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRRelativeLayout extends RelativeLayout { public static final String TAG = BRRelativeLayout.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/customviews/BRToast.java b/app/src/main/java/com/breadwallet/presenter/customviews/BRToast.java index 6ce27665f..c5a3dedc1 100644 --- a/app/src/main/java/com/breadwallet/presenter/customviews/BRToast.java +++ b/app/src/main/java/com/breadwallet/presenter/customviews/BRToast.java @@ -13,30 +13,6 @@ import com.breadwallet.BreadApp; import com.breadwallet.R; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/20/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRToast { private static boolean customToastAvailable = true; private static String oldMessage; diff --git a/app/src/main/java/com/breadwallet/presenter/entities/BRMenuItem.java b/app/src/main/java/com/breadwallet/presenter/entities/BRMenuItem.java index 7ecba97e0..e1a3f9279 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/BRMenuItem.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/BRMenuItem.java @@ -5,30 +5,6 @@ import android.os.Parcelable; import android.view.View; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/13/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRMenuItem { public String text; diff --git a/app/src/main/java/com/breadwallet/presenter/entities/BRMerkleBlockEntity.java b/app/src/main/java/com/breadwallet/presenter/entities/BRMerkleBlockEntity.java index 3efa729d4..7f3c86095 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/BRMerkleBlockEntity.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/BRMerkleBlockEntity.java @@ -1,30 +1,5 @@ package com.breadwallet.presenter.entities; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/25/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRMerkleBlockEntity { private long id; diff --git a/app/src/main/java/com/breadwallet/presenter/entities/BRPeerEntity.java b/app/src/main/java/com/breadwallet/presenter/entities/BRPeerEntity.java index c7e65f976..0b6eb2b03 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/BRPeerEntity.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/BRPeerEntity.java @@ -1,31 +1,5 @@ package com.breadwallet.presenter.entities; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRPeerEntity { private int id; diff --git a/app/src/main/java/com/breadwallet/presenter/entities/BRSecurityCenterItem.java b/app/src/main/java/com/breadwallet/presenter/entities/BRSecurityCenterItem.java index 62101f68c..082c818fb 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/BRSecurityCenterItem.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/BRSecurityCenterItem.java @@ -5,30 +5,6 @@ import static android.R.attr.checkMark; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/13/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRSecurityCenterItem { public String title; diff --git a/app/src/main/java/com/breadwallet/presenter/entities/BRSettingsItem.java b/app/src/main/java/com/breadwallet/presenter/entities/BRSettingsItem.java index 3083f61f4..e55c1f375 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/BRSettingsItem.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/BRSettingsItem.java @@ -2,30 +2,6 @@ import android.view.View; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/13/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRSettingsItem { public boolean isSection; diff --git a/app/src/main/java/com/breadwallet/presenter/entities/BRTransactionEntity.java b/app/src/main/java/com/breadwallet/presenter/entities/BRTransactionEntity.java index 9d8ff3f99..17d132a42 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/BRTransactionEntity.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/BRTransactionEntity.java @@ -1,31 +1,5 @@ package com.breadwallet.presenter.entities; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/23/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRTransactionEntity { private byte[] buff; private int blockheight; diff --git a/app/src/main/java/com/breadwallet/presenter/entities/BlockEntity.java b/app/src/main/java/com/breadwallet/presenter/entities/BlockEntity.java index 8fdb56b7d..552329a53 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/BlockEntity.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/BlockEntity.java @@ -1,31 +1,5 @@ package com.breadwallet.presenter.entities; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 1/13/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BlockEntity { public static final String TAG = BlockEntity.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/entities/CurrencyEntity.java b/app/src/main/java/com/breadwallet/presenter/entities/CurrencyEntity.java index 960b67ff3..f2aec6f68 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/CurrencyEntity.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/CurrencyEntity.java @@ -2,32 +2,6 @@ import java.io.Serializable; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 8/18/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class CurrencyEntity implements Serializable { //Change this after modifying the class diff --git a/app/src/main/java/com/breadwallet/presenter/entities/ImportPrivKeyEntity.java b/app/src/main/java/com/breadwallet/presenter/entities/ImportPrivKeyEntity.java index f40a3e1e8..dc71f8c03 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/ImportPrivKeyEntity.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/ImportPrivKeyEntity.java @@ -1,31 +1,5 @@ package com.breadwallet.presenter.entities; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/2/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class ImportPrivKeyEntity { public static final String TAG = ImportPrivKeyEntity.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/entities/PaymentItem.java b/app/src/main/java/com/breadwallet/presenter/entities/PaymentItem.java index 53695a8e0..12e4c7e64 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/PaymentItem.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/PaymentItem.java @@ -1,30 +1,5 @@ package com.breadwallet.presenter.entities; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/19/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class PaymentItem { public static final String TAG = PaymentItem.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/entities/PaymentRequestWrapper.java b/app/src/main/java/com/breadwallet/presenter/entities/PaymentRequestWrapper.java index 9b50a8bae..0a71875fa 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/PaymentRequestWrapper.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/PaymentRequestWrapper.java @@ -1,31 +1,5 @@ package com.breadwallet.presenter.entities; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/12/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class PaymentRequestWrapper { public final String TAG = PaymentRequestWrapper.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/entities/PeerEntity.java b/app/src/main/java/com/breadwallet/presenter/entities/PeerEntity.java index 1b21fad68..934e2221f 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/PeerEntity.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/PeerEntity.java @@ -1,31 +1,5 @@ package com.breadwallet.presenter.entities; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 1/13/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class PeerEntity { public static final String TAG = PeerEntity.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/entities/RequestObject.java b/app/src/main/java/com/breadwallet/presenter/entities/RequestObject.java index adb74658d..6b49e6e0f 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/RequestObject.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/RequestObject.java @@ -1,31 +1,5 @@ package com.breadwallet.presenter.entities; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/20/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class RequestObject { public static final String TAG = RequestObject.class.getName(); public String address; diff --git a/app/src/main/java/com/breadwallet/presenter/entities/TxItem.java b/app/src/main/java/com/breadwallet/presenter/entities/TxItem.java index 665b57965..ca84b4bfc 100644 --- a/app/src/main/java/com/breadwallet/presenter/entities/TxItem.java +++ b/app/src/main/java/com/breadwallet/presenter/entities/TxItem.java @@ -4,31 +4,6 @@ import com.breadwallet.tools.util.Utils; import com.platform.entities.TxMetaData; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 1/13/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class TxItem { public static final String TAG = TxItem.class.getName(); private long timeStamp; diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentBuy.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentBuy.java index 722ea8de8..86cece867 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentBuy.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentBuy.java @@ -37,31 +37,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentBuy extends Fragment { private static final int FILE_CHOOSER_REQUEST_CODE = 15423; public LinearLayout backgroundLayout; diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentGreetings.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentGreetings.java index fb1190f78..7a5985dc9 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentGreetings.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentGreetings.java @@ -16,31 +16,6 @@ import com.breadwallet.presenter.customviews.BRButton; import com.breadwallet.tools.animation.BRAnimator; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentGreetings extends Fragment { private static final String TAG = FragmentGreetings.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentPhraseWord.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentPhraseWord.java index d57a444b7..4a12d45b2 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentPhraseWord.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentPhraseWord.java @@ -9,39 +9,10 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.TextView; import com.breadwallet.R; -import org.w3c.dom.Text; - - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/14/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentPhraseWord extends Fragment { private static final String TAG = FragmentPhraseWord.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentPin.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentPin.java index 921c33b62..e5ed00c59 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentPin.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentPin.java @@ -28,31 +28,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentPin extends Fragment { private BRAuthCompletion completion; diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentReceive.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentReceive.java index f63b0f44c..4624ac87c 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentReceive.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentReceive.java @@ -35,31 +35,6 @@ import static com.breadwallet.tools.animation.BRAnimator.animateBackgroundDim; import static com.breadwallet.tools.animation.BRAnimator.animateSignalSlide; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentReceive extends Fragment { private static final String TAG = FragmentReceive.class.getName(); diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentRequestAmount.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentRequestAmount.java index d94467a1c..fbf0c9e16 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentRequestAmount.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentRequestAmount.java @@ -6,7 +6,6 @@ import android.os.Handler; import androidx.annotation.Nullable; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSignal.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSignal.java index bc924ffee..1f15e8142 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSignal.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentSignal.java @@ -13,32 +13,6 @@ import com.breadwallet.R; import com.breadwallet.presenter.interfaces.BROnSignalCompletion; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentSignal extends Fragment { public static final String TITLE = "title"; public static final String ICON_DESCRIPTION = "iconDescription"; diff --git a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentTransactionDetails.java b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentTransactionDetails.java index 52639c1ef..07d61591d 100644 --- a/app/src/main/java/com/breadwallet/presenter/fragments/FragmentTransactionDetails.java +++ b/app/src/main/java/com/breadwallet/presenter/fragments/FragmentTransactionDetails.java @@ -23,32 +23,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/29/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class FragmentTransactionDetails extends Fragment { public TextView mTitle; diff --git a/app/src/main/java/com/breadwallet/presenter/interfaces/BRAuthCompletion.java b/app/src/main/java/com/breadwallet/presenter/interfaces/BRAuthCompletion.java index 601300f40..387c85dc8 100644 --- a/app/src/main/java/com/breadwallet/presenter/interfaces/BRAuthCompletion.java +++ b/app/src/main/java/com/breadwallet/presenter/interfaces/BRAuthCompletion.java @@ -1,29 +1,5 @@ package com.breadwallet.presenter.interfaces; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/15/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public interface BRAuthCompletion { void onComplete(); void onCancel(); diff --git a/app/src/main/java/com/breadwallet/presenter/interfaces/BROnSignalCompletion.java b/app/src/main/java/com/breadwallet/presenter/interfaces/BROnSignalCompletion.java index 9f90ab78a..43f614a48 100644 --- a/app/src/main/java/com/breadwallet/presenter/interfaces/BROnSignalCompletion.java +++ b/app/src/main/java/com/breadwallet/presenter/interfaces/BROnSignalCompletion.java @@ -1,29 +1,5 @@ package com.breadwallet.presenter.interfaces; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/31/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public interface BROnSignalCompletion { void onComplete(); } diff --git a/app/src/main/java/com/breadwallet/presenter/interfaces/BreadPayment.java b/app/src/main/java/com/breadwallet/presenter/interfaces/BreadPayment.java index a1a0815e3..b1d8aed42 100644 --- a/app/src/main/java/com/breadwallet/presenter/interfaces/BreadPayment.java +++ b/app/src/main/java/com/breadwallet/presenter/interfaces/BreadPayment.java @@ -1,29 +1,5 @@ package com.breadwallet.presenter.interfaces; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/24/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public interface BreadPayment { } diff --git a/app/src/main/java/com/breadwallet/tools/adapter/CurAdapter.java b/app/src/main/java/com/breadwallet/tools/adapter/CurAdapter.java index a7ffe36cd..444c0b09d 100644 --- a/app/src/main/java/com/breadwallet/tools/adapter/CurAdapter.java +++ b/app/src/main/java/com/breadwallet/tools/adapter/CurAdapter.java @@ -16,32 +16,6 @@ import static android.widget.Adapter.IGNORE_ITEM_VIEW_TYPE; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/27/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class CurAdapter extends RecyclerView.Adapter { public static final String TAG = CurAdapter.class.getName(); diff --git a/app/src/main/java/com/breadwallet/tools/adapter/TransactionListAdapter.java b/app/src/main/java/com/breadwallet/tools/adapter/TransactionListAdapter.java index 404e50a89..128659531 100644 --- a/app/src/main/java/com/breadwallet/tools/adapter/TransactionListAdapter.java +++ b/app/src/main/java/com/breadwallet/tools/adapter/TransactionListAdapter.java @@ -36,32 +36,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/27/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class TransactionListAdapter extends RecyclerView.Adapter { private final Context mContext; private final int txResId; diff --git a/app/src/main/java/com/breadwallet/tools/adapter/TransactionPagerAdapter.java b/app/src/main/java/com/breadwallet/tools/adapter/TransactionPagerAdapter.java index af81beaf2..e38b8087c 100644 --- a/app/src/main/java/com/breadwallet/tools/adapter/TransactionPagerAdapter.java +++ b/app/src/main/java/com/breadwallet/tools/adapter/TransactionPagerAdapter.java @@ -9,30 +9,6 @@ import java.util.List; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 4/11/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class TransactionPagerAdapter extends FragmentPagerAdapter { private static final String TAG = TransactionPagerAdapter.class.getName(); private List items; diff --git a/app/src/main/java/com/breadwallet/tools/animation/BRAnimator.java b/app/src/main/java/com/breadwallet/tools/animation/BRAnimator.java index 142751566..9263197c5 100644 --- a/app/src/main/java/com/breadwallet/tools/animation/BRAnimator.java +++ b/app/src/main/java/com/breadwallet/tools/animation/BRAnimator.java @@ -49,32 +49,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/13/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRAnimator { private static FragmentSignal fragmentSignal; private static boolean clickAllowed = true; diff --git a/app/src/main/java/com/breadwallet/tools/animation/BRDialog.java b/app/src/main/java/com/breadwallet/tools/animation/BRDialog.java index 2f2da4a49..da8699fec 100644 --- a/app/src/main/java/com/breadwallet/tools/animation/BRDialog.java +++ b/app/src/main/java/com/breadwallet/tools/animation/BRDialog.java @@ -12,30 +12,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/15/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRDialog { private static BRDialogView dialog; diff --git a/app/src/main/java/com/breadwallet/tools/animation/DecelerateOvershootInterpolator.java b/app/src/main/java/com/breadwallet/tools/animation/DecelerateOvershootInterpolator.java index aa6c5966f..207ed78ea 100644 --- a/app/src/main/java/com/breadwallet/tools/animation/DecelerateOvershootInterpolator.java +++ b/app/src/main/java/com/breadwallet/tools/animation/DecelerateOvershootInterpolator.java @@ -4,31 +4,6 @@ import android.view.animation.Interpolator; import android.view.animation.OvershootInterpolator; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/19/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class DecelerateOvershootInterpolator implements Interpolator { private DecelerateInterpolator accelerate; private OvershootInterpolator overshoot; diff --git a/app/src/main/java/com/breadwallet/tools/animation/SlideDetector.java b/app/src/main/java/com/breadwallet/tools/animation/SlideDetector.java index 09dd6d31e..a6588496a 100644 --- a/app/src/main/java/com/breadwallet/tools/animation/SlideDetector.java +++ b/app/src/main/java/com/breadwallet/tools/animation/SlideDetector.java @@ -10,31 +10,6 @@ import android.view.ViewTreeObserver; import android.view.animation.OvershootInterpolator; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 5/9/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class SlideDetector implements View.OnTouchListener { private static final String TAG = SlideDetector.class.getName(); diff --git a/app/src/main/java/com/breadwallet/tools/animation/SpringAnimator.java b/app/src/main/java/com/breadwallet/tools/animation/SpringAnimator.java index 598b789dd..01762b9ed 100644 --- a/app/src/main/java/com/breadwallet/tools/animation/SpringAnimator.java +++ b/app/src/main/java/com/breadwallet/tools/animation/SpringAnimator.java @@ -8,31 +8,6 @@ import com.breadwallet.R; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/24/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class SpringAnimator { public static void showExpandCameraGuide(final View view) { diff --git a/app/src/main/java/com/breadwallet/tools/crypto/Base58.java b/app/src/main/java/com/breadwallet/tools/crypto/Base58.java index 6de5c840a..245d37044 100644 --- a/app/src/main/java/com/breadwallet/tools/crypto/Base58.java +++ b/app/src/main/java/com/breadwallet/tools/crypto/Base58.java @@ -1,29 +1,5 @@ package com.breadwallet.tools.crypto; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/28/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class Base58 { private static final char[] ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" diff --git a/app/src/main/java/com/breadwallet/tools/crypto/CryptoHelper.java b/app/src/main/java/com/breadwallet/tools/crypto/CryptoHelper.java index 95e203ba4..ac4be591c 100644 --- a/app/src/main/java/com/breadwallet/tools/crypto/CryptoHelper.java +++ b/app/src/main/java/com/breadwallet/tools/crypto/CryptoHelper.java @@ -5,31 +5,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/28/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class CryptoHelper { public static final String TAG = CryptoHelper.class.getName(); diff --git a/app/src/main/java/com/breadwallet/tools/listeners/RecyclerItemClickListener.java b/app/src/main/java/com/breadwallet/tools/listeners/RecyclerItemClickListener.java index 9cbbe7b23..8a65b5820 100644 --- a/app/src/main/java/com/breadwallet/tools/listeners/RecyclerItemClickListener.java +++ b/app/src/main/java/com/breadwallet/tools/listeners/RecyclerItemClickListener.java @@ -6,30 +6,6 @@ import android.view.MotionEvent; import android.view.View; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/27/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener { private OnItemClickListener mListener; diff --git a/app/src/main/java/com/breadwallet/tools/listeners/SyncReceiver.java b/app/src/main/java/com/breadwallet/tools/listeners/SyncReceiver.java index bef155718..fa0380bea 100644 --- a/app/src/main/java/com/breadwallet/tools/listeners/SyncReceiver.java +++ b/app/src/main/java/com/breadwallet/tools/listeners/SyncReceiver.java @@ -8,30 +8,6 @@ import com.breadwallet.tools.util.BRConstants; import com.breadwallet.wallet.BRWalletManager; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/19/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class SyncReceiver extends IntentService { public final String TAG = SyncReceiver.class.getSimpleName(); public final static String SYNC_RECEIVER = "SYNC_RECEIVER"; diff --git a/app/src/main/java/com/breadwallet/tools/manager/BRApiManager.java b/app/src/main/java/com/breadwallet/tools/manager/BRApiManager.java index 3eaeda384..8633e9f01 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/BRApiManager.java +++ b/app/src/main/java/com/breadwallet/tools/manager/BRApiManager.java @@ -32,31 +32,6 @@ import okhttp3.Response; import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/22/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRApiManager { private static BRApiManager instance; private Timer timer; @@ -155,9 +130,8 @@ public void stopTimerTask() { } } - public static JSONArray fetchRates(Activity activity) { - String jsonString = urlGET(activity, "https://api.loshan.co.uk/api/v1/rates"); + String jsonString = createGETRequestURL(activity, "https://api.loshan.co.uk/api/v1/rates"); JSONArray jsonArray = null; if (jsonString == null) return null; try { @@ -169,7 +143,7 @@ public static JSONArray fetchRates(Activity activity) { } public static JSONArray backupFetchRates(Activity activity) { - String jsonString = urlGET(activity, "https://api.loafwallet.org/api/v1/rates"); + String jsonString = createGETRequestURL(activity, "https://api.loafwallet.org/api/v1/rates"); JSONArray jsonArray = null; if (jsonString == null) return null; @@ -183,7 +157,7 @@ public static JSONArray backupFetchRates(Activity activity) { } public static void updateFeePerKb(Context app) { - String jsonString = urlGET(app, "https://api.loafwallet.org/fee-per-kb"); + String jsonString = createGETRequestURL(app, "https://api.loafwallet.org/fee-per-kb"); if (jsonString == null || jsonString.isEmpty()) { Timber.i("updateFeePerKb: failed to update fee, response string: %s", jsonString); return; @@ -201,7 +175,9 @@ public static void updateFeePerKb(Context app) { } } - private static String urlGET(Context app, String myURL) { + // createGETRequestURL + // Creates the params and headers to make a GET Request + private static String createGETRequestURL(Context app, String myURL) { Request request = new Request.Builder() .url(myURL) .header("Content-Type", "application/json") diff --git a/app/src/main/java/com/breadwallet/tools/manager/BRClipboardManager.java b/app/src/main/java/com/breadwallet/tools/manager/BRClipboardManager.java index 8775f516b..294a35d3d 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/BRClipboardManager.java +++ b/app/src/main/java/com/breadwallet/tools/manager/BRClipboardManager.java @@ -9,31 +9,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/14/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRClipboardManager { @SuppressLint("NewApi") diff --git a/app/src/main/java/com/breadwallet/tools/manager/BREventManager.java b/app/src/main/java/com/breadwallet/tools/manager/BREventManager.java index eb7b2ab71..9753df58b 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/BREventManager.java +++ b/app/src/main/java/com/breadwallet/tools/manager/BREventManager.java @@ -29,30 +29,6 @@ import static com.platform.APIClient.BASE_URL; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 8/3/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BREventManager implements BreadApp.OnAppBackgrounded { private static BREventManager instance; private String sessionId; diff --git a/app/src/main/java/com/breadwallet/tools/manager/BRNotificationManager.java b/app/src/main/java/com/breadwallet/tools/manager/BRNotificationManager.java index f50bf6328..baff71ccd 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/BRNotificationManager.java +++ b/app/src/main/java/com/breadwallet/tools/manager/BRNotificationManager.java @@ -9,32 +9,6 @@ import com.breadwallet.presenter.activities.BreadActivity; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/28/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRNotificationManager { public static final String TAG = BRNotificationManager.class.getName(); diff --git a/app/src/main/java/com/breadwallet/tools/manager/BRSharedPrefs.java b/app/src/main/java/com/breadwallet/tools/manager/BRSharedPrefs.java index ab01268bb..f17025f38 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/BRSharedPrefs.java +++ b/app/src/main/java/com/breadwallet/tools/manager/BRSharedPrefs.java @@ -17,31 +17,6 @@ import static com.breadwallet.tools.util.BRConstants.GEO_PERMISSIONS_REQUESTED; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/13/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRSharedPrefs { private static final List isoChangedListeners = new ArrayList<>(); @@ -412,18 +387,6 @@ public static void putShareDataDismissed(Context context, boolean dismissed) { editor.apply(); } - public static String getBCHTxId(Context context) { - SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); - return prefs.getString("bchTxId", ""); - } - - public static void putBCHTxId(Context context, String txId) { - SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); - SharedPreferences.Editor editor = prefs.edit(); - editor.putString("bchTxId", txId); - editor.apply(); - } - public static String getTrustNode(Context context) { SharedPreferences prefs = context.getSharedPreferences(BRConstants.PREFS_NAME, Context.MODE_PRIVATE); return prefs.getString("trustNode", ""); diff --git a/app/src/main/java/com/breadwallet/tools/manager/InternetManager.java b/app/src/main/java/com/breadwallet/tools/manager/InternetManager.java index e86024cf1..f601048ee 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/InternetManager.java +++ b/app/src/main/java/com/breadwallet/tools/manager/InternetManager.java @@ -13,32 +13,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/14/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class InternetManager extends BroadcastReceiver { public static List connectionReceiverListeners; diff --git a/app/src/main/java/com/breadwallet/tools/manager/PromptManager.java b/app/src/main/java/com/breadwallet/tools/manager/PromptManager.java index d9e977e9d..763876d26 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/PromptManager.java +++ b/app/src/main/java/com/breadwallet/tools/manager/PromptManager.java @@ -21,30 +21,6 @@ import static com.breadwallet.tools.manager.PromptManager.PromptItem.SHARE_DATA; import static com.breadwallet.tools.manager.PromptManager.PromptItem.UPGRADE_PIN; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/18/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class PromptManager { private PromptManager() { diff --git a/app/src/main/java/com/breadwallet/tools/manager/SyncManager.java b/app/src/main/java/com/breadwallet/tools/manager/SyncManager.java index 37a5433ad..71c1d2167 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/SyncManager.java +++ b/app/src/main/java/com/breadwallet/tools/manager/SyncManager.java @@ -14,30 +14,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/19/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class SyncManager { private static SyncManager instance; private static final long SYNC_PERIOD = TimeUnit.HOURS.toMillis(24); diff --git a/app/src/main/java/com/breadwallet/tools/manager/TxManager.java b/app/src/main/java/com/breadwallet/tools/manager/TxManager.java index 09d2f44a6..f7a1ddb1c 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/TxManager.java +++ b/app/src/main/java/com/breadwallet/tools/manager/TxManager.java @@ -29,31 +29,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/19/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class TxManager { private static TxManager instance; diff --git a/app/src/main/java/com/breadwallet/tools/qrcode/QRUtils.java b/app/src/main/java/com/breadwallet/tools/qrcode/QRUtils.java index 7389f13d2..ad84bfba5 100644 --- a/app/src/main/java/com/breadwallet/tools/qrcode/QRUtils.java +++ b/app/src/main/java/com/breadwallet/tools/qrcode/QRUtils.java @@ -30,30 +30,6 @@ import static android.graphics.Color.BLACK; import static android.graphics.Color.WHITE; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/10/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class QRUtils { public static Bitmap encodeAsBitmap(String content, int dimension) { diff --git a/app/src/main/java/com/breadwallet/tools/security/AuthManager.java b/app/src/main/java/com/breadwallet/tools/security/AuthManager.java index aabaa0601..15c9a3886 100644 --- a/app/src/main/java/com/breadwallet/tools/security/AuthManager.java +++ b/app/src/main/java/com/breadwallet/tools/security/AuthManager.java @@ -26,31 +26,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 8/20/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class AuthManager { private static AuthManager instance; private String previousTry; diff --git a/app/src/main/java/com/breadwallet/tools/security/BRErrorPipe.java b/app/src/main/java/com/breadwallet/tools/security/BRErrorPipe.java deleted file mode 100644 index f2bfa2f57..000000000 --- a/app/src/main/java/com/breadwallet/tools/security/BRErrorPipe.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.breadwallet.tools.security; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/31/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class BRErrorPipe { - - private static final String TAG = BRErrorPipe.class.getName(); - - private static android.app.AlertDialog dialog; - -// public static void parseKeyStoreError(final Context context, Exception e, String alias, boolean report) { -// if (e instanceof KeyPermanentlyInvalidatedException) { -// BRErrorPipe.showKeyStoreDialog(context, context.getString(R.string.Alert_keystore_title_android) + ": " + alias, context.getString(R.string.Alert_keystore_invalidated_android), context.getString(R.string.Button_ok), null, -// new DialogInterface.OnClickListener() { -// public void onClick(DialogInterface dialog, int which) { -// dialog.cancel(); -// } -// }, null, new DialogInterface.OnDismissListener() { -// @Override -// public void onDismiss(DialogInterface dialogInterface) { -// if (context instanceof Activity) { -// if (!BRAnimator.isClickAllowed()) return; -// Intent intent = new Intent(context, RecoverActivity.class); -// context.startActivity(intent); -// ((Activity) context).overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left); -// BRSharedPrefs.putGreetingsShown(context, true); -// -// } -// } -// }); -// report = false; -// } else if (e instanceof InvalidKeyException) { -// showKeyStoreDialog(context, context.getString(R.string.Alert_keystore_title_android), "Failed to load KeyStore(" + alias + "). Please try again later or enter your phrase to recover your Bread now.", context.getString(R.string.AccessibilityLabels_close), null, -// null, new DialogInterface.OnClickListener() { -// public void onClick(DialogInterface dialog, int which) { -// ((Activity) context).finish(); -// } -// }, -// null); -// } else { -// showKeyStoreDialog(context, -// context.getString(R.string.Alert_keystore_title_android), -// "Failed to load KeyStore:\n" + e.getClass().getSimpleName() + "\n" + e.getMessage(), -// context.getString(R.string.AccessibilityLabels_close), null, -// new DialogInterface.OnClickListener() { -// @Override -// public void onClick(DialogInterface dialog, int which) { -// dialog.dismiss(); -// ((Activity) context).finish(); -// } -// }, -// null, -// new DialogInterface.OnDismissListener() { -// @Override -// public void onDismiss(DialogInterface dialog) { -// ((Activity) context).finish(); -// } -// }); -// } -// if (report) { -// BRReportsManager.reportBug(e); -// } -// } -// -// public static void parseError(final Context context, String message, Exception ex, final boolean critical) { -// BRReportsManager.reportBug(ex); -// showKeyStoreDialog(context, -// "Internal error:", -// message, -// context.getString(R.string.AccessibilityLabels_close), null, -// new DialogInterface.OnClickListener() { -// @Override -// public void onClick(DialogInterface dialog, int which) { -// dialog.dismiss(); -// if (critical) -// ((Activity) context).finish(); -// } -// }, -// null, -// new DialogInterface.OnDismissListener() { -// @Override -// public void onDismiss(DialogInterface dialog) { -// if (critical) -// ((Activity) context).finish(); -// } -// }); -// } -// -// public static void showKeyStoreDialog(Context context, final String title, final String message, final String posButton, final String negButton, -// final DialogInterface.OnClickListener posButtonListener, -// final DialogInterface.OnClickListener negButtonListener, -// final DialogInterface.OnDismissListener dismissListener) { -// Activity app = (Activity) context; -// if (app == null) app = (Activity) BreadApp.getBreadContext(); -// if (app == null) { -// Log.e(TAG, "showKeyStoreDialog: app is null"); -// return; -// } -// final Activity finalApp = app; -// if (finalApp != null) -// finalApp.runOnUiThread(new Runnable() { -// @Override -// public void run() { -// if (finalApp != null) { -// if (dialog != null && dialog.isShowing()) { -// if (dialog.getOwnerActivity() != null && !dialog.getOwnerActivity().isDestroyed()) -// dialog.dismiss(); -// else -// return; -// } -// if (!finalApp.isDestroyed()) -// dialog = new android.app.AlertDialog.Builder(finalApp). -// setTitle(title) -// .setMessage(message) -// .setPositiveButton(posButton, posButtonListener) -// .setNegativeButton(negButton, negButtonListener) -// .setOnDismissListener(dismissListener) -// .setIcon(android.R.drawable.ic_dialog_alert) -// .show(); -// } -// } -// }); -// } -} diff --git a/app/src/main/java/com/breadwallet/tools/security/BRSender.java b/app/src/main/java/com/breadwallet/tools/security/BRSender.java index 67db1144b..7b17ac96f 100644 --- a/app/src/main/java/com/breadwallet/tools/security/BRSender.java +++ b/app/src/main/java/com/breadwallet/tools/security/BRSender.java @@ -23,30 +23,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 4/25/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRSender { private static BRSender instance; private final static long FEE_EXPIRATION_MILLIS = 72 * 60 * 60 * 1000L; diff --git a/app/src/main/java/com/breadwallet/tools/security/BitcoinUrlHandler.java b/app/src/main/java/com/breadwallet/tools/security/BitcoinUrlHandler.java index a7282ee55..e68223bdb 100644 --- a/app/src/main/java/com/breadwallet/tools/security/BitcoinUrlHandler.java +++ b/app/src/main/java/com/breadwallet/tools/security/BitcoinUrlHandler.java @@ -23,32 +23,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/19/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BitcoinUrlHandler { private static final Object lockObject = new Object(); diff --git a/app/src/main/java/com/breadwallet/tools/security/PostAuth.java b/app/src/main/java/com/breadwallet/tools/security/PostAuth.java index c08cf3f4a..d6586bfff 100644 --- a/app/src/main/java/com/breadwallet/tools/security/PostAuth.java +++ b/app/src/main/java/com/breadwallet/tools/security/PostAuth.java @@ -37,31 +37,6 @@ import okhttp3.Response; import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 4/14/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class PostAuth { private String phraseForKeyStore; public PaymentItem paymentItem; @@ -233,99 +208,6 @@ public void onPublishTxAuth(final Context app, boolean authAsked) { } } - public void onSendBch(final Activity app, boolean authAsked, String bchAddress) { - byte[] phrase; - try { - phrase = BRKeyStore.getPhrase(app, BRConstants.SEND_BCH_REQUEST); - } catch (UserNotAuthenticatedException e) { - if (authAsked) { - Timber.d("%s: WARNING!!!! LOOP", new Object() { - }.getClass().getEnclosingMethod().getName()); - isStuckWithAuthLoop = true; - } - return; - } - if (Utils.isNullOrEmpty(phrase)) { - Timber.e(new RuntimeException("phrase is malformed: " + (phrase == null ? null : phrase.length))); - return; - } - - byte[] nullTerminatedPhrase = TypesConverter.getNullTerminatedPhrase(phrase); - final byte[] serializedTx = BRWalletManager.sweepBCash(BRKeyStore.getMasterPublicKey(app), bchAddress, nullTerminatedPhrase); - assert (serializedTx != null); - if (serializedTx == null) { - Timber.d("onSendBch:serializedTx is null"); - BRDialog.showCustomDialog(app, app.getString(R.string.Alert_error), app.getString(R.string.BCH_genericError), app.getString(R.string.AccessibilityLabels_close), null, - new BRDialogView.BROnClickListener() { - @Override - public void onClick(BRDialogView brDialogView) { - brDialogView.dismissWithAnimation(); - } - }, null, null, 0); - } else { - Timber.d("onSendBch:serializedTx is:%s", serializedTx.length); - BRExecutor.getInstance().forLightWeightBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - String title = "Failed"; - String message = ""; - String strUtl = "https://" + BreadApp.HOST + "/bch/publish-transaction"; - Timber.d("url: %s", strUtl); - final MediaType type - = MediaType.parse("application/bchdata"); - RequestBody requestBody = RequestBody.create(type, serializedTx); - Request request = new Request.Builder() - .url(strUtl) - .header("Content-Type", "application/bchdata") - .post(requestBody).build(); - Response response = APIClient.getInstance(app).sendRequest(request, true, 0); - boolean success = true; - try { - String responseBody = null; - try { - responseBody = response == null ? null : response.body().string(); - } catch (IOException e) { - Timber.e(e); - } - Timber.d("onSendBch:%s", (response == null ? "resp is null" : response.code() + ":" + response.message())); - - if (response != null) { - title = app.getString(R.string.WipeWallet_failedTitle); - if (response.isSuccessful()) { - title = app.getString(R.string.Import_success); - message = ""; - } else if (response.code() == 503) { - message = app.getString(R.string.BCH_genericError); - } else { - success = false; - message = "(" + response.code() + ")" + "[" + response.message() + "]" + responseBody; - } - } else { - title = app.getString(R.string.Alerts_sendFailure); - message = "Something went wrong"; - } - } finally { - if (response != null) response.close(); - } - - final String finalTitle = title; - final String finalMessage = message; - BRExecutor.getInstance().forMainThreadTasks().execute(new Runnable() { - @Override - public void run() { - BRDialog.showCustomDialog(app, finalTitle, finalMessage, app.getString(R.string.AccessibilityLabels_close), null, new BRDialogView.BROnClickListener() { - @Override - public void onClick(BRDialogView brDialogView) { - brDialogView.dismissWithAnimation(); - } - }, null, null, 0); - } - }); - } - }); - } - } - public void onPaymentProtocolRequest(Activity app, boolean authAsked) { byte[] rawSeed; diff --git a/app/src/main/java/com/breadwallet/tools/security/RootHelper.java b/app/src/main/java/com/breadwallet/tools/security/RootHelper.java index 568741c62..9f4f2e9bf 100644 --- a/app/src/main/java/com/breadwallet/tools/security/RootHelper.java +++ b/app/src/main/java/com/breadwallet/tools/security/RootHelper.java @@ -4,31 +4,6 @@ import java.io.File; import java.io.InputStreamReader; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 5/19/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class RootHelper { public static boolean isDeviceRooted() { return checkRootA() || checkRootB() || checkRootC(); diff --git a/app/src/main/java/com/breadwallet/tools/security/SmartValidator.java b/app/src/main/java/com/breadwallet/tools/security/SmartValidator.java index bf4e8b87c..9b1cf13eb 100644 --- a/app/src/main/java/com/breadwallet/tools/security/SmartValidator.java +++ b/app/src/main/java/com/breadwallet/tools/security/SmartValidator.java @@ -15,30 +15,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/11/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class SmartValidator { private static List list; diff --git a/app/src/main/java/com/breadwallet/tools/security/X509CertificateValidator.java b/app/src/main/java/com/breadwallet/tools/security/X509CertificateValidator.java index 97f4577a1..b4ab8d184 100644 --- a/app/src/main/java/com/breadwallet/tools/security/X509CertificateValidator.java +++ b/app/src/main/java/com/breadwallet/tools/security/X509CertificateValidator.java @@ -27,31 +27,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/11/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class X509CertificateValidator { private static final String TAG = X509CertificateValidator.class.getName(); public static final String PKI_X509_SHA256 = "x509+sha256"; diff --git a/app/src/main/java/com/breadwallet/tools/threads/BRExecutor.java b/app/src/main/java/com/breadwallet/tools/threads/BRExecutor.java index 7b7c9b036..6aeb022af 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/BRExecutor.java +++ b/app/src/main/java/com/breadwallet/tools/threads/BRExecutor.java @@ -11,30 +11,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/25/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ /* * Singleton class for default executor supplier */ diff --git a/app/src/main/java/com/breadwallet/tools/threads/Examples.java b/app/src/main/java/com/breadwallet/tools/threads/Examples.java index 0f0138ced..0409a5d71 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/Examples.java +++ b/app/src/main/java/com/breadwallet/tools/threads/Examples.java @@ -1,29 +1,5 @@ package com.breadwallet.tools.threads; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/25/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class Examples { diff --git a/app/src/main/java/com/breadwallet/tools/threads/ImportPrivKeyTask.java b/app/src/main/java/com/breadwallet/tools/threads/ImportPrivKeyTask.java index 33b7f9c38..7362809fd 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/ImportPrivKeyTask.java +++ b/app/src/main/java/com/breadwallet/tools/threads/ImportPrivKeyTask.java @@ -27,31 +27,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/2/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class ImportPrivKeyTask extends AsyncTask { public static final String TAG = ImportPrivKeyTask.class.getName(); public static String UNSPENT_URL; diff --git a/app/src/main/java/com/breadwallet/tools/threads/MainThreadExecutor.java b/app/src/main/java/com/breadwallet/tools/threads/MainThreadExecutor.java index bcb0998e2..ef30ef0c1 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/MainThreadExecutor.java +++ b/app/src/main/java/com/breadwallet/tools/threads/MainThreadExecutor.java @@ -6,30 +6,6 @@ import java.util.concurrent.Executor; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/25/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class MainThreadExecutor implements Executor { private final Handler handler = new Handler(Looper.getMainLooper()); diff --git a/app/src/main/java/com/breadwallet/tools/threads/PaymentProtocolPostPaymentTask.java b/app/src/main/java/com/breadwallet/tools/threads/PaymentProtocolPostPaymentTask.java index c68ff6e85..8469c615f 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/PaymentProtocolPostPaymentTask.java +++ b/app/src/main/java/com/breadwallet/tools/threads/PaymentProtocolPostPaymentTask.java @@ -25,32 +25,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 5/9/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class PaymentProtocolPostPaymentTask extends AsyncTask { public static final String TITLE = "title"; diff --git a/app/src/main/java/com/breadwallet/tools/threads/PaymentProtocolTask.java b/app/src/main/java/com/breadwallet/tools/threads/PaymentProtocolTask.java index fd4c8a27d..e3789aa35 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/PaymentProtocolTask.java +++ b/app/src/main/java/com/breadwallet/tools/threads/PaymentProtocolTask.java @@ -34,32 +34,6 @@ import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 5/9/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class PaymentProtocolTask extends AsyncTask { HttpURLConnection urlConnection; String certName = null; diff --git a/app/src/main/java/com/breadwallet/tools/threads/Priority.java b/app/src/main/java/com/breadwallet/tools/threads/Priority.java index e3a86b88e..3670234fd 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/Priority.java +++ b/app/src/main/java/com/breadwallet/tools/threads/Priority.java @@ -1,29 +1,5 @@ package com.breadwallet.tools.threads; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/25/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ /** * Priority levels */ diff --git a/app/src/main/java/com/breadwallet/tools/threads/PriorityRunnable.java b/app/src/main/java/com/breadwallet/tools/threads/PriorityRunnable.java index f3b486e08..1c7a8d79c 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/PriorityRunnable.java +++ b/app/src/main/java/com/breadwallet/tools/threads/PriorityRunnable.java @@ -1,29 +1,5 @@ package com.breadwallet.tools.threads; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/25/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class PriorityRunnable implements Runnable { private final Priority priority; diff --git a/app/src/main/java/com/breadwallet/tools/threads/PriorityThreadFactory.java b/app/src/main/java/com/breadwallet/tools/threads/PriorityThreadFactory.java index aed188aca..a236b5eb7 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/PriorityThreadFactory.java +++ b/app/src/main/java/com/breadwallet/tools/threads/PriorityThreadFactory.java @@ -2,30 +2,6 @@ import java.util.concurrent.ThreadFactory; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/25/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class PriorityThreadFactory implements ThreadFactory { private final int mThreadPriority; diff --git a/app/src/main/java/com/breadwallet/tools/threads/PriorityThreadPoolExecutor.java b/app/src/main/java/com/breadwallet/tools/threads/PriorityThreadPoolExecutor.java index a20568a68..c154159c5 100644 --- a/app/src/main/java/com/breadwallet/tools/threads/PriorityThreadPoolExecutor.java +++ b/app/src/main/java/com/breadwallet/tools/threads/PriorityThreadPoolExecutor.java @@ -9,30 +9,6 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/25/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class PriorityThreadPoolExecutor extends ThreadPoolExecutor { public PriorityThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, diff --git a/app/src/main/java/com/breadwallet/tools/util/BRCompressor.java b/app/src/main/java/com/breadwallet/tools/util/BRCompressor.java index ed5134d50..26ac64e8f 100644 --- a/app/src/main/java/com/breadwallet/tools/util/BRCompressor.java +++ b/app/src/main/java/com/breadwallet/tools/util/BRCompressor.java @@ -13,30 +13,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 12/11/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRCompressor { public static final String TAG = BRCompressor.class.getName(); diff --git a/app/src/main/java/com/breadwallet/tools/util/BRConstants.java b/app/src/main/java/com/breadwallet/tools/util/BRConstants.java index 75e845041..91752bf72 100644 --- a/app/src/main/java/com/breadwallet/tools/util/BRConstants.java +++ b/app/src/main/java/com/breadwallet/tools/util/BRConstants.java @@ -10,31 +10,6 @@ import java.lang.annotation.RetentionPolicy; import java.math.RoundingMode; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 2/16/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRConstants { /** @@ -56,7 +31,6 @@ public class BRConstants { public static final int PUT_PHRASE_NEW_WALLET_REQUEST_CODE = 114; public static final int PUT_PHRASE_RECOVERY_WALLET_REQUEST_CODE = 115; public static final int PAYMENT_PROTOCOL_REQUEST_CODE = 116; - public static final int SEND_BCH_REQUEST = 118; public static final int PROVE_PHRASE_REQUEST = 119; /** diff --git a/app/src/main/java/com/breadwallet/tools/util/BRCurrency.java b/app/src/main/java/com/breadwallet/tools/util/BRCurrency.java index 898197fbc..56e54b164 100644 --- a/app/src/main/java/com/breadwallet/tools/util/BRCurrency.java +++ b/app/src/main/java/com/breadwallet/tools/util/BRCurrency.java @@ -13,31 +13,6 @@ import static com.breadwallet.tools.util.BRConstants.CURRENT_UNIT_PHOTONS; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/28/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRCurrency { public static final String TAG = BRCurrency.class.getName(); diff --git a/app/src/main/java/com/breadwallet/tools/util/BRDateUtil.java b/app/src/main/java/com/breadwallet/tools/util/BRDateUtil.java index ee3b649a3..57bd1b322 100644 --- a/app/src/main/java/com/breadwallet/tools/util/BRDateUtil.java +++ b/app/src/main/java/com/breadwallet/tools/util/BRDateUtil.java @@ -7,30 +7,6 @@ import java.util.Date; import java.util.Locale; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/8/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRDateUtil { public static String getCustomSpan(Date date) { diff --git a/app/src/main/java/com/breadwallet/tools/util/BRExchange.java b/app/src/main/java/com/breadwallet/tools/util/BRExchange.java index ce502e9d1..a891083a9 100644 --- a/app/src/main/java/com/breadwallet/tools/util/BRExchange.java +++ b/app/src/main/java/com/breadwallet/tools/util/BRExchange.java @@ -12,30 +12,6 @@ import static com.breadwallet.tools.util.BRConstants.CURRENT_UNIT_PHOTONS; import static com.breadwallet.tools.util.BRConstants.ROUNDING_MODE; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 3/23/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRExchange { public static final long ONE_LITECOIN = 100000000L; diff --git a/app/src/main/java/com/breadwallet/tools/util/Bip39Reader.java b/app/src/main/java/com/breadwallet/tools/util/Bip39Reader.java index bfc7b94d9..c2c51d62b 100644 --- a/app/src/main/java/com/breadwallet/tools/util/Bip39Reader.java +++ b/app/src/main/java/com/breadwallet/tools/util/Bip39Reader.java @@ -13,31 +13,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/28/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class Bip39Reader { private static final String TAG = Bip39Reader.class.getName(); diff --git a/app/src/main/java/com/breadwallet/tools/util/BytesUtil.java b/app/src/main/java/com/breadwallet/tools/util/BytesUtil.java index e8267fc40..dd8979d6b 100644 --- a/app/src/main/java/com/breadwallet/tools/util/BytesUtil.java +++ b/app/src/main/java/com/breadwallet/tools/util/BytesUtil.java @@ -12,31 +12,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/28/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BytesUtil { public static byte[] readBytesFromStream(InputStream in) { diff --git a/app/src/main/java/com/breadwallet/tools/util/CustomLogger.java b/app/src/main/java/com/breadwallet/tools/util/CustomLogger.java index 57fb928ae..e00c9e540 100644 --- a/app/src/main/java/com/breadwallet/tools/util/CustomLogger.java +++ b/app/src/main/java/com/breadwallet/tools/util/CustomLogger.java @@ -2,31 +2,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/17/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class CustomLogger { public static void logThis(String... args) { diff --git a/app/src/main/java/com/breadwallet/tools/util/FileHelper.java b/app/src/main/java/com/breadwallet/tools/util/FileHelper.java index fd2b936fa..260340909 100644 --- a/app/src/main/java/com/breadwallet/tools/util/FileHelper.java +++ b/app/src/main/java/com/breadwallet/tools/util/FileHelper.java @@ -6,30 +6,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/22/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class FileHelper { public static void printDirectoryTree(File folder) { diff --git a/app/src/main/java/com/breadwallet/tools/util/TrustedNode.java b/app/src/main/java/com/breadwallet/tools/util/TrustedNode.java index c71f000f7..dcf75d7d3 100644 --- a/app/src/main/java/com/breadwallet/tools/util/TrustedNode.java +++ b/app/src/main/java/com/breadwallet/tools/util/TrustedNode.java @@ -1,29 +1,5 @@ package com.breadwallet.tools.util; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 7/17/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class TrustedNode { public static String getNodeHost(String input) { if (input.contains(":")) { diff --git a/app/src/main/java/com/breadwallet/tools/util/TypesConverter.java b/app/src/main/java/com/breadwallet/tools/util/TypesConverter.java index 9844e3180..b505a89d4 100644 --- a/app/src/main/java/com/breadwallet/tools/util/TypesConverter.java +++ b/app/src/main/java/com/breadwallet/tools/util/TypesConverter.java @@ -6,31 +6,6 @@ import java.nio.charset.StandardCharsets; import java.util.Arrays; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/28/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class TypesConverter { private TypesConverter() { diff --git a/app/src/main/java/com/breadwallet/tools/util/Utils.java b/app/src/main/java/com/breadwallet/tools/util/Utils.java index c0432f3c1..703a10a8a 100644 --- a/app/src/main/java/com/breadwallet/tools/util/Utils.java +++ b/app/src/main/java/com/breadwallet/tools/util/Utils.java @@ -30,31 +30,6 @@ import static android.content.Context.FINGERPRINT_SERVICE; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/21/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class Utils { public static boolean isUsingCustomInputMethod(Activity context) { diff --git a/app/src/main/java/com/breadwallet/wallet/BRPeerManager.java b/app/src/main/java/com/breadwallet/wallet/BRPeerManager.java index 7aa260e56..27b0a5f95 100644 --- a/app/src/main/java/com/breadwallet/wallet/BRPeerManager.java +++ b/app/src/main/java/com/breadwallet/wallet/BRPeerManager.java @@ -21,31 +21,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 12/10/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRPeerManager { private static BRPeerManager instance; diff --git a/app/src/main/java/com/breadwallet/wallet/BRWalletManager.java b/app/src/main/java/com/breadwallet/wallet/BRWalletManager.java index 1ff266eb4..8a88f3d32 100644 --- a/app/src/main/java/com/breadwallet/wallet/BRWalletManager.java +++ b/app/src/main/java/com/breadwallet/wallet/BRWalletManager.java @@ -65,31 +65,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 12/10/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class BRWalletManager { private static BRWalletManager instance; public List balanceListeners = new ArrayList<>(); @@ -192,7 +167,7 @@ public synchronized boolean generateRandomSeed(final Context ctx) { BRExecutor.getInstance().forLightWeightBackgroundTasks().execute(new Runnable() { @Override public void run() { - KVStoreManager.getInstance().putWalletInfo(ctx, info); //push the creation time to the kv store + //Removed the push to the KeyStore / Server that is refactored out of the Litewallet code } }); diff --git a/app/src/main/java/com/jniwrappers/BRKey.java b/app/src/main/java/com/jniwrappers/BRKey.java index 6321f77d1..543c470e2 100644 --- a/app/src/main/java/com/jniwrappers/BRKey.java +++ b/app/src/main/java/com/jniwrappers/BRKey.java @@ -6,30 +6,6 @@ import java.util.Arrays; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 10/9/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class BRKey { public static final String TAG = BRKey.class.getName(); diff --git a/app/src/main/java/com/platform/APIClient.java b/app/src/main/java/com/platform/APIClient.java index 854f3a695..ccf899805 100644 --- a/app/src/main/java/com/platform/APIClient.java +++ b/app/src/main/java/com/platform/APIClient.java @@ -10,54 +10,23 @@ import com.breadwallet.BreadApp; import com.breadwallet.BuildConfig; import com.breadwallet.presenter.activities.util.ActivityUTILS; -import com.breadwallet.tools.crypto.Base58; -import com.breadwallet.tools.crypto.CryptoHelper; -import com.breadwallet.tools.manager.BRApiManager; -import com.breadwallet.tools.manager.BRSharedPrefs; -import com.breadwallet.tools.security.BRKeyStore; -import com.breadwallet.tools.threads.BRExecutor; import com.breadwallet.tools.util.Utils; -import com.breadwallet.wallet.BRWalletManager; -import com.jniwrappers.BRKey; -import com.platform.kvstore.RemoteKVStore; -import com.platform.kvstore.ReplicatedKVStore; -import org.apache.commons.compress.archivers.ArchiveStreamFactory; -import org.apache.commons.compress.archivers.tar.TarArchiveEntry; -import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; -import org.apache.commons.compress.compressors.CompressorException; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; -import java.util.Date; import java.util.Locale; -import java.util.TimeZone; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import io.sigpipe.jbsdiff.InvalidHeaderException; -import io.sigpipe.jbsdiff.ui.FileUI; -import okhttp3.Interceptor; -import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Protocol; import okhttp3.Request; -import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; -import okio.Buffer; -import okio.BufferedSink; import timber.log.Timber; import static com.breadwallet.tools.util.BRCompressor.gZipExtract; @@ -71,16 +40,11 @@ public class APIClient { public static String BASE_URL = PROTO + "://" + BreadApp.HOST; //feePerKb url private static final String FEE_PER_KB_URL = "/v1/fee-per-kb"; - //token - private static final String TOKEN = "/token"; - //me - private static final String ME = "/me"; //singleton instance private static APIClient ourInstance; private static final String BUNDLES = "bundles"; - public static String BREAD_POINT = "bread-frontend-staging"; //todo make this production private static final String BUNDLES_FOLDER = String.format("/%s", BUNDLES); @@ -101,9 +65,6 @@ public static synchronized APIClient getInstance(Context context) { private APIClient(Context context) { ctx = context; itemsLeftToUpdate = new AtomicInteger(0); - if (0 != (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)) { - BREAD_POINT = "bread-frontend-staging"; - } } //returns the fee per kb or 0 if something went wrong @@ -133,130 +94,15 @@ public long feePerKb() { return 0; } - //only for testing - public Response buyBitcoinMe() { - if (ActivityUTILS.isMainThread()) { - throw new NetworkOnMainThreadException(); - } - if (ctx == null) ctx = BreadApp.getBreadContext(); - if (ctx == null) return null; - String strUtl = BASE_URL + ME; - Request request = new Request.Builder() - .url(strUtl) - .get() - .build(); - String response = null; - Response res = null; - try { - res = sendRequest(request, true, 0); - response = res.body().string(); - if (response.isEmpty()) { - res.close(); - res = sendRequest(request, true, 0); - response = res.body().string(); - } - } catch (IOException e) { - Timber.e(e); - } - - if (response == null) throw new NullPointerException(); - - return res; - } - - public String getToken() { - if (ActivityUTILS.isMainThread()) { - throw new NetworkOnMainThreadException(); - } - if (ctx == null) ctx = BreadApp.getBreadContext(); - if (ctx == null) return null; - try { - String strUtl = BASE_URL + TOKEN; - - String base58PubKey = BRWalletManager.getAuthPublicKeyForAPI(BRKeyStore.getAuthKey(ctx)); - JSONObject requestMessageJSON = new JSONObject(); - requestMessageJSON.put("pubKey", base58PubKey); - requestMessageJSON.put("deviceID", BRSharedPrefs.getDeviceId(ctx)); - - final MediaType JSON - = MediaType.parse("application/json; charset=utf-8"); - RequestBody requestBody = RequestBody.create(JSON, requestMessageJSON.toString()); - Request request = new Request.Builder() - .url(strUtl) - .header("Content-Type", "application/json") - .header("Accept", "application/json") - .post(requestBody).build(); - String strResponse = null; - Response response = null; - try { - response = sendRequest(request, false, 0); - if (response != null) - strResponse = response.body().string(); - } catch (IOException e) { - Timber.e(e); - } finally { - if (response != null) response.close(); - } - if (Utils.isNullOrEmpty(strResponse)) { - Timber.d("getToken: retrieving token failed"); - return null; - } - JSONObject obj = new JSONObject(strResponse); - String token = obj.getString("token"); - BRKeyStore.putToken(token.getBytes(), ctx); - return token; - } catch (JSONException e) { - Timber.e(e); - } - return null; - } - - private String createRequest(String reqMethod, String base58Body, String contentType, String dateHeader, String url) { - return (reqMethod == null ? "" : reqMethod) + "\n" + - (base58Body == null ? "" : base58Body) + "\n" + - (contentType == null ? "" : contentType) + "\n" + - (dateHeader == null ? "" : dateHeader) + "\n" + - (url == null ? "" : url); - } - - public String signRequest(String request) { - Timber.d("signRequest: %s", request); - byte[] doubleSha256 = CryptoHelper.doubleSha256(request.getBytes(StandardCharsets.UTF_8)); - BRKey key; - try { - byte[] authKey; - authKey = BRKeyStore.getAuthKey(ctx); - if (Utils.isNullOrEmpty(authKey)) { - Timber.d("signRequest: authkey is null"); - return null; - } - key = new BRKey(authKey); - } catch (IllegalArgumentException ex) { - key = null; - Timber.e(ex, "signRequest: %s", request); - } - if (key == null) { - Timber.d("signRequest: key is null, failed to create BRKey"); - return null; - } - byte[] signedBytes = key.compactSign(doubleSha256); - return Base58.encode(signedBytes); - } - public Response sendRequest(Request locRequest, boolean needsAuth, int retryCount) { if (retryCount > 1) throw new RuntimeException("sendRequest: Warning retryCount is: " + retryCount); if (ActivityUTILS.isMainThread()) { throw new NetworkOnMainThreadException(); } - boolean isTestVersion = BREAD_POINT.contains("staging"); boolean isTestNet = BuildConfig.LITECOIN_TESTNET; String lang = getCurrentLocale(ctx); - Request request = locRequest.newBuilder().header("X-Testflight", isTestVersion ? "true" : "false").header("X-Litecoin-Testnet", isTestNet ? "true" : "false").header("Accept-Language", lang).build(); - if (needsAuth) { - request = authenticateRequest(request); - if (request == null) return null; - } + Request request = locRequest.newBuilder().header("X-Litecoin-Testnet", isTestNet ? "true" : "false").header("Accept-Language", lang).build(); Response response; ResponseBody postReqBody; @@ -313,267 +159,14 @@ public Response sendRequest(Request locRequest, boolean needsAuth, int retryCoun } postReqBody = ResponseBody.create(null, data); - if (needsAuth && isBreadChallenge(response)) { - Timber.d("sendRequest: got authentication challenge from API - will attempt to get token"); - getToken(); - if (retryCount < 1) { - response.close(); - sendRequest(request, true, retryCount + 1); - } - } - return response.newBuilder().body(postReqBody).build(); - } - private Request authenticateRequest(Request request) { - Request.Builder modifiedRequest = request.newBuilder(); - String base58Body = ""; - RequestBody body = request.body(); - - try { - if (body != null && body.contentLength() != 0) { - BufferedSink sink = new Buffer(); - try { - body.writeTo(sink); - } catch (IOException e) { - Timber.e(e); - } - byte[] bytes = sink.buffer().readByteArray(); - base58Body = CryptoHelper.base58ofSha256(bytes); - } - } catch (IOException e) { - Timber.e(e); - } - sdf.setTimeZone(TimeZone.getTimeZone("GMT")); - String httpDate = sdf.format(new Date()); - - request = modifiedRequest.header("Date", httpDate.substring(0, httpDate.length() - 6)).build(); - - String queryString = request.url().encodedQuery(); - - String requestString = createRequest(request.method(), base58Body, - request.header("Content-Type"), request.header("Date"), request.url().encodedPath() - + ((queryString != null && !queryString.isEmpty()) ? ("?" + queryString) : "")); - String signedRequest = signRequest(requestString); - if (signedRequest == null) return null; - byte[] tokenBytes = BRKeyStore.getToken(ctx); - String token = tokenBytes == null ? "" : new String(tokenBytes); - if (token.isEmpty()) token = getToken(); - if (token == null || token.isEmpty()) { - Timber.i("sendRequest: failed to retrieve token"); - return null; - } - String authValue = "bread " + token + ":" + signedRequest; - modifiedRequest = request.newBuilder(); - - try { - request = modifiedRequest.header("Authorization", authValue).build(); - } catch (Exception e) { - Timber.e(e); - return null; - } - return request; - } - - public String getLatestVersion() { - if (ActivityUTILS.isMainThread()) { - throw new NetworkOnMainThreadException(); - } - String latestVersion = null; - Response response = null; - String respBody = null; - try { - response = sendRequest(new Request.Builder() - .get() - .url(String.format("%s/assets/bundles/%s/versions", BASE_URL, BREAD_POINT)) - .build(), false, 0); - } finally { - if (response != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - Timber.e(e); - } - response.close(); - } - } - - if (respBody == null) return null; - try { - JSONObject versionsJson = new JSONObject(respBody); - JSONArray jsonArray = versionsJson.getJSONArray("versions"); - if (jsonArray.length() == 0) return null; - latestVersion = (String) jsonArray.get(jsonArray.length() - 1); - - } catch (JSONException e) { - Timber.e(e); - } - return latestVersion; - } - - public void downloadDiff(String currentTarVersion) { - if (ActivityUTILS.isMainThread()) { - throw new NetworkOnMainThreadException(); - } - Request diffRequest = new Request.Builder() - .url(String.format("%s/assets/bundles/%s/diff/%s", BASE_URL, BREAD_POINT, currentTarVersion)) - .get().build(); - Response diffResponse = sendRequest(diffRequest, false, 0); - File patchFile = null; - File tempFile = null; - byte[] patchBytes = null; - try { - patchFile = new File(getBundleResource(ctx, BREAD_POINT + "-patch.diff")); - patchBytes = diffResponse.body().bytes(); - Timber.d("downloadDiff: trying to write to file"); - FileUtils.writeByteArrayToFile(patchFile, patchBytes); - tempFile = new File(getBundleResource(ctx, BREAD_POINT + "-2temp.tar")); - File bundleFile = new File(getBundleResource(ctx, BREAD_POINT + ".tar")); - FileUI.patch(bundleFile, tempFile, patchFile); - byte[] updatedBundleBytes = IOUtils.toByteArray(new FileInputStream(tempFile)); - if (Utils.isNullOrEmpty(updatedBundleBytes)) - Timber.d("downloadDiff: failed to get bytes from the updatedBundle: %s", tempFile.getAbsolutePath()); - FileUtils.writeByteArrayToFile(bundleFile, updatedBundleBytes); - - } catch (IOException | InvalidHeaderException | CompressorException | NullPointerException e) { - Timber.e(e, "downloadDiff"); - new File(getBundleResource(ctx, BREAD_POINT + ".tar")).delete(); - } finally { - if (patchFile != null) - patchFile.delete(); - if (tempFile != null) - tempFile.delete(); - if (diffResponse != null) diffResponse.close(); - } - - logFiles("downloadDiff", ctx); - } - - public byte[] writeBundleToFile(Response response) { - byte[] bodyBytes; - FileOutputStream fileOutputStream = null; - assert (response != null); - try { - if (response == null) { - Timber.i("writeBundleToFile: WARNING, response is null"); - return null; - } - bodyBytes = response.body().bytes(); - File bundleFile = new File(getBundleResource(ctx, BREAD_POINT + ".tar")); - FileUtils.writeByteArrayToFile(bundleFile, bodyBytes); - return bodyBytes; - } catch (IOException e) { - Timber.e(e); - } finally { - try { - if (fileOutputStream != null) { - fileOutputStream.close(); - } - } catch (IOException e) { - Timber.e(e); - } - } - - return null; - } - - public boolean tryExtractTar() { - Context app = BreadApp.getBreadContext(); - if (app == null) { - Timber.i("tryExtractTar: failed to extract, app is null"); - return false; - } - File bundleFile = new File(getBundleResource(ctx, BREAD_POINT + ".tar")); - boolean result = false; - TarArchiveInputStream debInputStream = null; - try { - final InputStream is = new FileInputStream(bundleFile); - debInputStream = (TarArchiveInputStream) new ArchiveStreamFactory().createArchiveInputStream("tar", is); - TarArchiveEntry entry; - while ((entry = (TarArchiveEntry) debInputStream.getNextEntry()) != null) { - - final String outPutFileName = entry.getName().replace("./", ""); - final File outputFile = new File(getExtractedPath(ctx, null), outPutFileName); - if (!entry.isDirectory()) { - FileUtils.writeByteArrayToFile(outputFile, org.apache.commons.compress.utils.IOUtils.toByteArray(debInputStream)); - } - } - - result = true; - } catch (Exception e) { - Timber.e(e); - } finally { - try { - if (debInputStream != null) - debInputStream.close(); - } catch (IOException e) { - Timber.e(e); - } - } - logFiles("tryExtractTar", ctx); - return result; - - } - - public boolean isBreadChallenge(Response resp) { - String challenge = resp.header("www-authenticate"); - return challenge != null && challenge.startsWith("bread"); + return response.newBuilder().body(postReqBody).build(); } public String buildUrl(String path) { return BASE_URL + path; } - public void updatePlatform() { - if (platformUpdating) { - Timber.i("updatePlatform: platform already Updating!"); - return; - } - platformUpdating = true; - - //update Bundle - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - Thread.currentThread().setName("UpdateBundle"); - final long startTime = System.currentTimeMillis(); - APIClient apiClient = APIClient.getInstance(ctx); - long endTime = System.currentTimeMillis(); - Timber.d("updateBundle %s: DONE in %sms", BREAD_POINT, endTime - startTime); - itemFinished(); - } - }); - - //update feature flags - BRExecutor.getInstance().forLightWeightBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - Timber.e(e); - } - Thread.currentThread().setName("updateFeatureFlag"); - final long startTime = System.currentTimeMillis(); - APIClient apiClient = APIClient.getInstance(ctx); - long endTime = System.currentTimeMillis(); - Timber.d("updateFeatureFlag: DONE in %sms", endTime - startTime); - itemFinished(); - } - }); - - //update fee - BRExecutor.getInstance().forBackgroundTasks().execute(new Runnable() { - @Override - public void run() { - final long startTime = System.currentTimeMillis(); - BRApiManager.updateFeePerKb(ctx); - long endTime = System.currentTimeMillis(); - Timber.d("update fee: DONE in %sms", endTime - startTime); - itemFinished(); - } - }); - } - private void itemFinished() { int items = itemsLeftToUpdate.incrementAndGet(); if (items >= 4) { @@ -583,58 +176,6 @@ private void itemFinished() { } } - public void syncKvStore() { - if (ActivityUTILS.isMainThread()) { - throw new NetworkOnMainThreadException(); - } - final APIClient client = this; - //sync the kv stores - RemoteKVStore remoteKVStore = RemoteKVStore.getInstance(client); - ReplicatedKVStore kvStore = ReplicatedKVStore.getInstance(ctx, remoteKVStore); - kvStore.syncAllKeys(); - } - - //returns the resource at bundles/path, if path is null then the bundle folder - public String getBundleResource(Context app, String path) { - String bundle = app.getFilesDir().getAbsolutePath() + BUNDLES_FOLDER; - if (Utils.isNullOrEmpty(path)) { - return bundle; - } else { - if (!path.startsWith("/")) { - path = "/" + path; - } - return bundle + path; - } - } - - //returns the extracted folder or the path in it - public String getExtractedPath(Context app, String path) { - String extracted = app.getFilesDir().getAbsolutePath(); - if (Utils.isNullOrEmpty(path)) { - return extracted; - } else { - if (!path.startsWith("/")) { - path = "/" + path; - } - return extracted + path; - } - } - - public void logFiles(String tag, Context ctx) { - if (PRINT_FILES) { - Timber.d("logFiles %s : START LOGGING", tag); - String path = getExtractedPath(ctx, null); - - File directory = new File(path); - File[] files = directory.listFiles(); - Timber.d("Path: %s, size: %d", path, files == null ? 0 : files.length); - for (int i = 0; files != null && i < files.length; i++) { - Timber.d("FileName:%s", files[i].getName()); - } - } - } - - @TargetApi(Build.VERSION_CODES.N) public String getCurrentLocale(Context ctx) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { diff --git a/app/src/main/java/com/platform/BRHTTPHelper.java b/app/src/main/java/com/platform/BRHTTPHelper.java deleted file mode 100644 index d92c10dd1..000000000 --- a/app/src/main/java/com/platform/BRHTTPHelper.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.platform; - - -import com.breadwallet.tools.util.Utils; - -import org.apache.commons.io.IOUtils; -import org.eclipse.jetty.server.Request; - -import java.io.IOException; -import java.io.InputStream; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import timber.log.Timber; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 2/16/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -public class BRHTTPHelper { - public static final String TAG = BRHTTPHelper.class.getName(); - - public static boolean handleError(int err, String errMess, Request baseRequest, HttpServletResponse resp) { - try { - baseRequest.setHandled(true); - if (Utils.isNullOrEmpty(errMess)) - resp.sendError(err); - else - resp.sendError(err, errMess); - } catch (IOException e) { - Timber.e(e); - } - return true; - } -// return BRHTTPHelper.handleError(500, "context is null", baseRequest, response); -// return BRHTTPHelper.handleSuccess(200, null, baseRequest, response, null); - - public static boolean handleSuccess(int code, byte[] body, Request baseRequest, HttpServletResponse resp, String contentType) { - try { - resp.setStatus(code); - if (contentType != null && !contentType.isEmpty()) - resp.setContentType(contentType); - if (body != null) - resp.getOutputStream().write(body); - baseRequest.setHandled(true); - } catch (IOException e) { - Timber.e(e); - } - return true; - } - - public static byte[] getBody(HttpServletRequest request) { - if (request == null) return null; - byte[] rawData = null; - try { - InputStream body = request.getInputStream(); - rawData = IOUtils.toByteArray(body); - } catch (IOException e) { - e.printStackTrace(); - } - return rawData; - } -} diff --git a/app/src/main/java/com/platform/entities/TxMetaData.java b/app/src/main/java/com/platform/entities/TxMetaData.java index 8a21cfa79..771a370a9 100644 --- a/app/src/main/java/com/platform/entities/TxMetaData.java +++ b/app/src/main/java/com/platform/entities/TxMetaData.java @@ -1,29 +1,5 @@ package com.platform.entities; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/22/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class TxMetaData { /** diff --git a/app/src/main/java/com/platform/entities/WalletInfo.java b/app/src/main/java/com/platform/entities/WalletInfo.java index 2adb76dca..f2ffdf7d9 100644 --- a/app/src/main/java/com/platform/entities/WalletInfo.java +++ b/app/src/main/java/com/platform/entities/WalletInfo.java @@ -1,41 +1,18 @@ -package com.platform.entities; +package com.platform.entities; -import static android.R.attr.name; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/22/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class WalletInfo { - /**WalletInfo: + // Not certain this is necessary as it is used for the KeyStores + // Which are not able to call and not part of the Litewallet architecture + // To Be Removed + /**WalletInfo Mock: Key: “wallet-info” { “classVersion”: 2, //used for versioning the schema “creationDate”: 123475859, //Unix timestamp - “name”: “My Bread”, + “name”: “My Litecoin”, “currentCurrency”: “USD” } */ @@ -43,5 +20,4 @@ public class WalletInfo { public int classVersion; public int creationDate; public String name; - } diff --git a/app/src/main/java/com/platform/interfaces/KVStoreAdaptor.java b/app/src/main/java/com/platform/interfaces/KVStoreAdaptor.java index e111e3bd7..1aea4a3a2 100644 --- a/app/src/main/java/com/platform/interfaces/KVStoreAdaptor.java +++ b/app/src/main/java/com/platform/interfaces/KVStoreAdaptor.java @@ -2,32 +2,6 @@ import com.platform.kvstore.CompletionObject; -import static android.R.attr.value; - -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/13/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public interface KVStoreAdaptor { public CompletionObject ver(String key); diff --git a/app/src/main/java/com/platform/kvstore/CompletionObject.java b/app/src/main/java/com/platform/kvstore/CompletionObject.java index 9b8d5633d..42cc6f200 100644 --- a/app/src/main/java/com/platform/kvstore/CompletionObject.java +++ b/app/src/main/java/com/platform/kvstore/CompletionObject.java @@ -4,30 +4,6 @@ import java.util.List; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/13/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class CompletionObject { public static final String TAG = CompletionObject.class.getName(); diff --git a/app/src/main/java/com/platform/kvstore/RemoteKVStore.java b/app/src/main/java/com/platform/kvstore/RemoteKVStore.java index 768839c7a..b5ebeda5a 100644 --- a/app/src/main/java/com/platform/kvstore/RemoteKVStore.java +++ b/app/src/main/java/com/platform/kvstore/RemoteKVStore.java @@ -18,31 +18,6 @@ import static android.R.attr.key; import static com.platform.kvstore.CompletionObject.RemoteKVStoreError.unknown; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/13/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class RemoteKVStore implements KVStoreAdaptor { private static RemoteKVStore instance; private APIClient apiClient; diff --git a/app/src/main/java/com/platform/kvstore/ReplicatedKVStore.java b/app/src/main/java/com/platform/kvstore/ReplicatedKVStore.java index a54f34467..28ff6f3db 100644 --- a/app/src/main/java/com/platform/kvstore/ReplicatedKVStore.java +++ b/app/src/main/java/com/platform/kvstore/ReplicatedKVStore.java @@ -1,30 +1,5 @@ package com.platform.kvstore; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 9/25/15. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - import android.content.ContentValues; import android.content.Context; import android.database.Cursor; diff --git a/app/src/main/java/com/platform/sqlite/KVItem.java b/app/src/main/java/com/platform/sqlite/KVItem.java index acd89297e..4594a0afd 100644 --- a/app/src/main/java/com/platform/sqlite/KVItem.java +++ b/app/src/main/java/com/platform/sqlite/KVItem.java @@ -1,35 +1,9 @@ package com.platform.sqlite; - import com.platform.kvstore.CompletionObject; import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 1/13/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - public class KVItem { public long version; public long remoteVersion; diff --git a/app/src/main/java/com/platform/sqlite/PlatformSqliteHelper.java b/app/src/main/java/com/platform/sqlite/PlatformSqliteHelper.java index fe11056b5..834a0d7a9 100644 --- a/app/src/main/java/com/platform/sqlite/PlatformSqliteHelper.java +++ b/app/src/main/java/com/platform/sqlite/PlatformSqliteHelper.java @@ -1,30 +1,5 @@ package com.platform.sqlite; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/8/16. - * Copyright (c) 2016 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; diff --git a/app/src/main/java/com/platform/tools/KVStoreManager.java b/app/src/main/java/com/platform/tools/KVStoreManager.java index 3b0f207a3..153a46feb 100644 --- a/app/src/main/java/com/platform/tools/KVStoreManager.java +++ b/app/src/main/java/com/platform/tools/KVStoreManager.java @@ -23,30 +23,6 @@ import timber.log.Timber; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 6/22/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class KVStoreManager { private static KVStoreManager instance; String walletInfoKey = "wallet-info"; @@ -60,89 +36,8 @@ public static KVStoreManager getInstance() { } public WalletInfo getWalletInfo(Context app) { - WalletInfo result = new WalletInfo(); - RemoteKVStore remoteKVStore = RemoteKVStore.getInstance(APIClient.getInstance(app)); - ReplicatedKVStore kvStore = ReplicatedKVStore.getInstance(app, remoteKVStore); - long ver = kvStore.localVersion(walletInfoKey).version; - CompletionObject obj = kvStore.get(walletInfoKey, ver); - if (obj.kv == null) { - Timber.i("getWalletInfo: value is null for key: %s", obj.key); - return null; - } - - JSONObject json; - - try { - byte[] decompressed = BRCompressor.bz2Extract(obj.kv.value); - if (decompressed == null) { - Timber.i("getWalletInfo: decompressed value is null"); - return null; - } - json = new JSONObject(new String(decompressed)); - } catch (JSONException e) { - Timber.e(e); - return null; - } - - try { - result.classVersion = json.getInt("classVersion"); - result.creationDate = json.getInt("creationDate"); - result.name = json.getString("name"); - Timber.d("getWalletInfo: " + result.creationDate + ", name: " + result.name); - } catch (JSONException e) { - Timber.e(e); - Timber.d("getWalletInfo: FAILED to get json value"); - } - - Timber.d("getWalletInfo: %s", json); - return result; - } - - public void putWalletInfo(Context app, WalletInfo info) { - WalletInfo old = getWalletInfo(app); - if (old == null) old = new WalletInfo(); //create new one if it's null - - //add all the params that we want to change - if (info.classVersion != 0) old.classVersion = info.classVersion; - if (info.creationDate != 0) old.creationDate = info.creationDate; - if (info.name != null) old.name = info.name; - - //sanity check - if (old.classVersion == 0) old.classVersion = 1; - if (old.name != null) old.name = "My Loaf"; - - JSONObject obj = new JSONObject(); - byte[] result; - try { - obj.put("classVersion", old.classVersion); - obj.put("creationDate", old.creationDate); - obj.put("name", old.name); - result = obj.toString().getBytes(); - - } catch (JSONException e) { - Timber.e(e); - return; - } - - if (result.length == 0) { - Timber.d("putWalletInfo: FAILED: result is empty"); - return; - } - byte[] compressed; - try { - compressed = BRCompressor.bz2Compress(result); - } catch (IOException e) { - Timber.e(e); - return; - } - RemoteKVStore remoteKVStore = RemoteKVStore.getInstance(APIClient.getInstance(app)); - ReplicatedKVStore kvStore = ReplicatedKVStore.getInstance(app, remoteKVStore); - long localVer = kvStore.localVersion(walletInfoKey).version; - long removeVer = kvStore.remoteVersion(walletInfoKey); - CompletionObject compObj = kvStore.set(localVer, removeVer, walletInfoKey, compressed, System.currentTimeMillis(), 0); - if (compObj.err != null) { - Timber.d("putWalletInfo: Error setting value for key: " + walletInfoKey + ", err: " + compObj.err); - } + Timber.i("Never initialized always null until WalletInfo struct to be removed"); + return null; } public TxMetaData getTxMetaData(Context app, byte[] txHash) { diff --git a/app/src/main/jni/transition/JNIBIP32Sequence.c b/app/src/main/jni/transition/JNIBIP32Sequence.c index ad134ac56..e5979aba0 100644 --- a/app/src/main/jni/transition/JNIBIP32Sequence.c +++ b/app/src/main/jni/transition/JNIBIP32Sequence.c @@ -1,6 +1,3 @@ -// -// Created by Mihail Gutan on 1/24/17. -// #include #include diff --git a/app/src/main/jni/transition/JNIBIP32Sequence.h b/app/src/main/jni/transition/JNIBIP32Sequence.h index 8af54490e..f115a5792 100644 --- a/app/src/main/jni/transition/JNIBIP32Sequence.h +++ b/app/src/main/jni/transition/JNIBIP32Sequence.h @@ -1,6 +1,3 @@ -// -// Created by Mihail Gutan on 1/24/17. -// #ifndef BREADWALLET_JNIBIP32SEQUENCE_H #define BREADWALLET_JNIBIP32SEQUENCE_H diff --git a/app/src/main/jni/transition/JNIBase58.c b/app/src/main/jni/transition/JNIBase58.c index c13646d31..b1831b7c7 100644 --- a/app/src/main/jni/transition/JNIBase58.c +++ b/app/src/main/jni/transition/JNIBase58.c @@ -1,6 +1,3 @@ -// -// Created by Mihail Gutan on 10/11/16. -// #include #include diff --git a/app/src/main/jni/transition/JNIBase58.h b/app/src/main/jni/transition/JNIBase58.h index 433234622..52e2dd491 100644 --- a/app/src/main/jni/transition/JNIBase58.h +++ b/app/src/main/jni/transition/JNIBase58.h @@ -1,6 +1,3 @@ -// -// Created by Mihail Gutan on 10/11/16. -// #ifndef BREADWALLET_JNIBASE58_H #define BREADWALLET_JNIBASE58_H diff --git a/app/src/main/jni/transition/JNIKey.c b/app/src/main/jni/transition/JNIKey.c index 9fcb91899..9ab13c956 100644 --- a/app/src/main/jni/transition/JNIKey.c +++ b/app/src/main/jni/transition/JNIKey.c @@ -1,6 +1,3 @@ -// -// Created by Mihail Gutan on 10/9/16. -// #include #include diff --git a/app/src/main/jni/transition/JNIKey.h b/app/src/main/jni/transition/JNIKey.h index 2cde379b7..1a1ec207d 100644 --- a/app/src/main/jni/transition/JNIKey.h +++ b/app/src/main/jni/transition/JNIKey.h @@ -1,6 +1,3 @@ -// -// Created by Mihail Gutan on 10/9/16. -// #ifndef BREADWALLET_JNIKEY_H #define BREADWALLET_JNIKEY_H diff --git a/app/src/main/jni/transition/PeerManager.c b/app/src/main/jni/transition/PeerManager.c index 644f0b286..4e085aea0 100644 --- a/app/src/main/jni/transition/PeerManager.c +++ b/app/src/main/jni/transition/PeerManager.c @@ -1,26 +1,3 @@ -// -// PeerManager.c -// -// Created by Mihail Gutan on 12/11/15. -// Copyright (c) 2015 breadwallet LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. #include "PeerManager.h" #include "BRPeer.h" diff --git a/app/src/main/jni/transition/PeerManager.h b/app/src/main/jni/transition/PeerManager.h index 520167917..c2f24d91b 100644 --- a/app/src/main/jni/transition/PeerManager.h +++ b/app/src/main/jni/transition/PeerManager.h @@ -1,26 +1,3 @@ -// -// PeerManager.h -// -// Created by Mihail Gutan on 12/11/15. -// Copyright (c) 2015 breadwallet LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. #include "jni.h" #include "BRInt.h" diff --git a/app/src/main/jni/transition/core.c b/app/src/main/jni/transition/core.c index 24560bf07..e848f01d4 100644 --- a/app/src/main/jni/transition/core.c +++ b/app/src/main/jni/transition/core.c @@ -1,27 +1,3 @@ -// -// core.c -// -// Created by Mihail Gutan on 9/24/2015. -// Copyright (c) 2015 breadwallet LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - #include "core.h" #include "wallet.h" @@ -31,9 +7,6 @@ #include #include "BRPaymentProtocol.h" -// -// Created by Mihail Gutan on 9/24/15. -// const int TEST_REQ = 0; JNIEXPORT jobject JNICALL diff --git a/app/src/main/jni/transition/core.h b/app/src/main/jni/transition/core.h index 1f5f0a768..7471e4d94 100644 --- a/app/src/main/jni/transition/core.h +++ b/app/src/main/jni/transition/core.h @@ -1,26 +1,3 @@ -// -// core.h -// -// Created by Mihail Gutan on 9/24/2015. -// Copyright (c) 2015 breadwallet LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. #include "jni.h" #ifndef BREADWALLET_CORE_H diff --git a/app/src/main/jni/transition/wallet.c b/app/src/main/jni/transition/wallet.c index be3f893f7..e28c83480 100644 --- a/app/src/main/jni/transition/wallet.c +++ b/app/src/main/jni/transition/wallet.c @@ -1,26 +1,3 @@ -// -// wallet.c -// -// Created by Mihail Gutan on 12/4/15. -// Copyright (c) 2015 breadwallet LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. #include "wallet.h" #include "PeerManager.h" diff --git a/app/src/main/jni/transition/wallet.h b/app/src/main/jni/transition/wallet.h index 151109359..2396b74c8 100644 --- a/app/src/main/jni/transition/wallet.h +++ b/app/src/main/jni/transition/wallet.h @@ -1,25 +1,3 @@ -// wallet.h -// -// Created by Mihail Gutan on 12/4/15. -// Copyright (c) 2015 breadwallet LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. #include "jni.h" #include "BRInt.h" diff --git a/app/src/main/res/layout/activity_withdraw_bch.xml b/app/src/main/res/layout/activity_withdraw_bch.xml deleted file mode 100644 index 6d31e35a8..000000000 --- a/app/src/main/res/layout/activity_withdraw_bch.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 88e5fedf1..9be530457 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -66,40 +66,6 @@ Pung ikke klar Kunne ikke hente API-nøgle - - Indtast en BCH destinationsadresse nedenfor. Alle BCH i din wallet ved fork-tidspunktet (%1$s) vil blive afsendt. - - Bekræft afsendelse af %1$s til %2$s - - Bekræftelse - - Din konto indeholder ikke nogle BCH eller du modtog BCH efter fork. - - Transaktions-ID kopieret - - Indtast venligst en adresse - - Betalingsprotokolanmodninger er ikke understøttet for BCH-transaktioner - - BCH blev afsendt uden problemer. - - Tilbagetræk BCH - - BCH transaktions-ID - - Godkend - - %1$s anmoder om godkendelse ved hjælp af din Litecoin-wallet - - Afvis - - Godkendelsesfejl - - Tjek venligst tjenesten. Det kan være nødvendigt at prøve igen. - - Godkendt uden problemer - - BitID godkendelsesanmodning Annuller diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 2df6b0e5e..6248b5c28 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -66,40 +66,6 @@ Wallet nicht bereit API-Token konnte nicht abgerufen werden - - Geben Sie unten eine Ziel-BCH-Adresse ein. Das gesamte BCH Guthaben aus Ihrem Wallet zur Zeit der Aufspaltung (%1$s) wird versendet. - - Senden von %1$s an %2$s bestätigen - - Bestätigung - - Ihr Konto enthält kein BCH oder Sie haben BCH nach dem Fork erhalten. - - Transaktions-ID kopiert - - Bitte geben Sie die Adresse ein - - Zahlungsprotokoll-Anfragen werden bei BCH-Transaktionen nicht unterstützt - - BCH wurde erfolgreich versendet. - - BCH abheben - - BCH-Transaktions-ID - - Bestätigen - - %1$s fordert die Authentifizierung über Ihr Litecoin-Wallet an - - Ablehnen - - Authentifizierungsfehler - - Bitte den Service überprüfen. Es könnte ein erneuter Versuch erforderlich sein. - - Erfolgreich authentifiziert - - BitID-Authentifizierungsanfrage Abbrechen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 512f3c8ae..9178ffafd 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -66,40 +66,6 @@ La cartera no está lista No se puede recuperar el token de API - - Introduce una dirección de destino BCH a continuación. Se enviarán todos los BCH de tu cartera en el momento del fork (%1$s). - - Confirmar enviando %1$s a %2$s - - Confirmación - - Tu cuenta no contiene ningún BCH o recibiste BCH después del fork. - - Se ha copiado el ID de la transacción - - Por favor, introduce una dirección - - No se admiten solicitudes de protocolo de pago en transacciones BCH - - BCH se ha enviado correctamente. - - Retirar BCH - - Identificador de transacción BCH - - Aprobar - - %1$s está solicitando autenticación mediante tu cartera Litecoin - - Denegar - - Error de autenticación - - Consulta con el servicio. Es posible que debas intentarlo de nuevo. - - Autenticado con éxito - - Solicitud de autenticación de BitID Cancelar diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 59d68708c..e3f7a9d4e 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -66,40 +66,6 @@ Le portefeuille n\'est pas prêt Impossible de récupérer le jeton de l\'API - - Entrez une adresse BCH de destination ci-dessous. Tous les BCH dans votre portefeuille au moment où la fourchette (%1$s) seront envoyés. - - Confirmer l\'envoi de %1$s à %2$s - - Confirmation - - Votre compte ne contient aucun BCH ou vous avez reçu le BCH après la fourchette. - - ID de transaction copiée - - Veuillez entrer une adresse - - Les demandes de protocole de paiement ne sont pas prises en charge pour les transactions BCH - - BCH envoyés avec succès. - - Retirer les BCH - - ID de transaction BCH - - Approuver - - %1$s requiert l\'authentification en utilisant le portefeuille Litecoin - - Refuser - - Erreur d\'authentification - - Veuillez vérifier avec le service. Vous pourriez avoir à essayer de nouveau. - - Authentification réussie - - Demande d\'authentification BitID Annuler diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index a213a3559..de2f3465f 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -66,40 +66,6 @@ Dompet belum siap Tidak dapat mengambil token API - - Masukkan alamat BCH tujuan di bawah ini. Semua BCH di dompet Anda pada saat percabangan (%1$s) akan dikirim. - - Konfirmasikan pengiriman %1$s untuk %2$s - - Konfirmasi - - Akun Anda tidak mengandung BCH, atau Anda menerima BCH setelah percabangan. - - ID Transaksi disalin - - Harap masukkan alamat - - Permintaan Protokol Pembayaran tidak didukung untuk transaksi BCH - - BCH berhasil dikirim. - - Tarik BCH - - ID Transaksi BCH - - Menyetujui - - %1$s meminta otentikasi menggunakan dompet Litecoin Anda - - Menyangkal - - Kesalahan otentikasi - - Silakan periksa dengan layanan. Anda mungkin perlu mencoba lagi. - - Berhasil Diotentikasi - - Permintaan Otentikasi BitID Membatalkan diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 96a6e09c0..791dc3315 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -66,40 +66,6 @@ Il portafoglio non è pronto Impossibile recuperare il token API - - Inserisci un indirizzo di destinazione BCH qui sotto. Verranno invitai tutti i BCH nel tuo portafogli al momento dell\'intervallo (%1$s). - - Conferma l\'invio di %1$s a %2$s - - Conferma - - Il tuo account non contiene alcun BCH, oppure hai ricevuto BCH dopo l\'intervallo. - - ID della transazione copiato - - Per favore inserisci e invia - - Le richieste di protocollo del pagamento non sono supportate per le transazioni in BCH - - BCH inviati con successo. - - Ritira BCH - - ID transazione BCH - - Approva - - %1$s richiede l\'autenticazione usando il tuo portafogli Litecoin - - Nega - - Errore di autenticazione - - Per favore verifica con il servizio. Potresti dover riprovare. - - Autenticato con successo - - Richiesta autenticazione BitID Annulla diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index d0bc1978d..ab7e494e4 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -66,40 +66,6 @@ ウォレットの準備ができていません APIトークンを取得できません - - 送金先のBCHアドレスを入力してください。フォーク時(%1$s)にウォレット内にあった全てのBCHが送られます。 - - %1$sを%2$sに送金することを確認する - - 承認 - - アカウントにBCHがない、またはフォークの後にBCHを受け取っています。 - - トランザクションIDをコピー済み - - アドレスを入力してください - - BCHのトランザクションでペイメントプロトコルリクエストはサポートされていません。 - - BCHの送金に成功しました。 - - BCHを引き出す - - BCHのトランザクションID - - 承認する - - %1$sがライトコインウォレットを使っての認証を求めています - - 拒否する - - 認証エラー - - サービスを確認してください。やり直さなければいけない可能性もあります。 - - 認証成功 - - BitID認証リクエスト キャンセル diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index b2575a763..4e4421515 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -66,40 +66,6 @@ 지갑 준비 안됨 API 토큰을 가져올 수 없습니다 - - 아래의 목적지 BCH 주소를 입력하세요. 분기 시점(%1$s)에 귀하의 월렛에 있는 모든 BCH를 보냅니다. - - %1$s를 %2$s(으)로 보내기를 확인 - - 확정 - - 귀하의 계정에는 BCH가 없거나, 분기 이후에 BCH를 받으셨습니다. - - Transaction ID 복사됨 - - 주소를 입력해 주세요 - - Payment Protocol Request는 BCH 트랜잭션에서 지원되지 않습니다 - - BCH를 성공적으로 보냈습니다. - - BCH 인출 - - BCH Transaction ID - - 승인 - - %1$s(이)가 귀하의 라이트코인 월렛 이용에 대한 인증을 요청하고 있습니다. - - 거부 - - 인증 오류 - - 서비스 측에 확인해 주세요. 다시 시도해야 할 수도 있습니다. - - 성공적으로 인증됨 - - BitID 인증 요청 취소 diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 201217e75..b97ede207 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -66,40 +66,6 @@ Portemonnee niet gereed Niet in staat op API teken te vinden - - Voer hieronder een BCH bestemmingsadres in. Alle BCH die op het moment van de fork (%1$s) in in je portomonnee zitten, zullen worden gestuurd. - - Sturen van %1$s naar %2$s bevestigen - - Bevestiging - - Je account bevat geen BCH of je hebt BCH ontvangen na de fork. - - Transactie-ID gekopieerd - - Voer alstublieft een adres in - - Betalingsprotocol-aanvragen worden niet ondersteund voor tranacties met BCH - - BCH succesvol verstuurd. - - BCH opnemen - - BCH Transactie-ID. - - Keur goed - - %1$s vraagt om authenticatie om je Litecoin-portemonnee te gebruiken - - Weigeren - - Authenticatie Fout - - Vraag het na bij de service. Je moet het mogelijk opnieuw proberen. - - Succesvol geautenticeerd - - BitID Authenticatieverzoek Annuleren diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 32d5a396d..d8132941b 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -66,40 +66,6 @@ Carteira não preparada Não foi possível obter o token API - - Introduza abaixo um endereço de destino da BCH. Toda a BCH que estiver na sua conta no momento da divisão (%1$s) será enviada. - - Confirme o envio de %1$s para %2$s - - Confirmação - - A sua conta não contém qualquer BCH, ou recebeu as BCH depois da divisão. - - ID da transação copiado - - Por favor, introduza um endereço - - Não são suportados pedidos de protocolo de pagamento para transações de BCH - - A BCH foi enviada com sucesso - - Levantar BCH - - ID da transação de BCH - - Aprovar - - %1$s está a solicitar autenticação utilizando a sua carteira de Litecoin - - Recusar - - Erro de autenticação - - Por favor, verifique o serviço. Pode ser que precise de tentar novamente. - - Autenticado com sucesso - - Pedido de autenticação BitID Cancelar diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index a7acad874..b2f55f277 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -66,40 +66,6 @@ Кошелек не готов Не удалось извлечь токен API - - Введите адрес адресата BCH ниже. Вся сумма BCH в вашем кошельке во время форка (%1$s) будет отправлена. - - Подтвердить отправку %1$s на %2$s - - Подтверждение - - На Вашем аккаунте нет BCH, или вы получили BCH после форка. - - Идентификатор транзакции скопирован - - Пожалуйста, введите и адрес - - Запросы протокола платежей не поддерживаются для транзакций BCH - - BCH был успешно отправлен. - - Снять BCH - - Идентификатор транзакции BCH - - Одобрить - - %1$s запрашивает аутентификацию, используя ваш биткойн-кошелек - - Отказаться - - Ошибка аутентификации - - Пожалуйста, обратитесь в эту службу. Возможно, вам придется попробовать еще раз. - - Аутентификация пройдена успешно - - Запрос на аутентификацию BitID Отменить diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 19de25609..5d43ce860 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -66,40 +66,6 @@ Plånboken ej redo Kan inte ta emot API-symbol - - Ange mottagarens BCH-adress nedan. Alla BCH i din plånbok vid nästa fork (%1$s) kommer skickas. - - Bekräfta skickar %1$s till %2$s - - Bekräftelse - - Ditt konto har inte några BCH, eller så tar du emot BCH först efter nästa fork. - - Transaktions-ID kopierat - - Var god ange en adress - - Betalningsprotokollsbegäran stöds inte för BCH-transaktioner - - BCH skickades. - - Ta ut BCH - - BCH transaktions-ID - - Godkänn - - %1$s begär autentisering med hjälp av din Litecoin-plånbok - - Avslå - - Autentiseringsfel - - Var god kontrollera med tjänsten. Du kan behöva försöka igen. - - Autentiseringen lyckades - - BitId autentiseringsförfrågan Avbryt diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 2693897d6..672cbc212 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -64,40 +64,6 @@ Cüzdan hazır değil API jetonu alınamıyor - - Aşağıya bir hedef BCH adresi girin. Çatal anında cüzdanınızdaki tüm BCH (%1$s) gönderilecektir. - - Göndermeyi onaylayın %1$s -e %2$s - - Onayla - - Hesabınız herhangi bir BCH içermiyor veya çataldan sonra BCH aldınız. - - İşlem kimliği kopyalandı - - Bir Adresi giriniz - - Ödeme Protokolü İstekleri, BCH işlemleri için desteklenmez - - BCH başarıyla gönderildi. - - BCH\'yi geri çekin - - BCH İşlem Kimliği - - Onayla - - %1$s Litecoin cüzdanınızı kullanarak kimlik doğrulaması istiyor - - Reddetmek - - Doğrulama hatası - - Lütfen servise danışın. Tekrar denemeniz gerekebilir. - - Başarıyla Doğrulandı - - BitID Kimlik Doğrulama İsteği İptal etmek diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 432591ec1..637fb639b 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -66,40 +66,6 @@ 钱包尚未备好 无法检索 API 令牌 - - 在下方输入目标 BCH 地址。您钱包中此分叉 (%1$s) 时的所有 BCH 都将被发送。 - - 确认将 %1$s 发送到 %2$s - - 确认 - - 您的账户不包含任何 BCH,或您在分叉后才接收到 BCH。 - - 已拷贝交易 ID - - 请输入地址 - - 支付协议请求不支持 BCH 交易 - - BCH 已成功发送。 - - 取出 BCH - - BCH 交易 ID - - 批准 - - %1$s 正使用您的莱特币钱包请求验证 - - 拒绝 - - 验证错误 - - 请检查此服务。您可能需要重试。 - - 验证成功 - - BitID 验证请求 取消 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 705399e27..4b5edd39a 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -66,40 +66,6 @@ 電子錢包尚未就緒 無法擷取 API 權杖 - - 在下方輸入目的地 BCH 地址。分叉(%1$s)之時錢包內所有的 BCH 都會送出。 - - 確定送出 %1$s 至 %2$s - - 確認 - - 您的帳戶內沒有任何 BCH,或您是在分叉後取得 BCH。 - - 已複制交易 ID - - 請輸入地位 - - BCH 交易不支援付款組合要求 - - BCH 已成功寄送。 - - 提取 BCH - - BCH 交易 ID - - 許可 - - %1$s 要求認證使用您的比特幣錢包 - - 拒絕 - - 認證錯誤 - - 請檢查服務。您可能必須重試一次。 - - 認證成功。 - - 要求認證比特 ID 取消 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8da711596..bd7b8954c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -64,40 +64,6 @@ Wallet not ready Unable to retrieve API token - - Enter a destination BCH address below. All BCH in your wallet at the time of the fork (%1$s) will be sent. - - Confirm sending %1$s to %2$s - - Confirmation - - Your account does not contain any BCH, or you received BCH after the fork. - - Transaction ID copied - - Please enter an address - - Payment Protocol Requests are not supported for BCH transactions - - BCH was successfully sent. - - Withdraw BCH - - BCH Transaction ID - - Approve - - %1$s is requesting authentication using your Litecoin wallet - - Deny - - Authentication Error - - Please check with the service. You may need to try again. - - Successfully Authenticated - - BitID Authentication Request Cancel diff --git a/app/src/test/java/PaperKeyTests.java b/app/src/test/java/PaperKeyTests.java index f9641d094..1b8c930bf 100644 --- a/app/src/test/java/PaperKeyTests.java +++ b/app/src/test/java/PaperKeyTests.java @@ -23,30 +23,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertThat; -/** - * BreadWallet - *

- * Created by Mihail Gutan on 11/3/17. - * Copyright (c) 2017 breadwallet LLC - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ public class PaperKeyTests { private static final String TAG = PaperKeyTests.class.getName();