diff --git a/app/src/main/java/com/xypower/mpapp/BridgeProvider.java b/app/src/main/java/com/xypower/mpapp/BridgeProvider.java index 90bfd72f..455c4177 100644 --- a/app/src/main/java/com/xypower/mpapp/BridgeProvider.java +++ b/app/src/main/java/com/xypower/mpapp/BridgeProvider.java @@ -73,7 +73,6 @@ public class BridgeProvider extends ContentProvider { matcher.addURI(AUTHORITY, PATH_QUERY_SEC_VERSION, 1); matcher.addURI(AUTHORITY, PATH_QUERY_BATTERY_VOLTAGE, 2); - Cursor cursor = null; int matched = matcher.match(uri); switch (matched) { @@ -131,7 +130,6 @@ public class BridgeProvider extends ContentProvider { } private Cursor querySecVersion() { - // String resultFile = intent.getStringExtra("resultFile"); String version = MicroPhotoService.querySecVersion(); String[] columns = { "version" }; MatrixCursor matrixCursor = new MatrixCursor(columns, 1); @@ -154,7 +152,7 @@ public class BridgeProvider extends ContentProvider { private int importPrivateKey(Uri uri, ContentValues values) { String cert = values.containsKey("cert") ? values.getAsString("cert") : null; String path = values.containsKey("path") ? values.getAsString("path") : null; - String resultFile = values.containsKey("resultFile") ? values.getAsString("path") : null; + String resultFile = values.containsKey("resultFile") ? values.getAsString("resultFile") : null; int index = values.containsKey("index") ? values.getAsInteger("index").intValue() : 0; boolean res = false; @@ -172,21 +170,18 @@ public class BridgeProvider extends ContentProvider { } } - return res ? 1 : 0; - /* - Log.i(TAG, "Import Private Key result=" + (res ? "1" : "0")); - if (!TextUtils.isEmpty(resultFile)) { FilesUtils.ensureParentDirectoryExisted(resultFile); FilesUtils.writeTextFile(resultFile, res ? "1" : "0"); } - */ + + return res ? 1 : 0; } private int importPublicKey(Uri uri, ContentValues values) { String cert = values.containsKey("cert") ? values.getAsString("cert") : null; String path = values.containsKey("path") ? values.getAsString("path") : null; - String resultFile = values.containsKey("resultFile") ? values.getAsString("path") : null; + String resultFile = values.containsKey("resultFile") ? values.getAsString("resultFile") : null; int index = values.containsKey("index") ? values.getAsInteger("index").intValue() : 0; boolean res = false; @@ -204,15 +199,12 @@ public class BridgeProvider extends ContentProvider { } } - return res ? 1 : 0; - /* - Log.i(TAG, "Import Private Key result=" + (res ? "1" : "0")); - if (!TextUtils.isEmpty(resultFile)) { FilesUtils.ensureParentDirectoryExisted(resultFile); FilesUtils.writeTextFile(resultFile, res ? "1" : "0"); } - */ + + return res ? 1 : 0; } private int genKeys(Uri uri, ContentValues values) {