Im trying to check if url is malicious in my app. But the output always return that the link is safe even when i put malicious link. Im developing the app using Android Studio and use both GMS and HMS library. Im running the app on my device which is Samsung and its working fine except for the problem i mention above. Help me please.
And one more thing, I’ve downloaded the appGallery on my phone and install hms core. But do i still need to convert gms library to hms library?
Thank you.
This is the response code.
@Override
public void onSuccess(UrlCheckResponse urlCheckResponse) {
List<UrlCheckThreat> list = urlCheckResponse.getUrlCheckResponse();
if (list.isEmpty()) {
// No threats found.
testRes.setText("No threats found.");
} else {
for (UrlCheckThreat threat : list){
int type = threat.getUrlCheckResult();
if(type == UrlCheckThreat.MALWARE){
//threat.getUrlCheckResult();
testRes.setText("Malware found!");
}
else {
if (type == UrlCheckThreat.PHISHING)
//threat.getUrlCheckResult();
testRes.setText("Phishing found!");
}
}
}
}
2
Answers
Apparently, the API to check list of malicious URL took time to function. The response code was functioning well and can detect the malicious URL. Thank you for all the responses.
Could you please send me the link? That way I can do research. Please note: maybe the link is totally new so it may escape detection.
For your other question: "I’ve downloaded the AppGallery on my phone and install hms core. But do i still need to convert gms library to hms library.".
The answer is no, you don’t need to convert anything. But note: you must integrate Huawei SDK when you try to use Huawei Kit features on your GMS phone or HMS phones.