Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dpnishant committed Apr 10, 2017
1 parent 720d711 commit c00d9ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
22 changes: 13 additions & 9 deletions database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@
from xml.sax.saxutils import escape

def save_to_database(db_path, str_json):
str_json = json.loads(str_json)
db = dataset.connect('sqlite:///%s' % (db_path.replace("'", "_")))
table = db['api_captures']
table.insert(dict(time=time.strftime('%b %d %Y %l:%M %p', time.localtime()),
operation=str_json['txnType'],
artifact=json.dumps(str_json['artifact']),
method=str_json['method'],
module=str_json['lib'],
remark=''))
try:
str_json = json.loads(str_json.replace("\n", "<br />").replace("\r", "<br />"), strict=False)
db = dataset.connect('sqlite:///%s' % (db_path.replace("'", "_")))
table = db['api_captures']
table.insert(dict(time=time.strftime('%b %d %Y %l:%M %p', time.localtime()),
operation=str_json['txnType'],
artifact=json.dumps(str_json['artifact']),
method=str_json['method'],
module=str_json['lib'],
remark=''))
except Exception as e:
print str(e)
print str_json

def stringify(data):
str_data = ""
Expand Down
6 changes: 3 additions & 3 deletions scripts/Android/Network/HTTP.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Java.perform(function() {
try {
var HttpURLConnection = Java.use("com.android.okhttp.internal.http.HttpURLConnectionImpl");
} catch (e) {
var HttpURLConnection = Java.use("com.android.okhttp.internal.huc.HttpURLConnectionImpl");
} finally {
return
try {
var HttpURLConnection = Java.use("com.android.okhttp.internal.huc.HttpURLConnectionImpl");
} catch (e) { return }
}
//var BufferedInputStream = Java.use("java.io.BufferedInputStream");
//var StringBuilder = Java.use("java.lang.StringBuilder");
Expand Down

0 comments on commit c00d9ed

Please sign in to comment.