Class GollumKaijuAbstract
-
- All Implemented Interfaces:
public class GollumKaijuAbstract
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
GollumKaijuAbstract.PriorityRequest
-
Field Summary
Fields Modifier and Type Field Description public final static String
TAG
public final static int
DEFAULT_NUM_CODES_REQUESTED
public final static String
TOKEN_PREFIX
public final static int
MAX_TIMEOUT_PER_REQUEST_MS
-
Constructor Summary
Constructors Constructor Description GollumKaijuAbstract()
GollumKaijuAbstract(String kaijuServerUrl)
-
Method Summary
Modifier and Type Method Description String
getUrl()
String
getKaijuServerAppName(Context context)
Return server name, from the current URL we return the associated server name. void
reset(String kaijuUrl)
static boolean
isNetworkReachable(@NonNull() Context context)
Indicate if network is reachable (information provided by connectivity service) void
checkServerReachability(@NonNull() Context context, KaijuHeaders headers, @Nullable() GollumCallbackGetGeneric<ApiSystemStatus> cbResult)
Verify if Kaiju is reachable Is reachable if a status code is returned Not reachable if request has failed. void
requestCreateUserIfNeeded(@NonNull() Context context, @NonNull() KaijuHeaders headers, @Nullable() String username, @NonNull() String email, @NonNull() String firstName, @NonNull() String lastName, @Nullable() String bleAddress, @Nullable() String deviceModelName, @Nullable() String deviceRevision, @NonNull() GollumCallbackGetGeneric<Boolean> cbResult)
Request user creation if needed. void
requestTemporaryApiToken(@NonNull() Context context, @NonNull() KaijuHeaders kaijuHeaders, @NonNull() String email, @NonNull() GollumCallbackGetString cbResult)
request a 6-digit callback token to be sent to a given email address void
requestLongTermApiToken(@NonNull() Context context, KaijuHeaders kaijuHeaders, @NonNull() String email, @NonNull() String temporaryToken, @NonNull() GollumCallbackGetString cbResult)
Exchange a 6-digit temporary token and an email for a 40-digit long term token void
requestDevicesInfoList(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() String lowerBoundDate, @NonNull() GollumCallbackGetGeneric<ApiDevicesInfo> cbResult)
Used to download the generated devices by a specific user represented with an authorization Token. void
requestUpdateDeviceInfoComment(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String taskId, @NonNull() String newComment, @NonNull() GollumCallbackGetGeneric<DeviceInfo> cbResult)
Call it to update comment of a DeviceInfo, response of the request is the updated Device Info. void
requestUpdateRollingCodeStatus(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String taskId, @NonNull() String syncCounter, @NonNull() String status, @NonNull() GollumCallbackGetGeneric<Boolean> cbResult)
Update rolling code status, accepted values are: NOT_USED|USED|TRANSMITTED Check https://rolling.pandwarf. void
requestMoreRollingCodes(@NonNull() Context context, @NonNull() KaijuHeaders header, @NonNull() JobInputMoreRollingCodes jobInputMoreRollingCodes, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
Make a POST to Kaiju in order to generates more rolling codes to the given task Id hosted in JobInputMoreRollingCodes void
requestQuotasStatus(@NonNull() Context context, @NonNull() KaijuHeaders header, @NonNull() GollumCallbackGetGeneric<QuotasStatus> cbResult)
void
sendRequestAnalyzeDetailed(@NonNull() GollumKaijuAbstract.PriorityRequest priorityRequest, @NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() KaijuInputConfig rxTxConfiguration, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
Request detailed rolling code analysis, with processing priority specified void
sendRequestGenerateCapture(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() KaijuInputConfig config, @NonNull() GollumCallbackGetString cbResult)
Generate X rolling codes from captured data void
getTaskInfo(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String jobId, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
void
sendRequestUnlockDevice(Context context, @NonNull() KaijuHeaders headers, @NonNull() String jobId, @NonNull() GollumCallbackGetInteger cbResult)
Call Kaiju to unlock a device linked to the given jobId. void
deleteMarauderSession(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() Collection<String> listOfSessionIds, @Nullable() GollumCallbackGetInteger cbSuccess)
void
deleteDevicesInfo(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() Collection<String> listOfTaskId, @Nullable() GollumCallbackGetInteger cbSuccess)
Send to Kaiju a list of taskIds to delete. void
getDeviceInfo(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String jobId, @NonNull() GollumCallbackGetGeneric<DeviceInfo> cbResult)
void
getDevicesInfo(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() List<String> taskIds, @NonNull() GollumCallbackGetGeneric<ApiDevicesInfo> cbResult)
void
getDeviceInfo(@NonNull() GollumKaijuAbstract.PriorityRequest priorityRequest, @NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String jobId, @NonNull() GollumCallbackGetGeneric<DeviceInfo> cbResult)
void
getDeviceListModificationDate(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() String lowerBoundDate, @NonNull() GollumCallbackGetGeneric<ApiModificationDatesResult> cbResult)
Download subpart of all devicesInfo. void
getSeedBruteForceRequest(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String taskId, @NonNull() GollumCallbackGetGeneric<ApiSeedBruteForceRequestResult> cbResult)
Request seed brute force request object. void
getSeedBruteForceRequests(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() GollumCallbackGetGeneric<ApiSeedBruteForcesRequestsPageResult> cbResult)
Get paginated seed brute force objects. void
requestGenerateSeedBruteForce(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() KaijuGenerateSeedBruteForceConfig kaijuGenerateResyncConfig, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
Call Kaiju to generate a Seed brute force. void
getSeedBruteForcesListModificationDate(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() GollumCallbackGetGeneric<ApiModificationDatesResult> cbResult)
Download modification date of each task id associated to a seed brute force. void
deleteSeedBruteForce(@NonNull() KaijuHeaders headers, int seedBruteForceId, @NonNull() GollumCallbackGetBoolean cbCompleted)
void
getHitag2BruteForceRequest(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String taskId, @NonNull() GollumCallbackGetGeneric<ApiHitag2BruteForceRequestResult> cbResult)
void
getHitag2BruteForceRequests(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() GollumCallbackGetGeneric<ApiHitag2BruteForceRequestsPageResult> cbResult)
void
requestGenerateHitag2BruteForce(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() KaijuGenerateHitag2BruteForceConfig kaijuGenerateHitag2BruteForceConfig, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
void
getHitag2BruteForcesListModificationDate(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() GollumCallbackGetGeneric<ApiModificationDatesResult> cbResult)
Download modification date of each task id associated to a hitag2 brute force. void
deleteHitag2BruteForce(@NonNull() KaijuHeaders headers, int hitag2BruteForceId, @NonNull() GollumCallbackGetBoolean cbCompleted)
void
requestMarauderSession(@NonNull() Context context, @NonNull() KaijuHeaders headers, String sessionId, String pageId, GollumCallbackGetGeneric<ApiMarauderSessionDevicePaginedResult> cbResult)
Request a single marauder session. void
requestMarauderSessionsList(@NonNull() Context context, @NonNull() KaijuHeaders headers, String afterDate, String pageId, @NonNull() GollumCallbackGetGeneric<ApiMarauderSessionsPaginedResult> cbResult)
-
-
Constructor Detail
-
GollumKaijuAbstract
GollumKaijuAbstract()
-
GollumKaijuAbstract
GollumKaijuAbstract(String kaijuServerUrl)
-
-
Method Detail
-
getKaijuServerAppName
String getKaijuServerAppName(Context context)
Return server name, from the current URL we return the associated server name. Check server names in array R.array.gollumrf_kaiju_server_readable_names
-
isNetworkReachable
static boolean isNetworkReachable(@NonNull() Context context)
Indicate if network is reachable (information provided by connectivity service)
-
checkServerReachability
void checkServerReachability(@NonNull() Context context, KaijuHeaders headers, @Nullable() GollumCallbackGetGeneric<ApiSystemStatus> cbResult)
Verify if Kaiju is reachable Is reachable if a status code is returned Not reachable if request has failed.
-
requestCreateUserIfNeeded
void requestCreateUserIfNeeded(@NonNull() Context context, @NonNull() KaijuHeaders headers, @Nullable() String username, @NonNull() String email, @NonNull() String firstName, @NonNull() String lastName, @Nullable() String bleAddress, @Nullable() String deviceModelName, @Nullable() String deviceRevision, @NonNull() GollumCallbackGetGeneric<Boolean> cbResult)
Request user creation if needed.
- Parameters:
cbResult
- callback to be called when request HTTP is completed.
-
requestTemporaryApiToken
void requestTemporaryApiToken(@NonNull() Context context, @NonNull() KaijuHeaders kaijuHeaders, @NonNull() String email, @NonNull() GollumCallbackGetString cbResult)
request a 6-digit callback token to be sent to a given email address
- Parameters:
email
- email address where to send the user a 6-digit callback (temporary) tokencbResult
- callback to be called with detail result
-
requestLongTermApiToken
void requestLongTermApiToken(@NonNull() Context context, KaijuHeaders kaijuHeaders, @NonNull() String email, @NonNull() String temporaryToken, @NonNull() GollumCallbackGetString cbResult)
Exchange a 6-digit temporary token and an email for a 40-digit long term token
- Parameters:
email
- email address where to send the user a 6-digit callback (temporary) tokentemporaryToken
- a 6-digit callback (temporary) tokencbResult
- callback to be called with 40-digit long term token
-
requestDevicesInfoList
void requestDevicesInfoList(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() String lowerBoundDate, @NonNull() GollumCallbackGetGeneric<ApiDevicesInfo> cbResult)
Used to download the generated devices by a specific user represented with an authorization Token.
- Parameters:
cbResult
- called when a DevicesInfo is received, or when exception is thrown.
-
requestUpdateDeviceInfoComment
void requestUpdateDeviceInfoComment(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String taskId, @NonNull() String newComment, @NonNull() GollumCallbackGetGeneric<DeviceInfo> cbResult)
Call it to update comment of a DeviceInfo, response of the request is the updated Device Info. Updated Device Info is stored &merged in local cache.
-
requestUpdateRollingCodeStatus
void requestUpdateRollingCodeStatus(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String taskId, @NonNull() String syncCounter, @NonNull() String status, @NonNull() GollumCallbackGetGeneric<Boolean> cbResult)
Update rolling code status, accepted values are: NOT_USED|USED|TRANSMITTED Check https://rolling.pandwarf.com/docs/swagger/
-
requestMoreRollingCodes
void requestMoreRollingCodes(@NonNull() Context context, @NonNull() KaijuHeaders header, @NonNull() JobInputMoreRollingCodes jobInputMoreRollingCodes, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
Make a POST to Kaiju in order to generates more rolling codes to the given task Id hosted in JobInputMoreRollingCodes
-
requestQuotasStatus
void requestQuotasStatus(@NonNull() Context context, @NonNull() KaijuHeaders header, @NonNull() GollumCallbackGetGeneric<QuotasStatus> cbResult)
- Parameters:
header
- contains bearer token.cbResult
- callback to be called with quotas status
-
sendRequestAnalyzeDetailed
void sendRequestAnalyzeDetailed(@NonNull() GollumKaijuAbstract.PriorityRequest priorityRequest, @NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() KaijuInputConfig rxTxConfiguration, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
Request detailed rolling code analysis, with processing priority specified
- Parameters:
headers
- Headers to be included in request: bearer token, user's email address from GoogleSignInAccount, PandwaRF macAddress, ....rxTxConfiguration
- RxTxConfig to analyzecbResult
- callback to be called with analysis result
-
sendRequestGenerateCapture
void sendRequestGenerateCapture(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() KaijuInputConfig config, @NonNull() GollumCallbackGetString cbResult)
Generate X rolling codes from captured data
- Parameters:
headers
- Headers to be included in request: bearer token , user's email address from GoogleSignInAccount, PandwaRF macAddress, ....config
- RxTxConfig to analyzecbResult
- callback to be called with analysis result
-
getTaskInfo
void getTaskInfo(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String jobId, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
-
sendRequestUnlockDevice
void sendRequestUnlockDevice(Context context, @NonNull() KaijuHeaders headers, @NonNull() String jobId, @NonNull() GollumCallbackGetInteger cbResult)
Call Kaiju to unlock a device linked to the given jobId.
- Parameters:
cbResult
- 0 -> success exception null, 1 -> fail &an non null exception is passed to the callback.
-
deleteMarauderSession
void deleteMarauderSession(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() Collection<String> listOfSessionIds, @Nullable() GollumCallbackGetInteger cbSuccess)
-
deleteDevicesInfo
void deleteDevicesInfo(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() Collection<String> listOfTaskId, @Nullable() GollumCallbackGetInteger cbSuccess)
Send to Kaiju a list of taskIds to delete. These tasks must be associated to a device.
-
getDeviceInfo
void getDeviceInfo(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String jobId, @NonNull() GollumCallbackGetGeneric<DeviceInfo> cbResult)
-
getDevicesInfo
void getDevicesInfo(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() List<String> taskIds, @NonNull() GollumCallbackGetGeneric<ApiDevicesInfo> cbResult)
-
getDeviceInfo
void getDeviceInfo(@NonNull() GollumKaijuAbstract.PriorityRequest priorityRequest, @NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String jobId, @NonNull() GollumCallbackGetGeneric<DeviceInfo> cbResult)
-
getDeviceListModificationDate
void getDeviceListModificationDate(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() String lowerBoundDate, @NonNull() GollumCallbackGetGeneric<ApiModificationDatesResult> cbResult)
Download subpart of all devicesInfo. The body contains a map where the key is the task id , value is last modification date of the related deviceInfo.
-
getSeedBruteForceRequest
void getSeedBruteForceRequest(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String taskId, @NonNull() GollumCallbackGetGeneric<ApiSeedBruteForceRequestResult> cbResult)
Request seed brute force request object.
-
getSeedBruteForceRequests
void getSeedBruteForceRequests(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() GollumCallbackGetGeneric<ApiSeedBruteForcesRequestsPageResult> cbResult)
Get paginated seed brute force objects.
-
requestGenerateSeedBruteForce
void requestGenerateSeedBruteForce(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() KaijuGenerateSeedBruteForceConfig kaijuGenerateResyncConfig, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
Call Kaiju to generate a Seed brute force.
-
getSeedBruteForcesListModificationDate
void getSeedBruteForcesListModificationDate(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() GollumCallbackGetGeneric<ApiModificationDatesResult> cbResult)
Download modification date of each task id associated to a seed brute force. The body contains a map where the key is the task id , value is last modification date of the related deviceInfo.
-
deleteSeedBruteForce
void deleteSeedBruteForce(@NonNull() KaijuHeaders headers, int seedBruteForceId, @NonNull() GollumCallbackGetBoolean cbCompleted)
- Parameters:
cbCompleted
- true if request has been execute with success.
-
getHitag2BruteForceRequest
void getHitag2BruteForceRequest(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() String taskId, @NonNull() GollumCallbackGetGeneric<ApiHitag2BruteForceRequestResult> cbResult)
-
getHitag2BruteForceRequests
void getHitag2BruteForceRequests(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() GollumCallbackGetGeneric<ApiHitag2BruteForceRequestsPageResult> cbResult)
-
requestGenerateHitag2BruteForce
void requestGenerateHitag2BruteForce(@NonNull() Context context, @NonNull() KaijuHeaders headers, @NonNull() KaijuGenerateHitag2BruteForceConfig kaijuGenerateHitag2BruteForceConfig, @NonNull() GollumCallbackGetGeneric<Task> cbResult)
-
getHitag2BruteForcesListModificationDate
void getHitag2BruteForcesListModificationDate(@NonNull() Context context, @NonNull() KaijuHeaders headers, @IntRange(from = 1) int pageId, @NonNull() GollumCallbackGetGeneric<ApiModificationDatesResult> cbResult)
Download modification date of each task id associated to a hitag2 brute force. The body contains a map where the key is the task id , value is last modification date of the related deviceInfo.
-
deleteHitag2BruteForce
void deleteHitag2BruteForce(@NonNull() KaijuHeaders headers, int hitag2BruteForceId, @NonNull() GollumCallbackGetBoolean cbCompleted)
- Parameters:
cbCompleted
- true if request has been execute with success.
-
requestMarauderSession
void requestMarauderSession(@NonNull() Context context, @NonNull() KaijuHeaders headers, String sessionId, String pageId, GollumCallbackGetGeneric<ApiMarauderSessionDevicePaginedResult> cbResult)
Request a single marauder session.
-
requestMarauderSessionsList
void requestMarauderSessionsList(@NonNull() Context context, @NonNull() KaijuHeaders headers, String afterDate, String pageId, @NonNull() GollumCallbackGetGeneric<ApiMarauderSessionsPaginedResult> cbResult)
-
-
-
-