-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into issues/89-add-apkthreat-flags
- Loading branch information
Showing
19 changed files
with
862 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,72 @@ | ||
/** | ||
* Antivirus component of the Malwarelytics for Android. | ||
*/ | ||
* Antivirus component of the Malwarelytics for Android. | ||
*/ | ||
class MalwarelyticsAndroidAntivirus extends __MPAndroidService { | ||
|
||
/** | ||
* Schedules a job that will execute smart protection run. Note that this is asynchronous and | ||
* can take some time. | ||
* | ||
* @param performOnlineUpdate Optional argument to indicate that online update is not desired. | ||
* If false only local data will be used. | ||
*/ | ||
* Schedules a job that will execute smart protection run. Note that this is asynchronous and | ||
* can take some time. | ||
* | ||
* @param performOnlineUpdate Optional argument to indicate that online update is not desired. | ||
* If false only local data will be used. | ||
*/ | ||
async triggerSmartProtection(performOnlineUpdate: Boolean = true): Promise<SmartProtectionResult> { | ||
return await this.callAsync("triggerSmartProtection", performOnlineUpdate); | ||
return await this.callAsync("triggerSmartProtection", performOnlineUpdate); | ||
} | ||
|
||
/** | ||
* Returns list of all applications with the malware evaluation. | ||
*/ | ||
async getThreatList(): Promise<{items: ApkThreat[]}> { | ||
return await this.callAsync("getThreatList"); | ||
* Returns list of all applications with the malware evaluation. | ||
*/ | ||
async getThreatList(): Promise<{ items: ApkThreat[] }> { | ||
return await this.callAsync("getThreatList"); | ||
} | ||
|
||
/** | ||
* Gets more information for the package name of the application. | ||
* | ||
* @param packageName Package name of the application | ||
*/ | ||
* Gets more information for the package name of the application. | ||
* | ||
* @param packageName Package name of the application | ||
*/ | ||
async getApkInfo(packageName: String): Promise<ApkInfo> { | ||
return await this.callAsync("getApkInfo", packageName); | ||
return await this.callAsync("getApkInfo", packageName); | ||
} | ||
|
||
/** | ||
* Get information about the last updates. | ||
* | ||
* Primarily intended for troubleshooting. | ||
* | ||
* @returns Information about latest update successes and failures. | ||
*/ | ||
async getLastUpdateInfo(): Promise<UpdateInfo> { | ||
return await this.callAsync("getLastUpdateInfo"); | ||
} | ||
|
||
/** Set observer that is triggered when a suggestion update completes. */ | ||
setUpdateObserver(observer: MalwarelyticsAndroidUpdateObserver) { | ||
return this.call("setUpdateCallback", (result: { payload: ObservedUpdateInfo }) => { | ||
observer.onSuggestionUpdated(result.payload); | ||
}, null); | ||
} | ||
} | ||
|
||
/** Clear observer for suggestion updates. */ | ||
clearUpdateObserver() { | ||
this.call("clearUpdateCallback", null, null); | ||
} | ||
} | ||
|
||
/** Observer for update results. */ | ||
interface MalwarelyticsAndroidUpdateObserver { | ||
/** | ||
* Called when an update was finished regardless of a success or a failure. | ||
* | ||
* Returned data indicated the update result: | ||
* - Successful update: | ||
* @see ObservedUpdateInfo.failureReason is null | ||
* - Partially successful update: | ||
* @see ObservedUpdateInfo.failureReason is not null | ||
* and @see ObservedUpdateInfo.updatedApps is not empty | ||
* - Failed update: | ||
* and @see ObservedUpdateInfo.failureReason is not null | ||
* and @see ObservedUpdateInfo.updatedApps is empty */ | ||
onSuggestionUpdated(observedUpdateInfo: ObservedUpdateInfo): void; | ||
} |
Oops, something went wrong.