Example #1
0
def insert_apk_item(hbld, apkList, stat, flag, m, k):
	for apk in apkList:
		#print 'Inserting %s' % apk
		md5Val = util.gen_md5_file(apk)
		vals = get_hash_val(md5Val, m, k)
		hbld.insert_item(vals)

	if flag == 'p':
		stat.set_ms(hbld.get_size())
	if flag == 'n':
		stat.set_bs(hbld.get_size())
Example #2
0
def query_apk_item(hbld, mApkList, bApkList, stat, flag, m, k):
	for apk in mApkList:
		#print 'Querying %s' % apk
		md5Val = util.gen_md5_file(apk)
		vals = get_hash_val(md5Val, m, k)
		result = hbld.query_item(vals)

		if result == True:
			if flag == 'm':
				stat.inc_tp()
			elif flag == 'b':
				stat.inc_fn()

	for apk in bApkList:
		#print 'Querying %s' % apk
		md5Val = util.gen_md5_file(apk)
		vals = get_hash_val(md5Val, m, k)
		result = hbld.query_item(vals)

		if result == True:
			if flag == 'm':
				stat.inc_fp()
			elif flag == 'b':
				stat.inc_tn()