> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/system_overview/pg_all_components/pg_ast_users_guide.md).

# ADK-AST Programmers Guide

## Preface <a href="#preface" id="preface"></a>

This guide provides information of the functionality and usage of ADK Anti Skimming Tool (AST) application.

### Audience <a href="#subsec_ast_audience" id="subsec_ast_audience"></a>

This document is meant for programmers who want to understand and use ADK Anti Skimming Tool application.

### Organization <a href="#subsec_ast_organization" id="subsec_ast_organization"></a>

This guide is organized as follows:

[Chapter 1, Introduction](#sec_ast_introduction): Introduction to ADK-AST.

[Chapter 2, Getting Started](#sec_ast_getting_started): Explains concept.

[Chapter 3, Programming](#sec_ast_programming): Presents common uses.

[Chapter 4, System Setup and Requirements](#sec_ast_compile): Environment setup, installation and dependencies to other components.

[Chapter 5, Troubleshooting](#sec_ast_troubleshooting): Solutions for possible issues.

[Appendix: Glossary](/s-adk-5.1-programmers-guide/readme/system_overview/pg_all_components/pg_systools_guide/pg_systools_timezone_change.md#sec_ast_glossary): Listing and definitions of various acronyms and terms

## Introduction <a href="#sec_ast_introduction" id="sec_ast_introduction"></a>

Anti-Skimming device is implemented to perform distance measurment between card reader slot and surface of keypad to detect overlay that may occur in case of abuse of the terminal.

## Getting Started <a href="#sec_ast_getting_started" id="sec_ast_getting_started"></a>

### Concepts <a href="#sec_ast_concepts" id="sec_ast_concepts"></a>

AST (Anti-Skimming Tool) is an ADK application which interacts with anti-skimming detection device. Anti-Skimming device is realised as a Probe (card) that can be inserted in card reader. Anti-Skimming tool is supported by Engage multi-line devices (e.g. Mx925, Mx915, M440, M425, M400) and can be delivered as:

* AST - as ADK component
* or ASTS - Standalone version (by loading Anti Skimming Tool Standalone (ASTS) signed application and VHQ Agent).

An operator (a person who checks terminals with AST Probe) initiates Anti-Skimming test application on the terminal and inserts the Probe. This Probe checks card slot thickness and reports a result to the terminal. Terminal saves every test result in a separate json encoded report file. Report file is stored in /home/sys13/logs/ast folder. File name is identical to timestamp. File example: /home/sys13/logs/ast/7001076.txt Only last twenty reports will be stored on filesytem. After test execution, created log files are sent to VHQ/VeriCare system. An Estate Owner (person who reviews reports from Anti-Skimming Tool), has an acces to VHQ/VeriCare dashboard of anti-skimming checks.

The Probe has built-in LED indicators that provides a result of test status:

| Led color | Description |
| --------- | ----------- |
| white     | Power       |
| green     | Pass test   |
| red       | Fail test   |

#### Log file content <a href="#subsubsec_log_file_content" id="subsubsec_log_file_content"></a>

| Field        | Type   | Description                        |
| ------------ | ------ | ---------------------------------- |
| description  | string | Status description                 |
| probe\_sn    | string | Anti skimming device serial number |
| return\_code | int    | Code returned by libCR-Skimmer     |
| status       | int    | Error code                         |
| terminal\_sn | string | Terminal serial number             |
| timestamp    | int    | Unix timestamp                     |
| vhq\_status  | int    | Need to clarify                    |

#### Test result status <a href="#subsubsec_test_result_status" id="subsubsec_test_result_status"></a>

| Status | Description               | Anti-Skimming device led color |
| ------ | ------------------------- | ------------------------------ |
| 0      | No overlay detected       | Green                          |
| 1      | Probe is not detected     |                                |
| 2      | Probe communication error |                                |
| 3      | Overlay detected          | Red                            |

#### Return\_code values <a href="#subsubsec_return_code_values" id="subsubsec_return_code_values"></a>

| Code                          | Value | Description                            |
| ----------------------------- | ----- | -------------------------------------- |
| SKIMRC\_Success               | 0     | Operation was successful               |
| SKIMRC\_Failure               | 1     | Operation failed                       |
| SKIMRC\_Error\_Power\_Action  | 2     | Power-Up operation failed              |
| SKIMRC\_Error\_Not\_Supported | 3     | Skimmer probe type not supported       |
| SKIMRC\_Error\_BadParam       | 4     | A function parameter is invalid        |
| SKIMRC\_Error\_Protocol       | 5     | Communication error with skimmer probe |

#### Report file example <a href="#subsubsec_report_file_example" id="subsubsec_report_file_example"></a>

```cpp
{"description":"No overlay detected","probe_sn":"A01E900714241000317C57A000A0000019","return_code":0,"status":0,"terminal_sn":"275-159-718","timestamp":1597099642,"vhq_status":5010}
```

#### Container diagram for Anti-Skimming Tool <a href="#subsubsec_container_diagram" id="subsubsec_container_diagram"></a>

![MAC desktop](/files/B44KKcizwrLWW4FkI6G3)

#### Top level Context diagram for Anti-Skimming Tool <a href="#subsubsec_top_level_context_diagram" id="subsubsec_top_level_context_diagram"></a>

![](/files/JzSWAdoFgLTTSvZhNwc7)

#### Component diagram for Anti-Skimming test Application <a href="#subsubsec_component_diagram" id="subsubsec_component_diagram"></a>

![](/files/69KI9b1dPldGFg3YKyk5)

### Upload to VHQ Server <a href="#subsec_ast_upload_to_vhq_server" id="subsec_ast_upload_to_vhq_server"></a>

Anti-Skimming application calls VHQ Agent API, after the Anti-Skimming device interaction log file is generated. VHQ Agent generates a new event message, based on the data passed by the Anti-Skimming test application and send it to the server. VHQ Server receives the event message, parse it and display in the VHQ UI.

![](/files/i0xUx2vs5IrRLgFNhjz1)

## Environment setup, installation and dependencies to other components <a href="#sec_ast_compile" id="sec_ast_compile"></a>

### Setup and installation <a href="#subsec_ast_setup" id="subsec_ast_setup"></a>

AST release consists of multiple packages:

| Package name              | Description                       |
| ------------------------- | --------------------------------- |
| dl.ast-3.71.6.tgz         | AST application (ADK environment) |
| dl.asts-3.71.6.tgz        | AST application (standalone)      |
| dl.ast-remove-3.71.6.tgz  | AST removal package               |
| dl.asts-remove-3.71.6.tgz | AST removal package               |

{% hint style="info" %}
Removal packages are not needed for regular use. They are needed only if you need to downgrade AST version
{% endhint %}

AST requires ADK. Available as part of these ADK deliveries - ADK-4.4.23, ADK-4.6.12, ADK-4.7.5.

Supported AST languages:

| Language | Catalogue File |
| -------- | -------------- |
| English  | en-US.ctlg     |
| French   | fr-FR.ctlg     |

The default AST language is English.

At the first launch, AST will request to select language after installation. AST memorise this selection for the following usage and don't ask for language again. To change the language one more time need reinstall the AST bundle.

### AST comparison with ASTS: <a href="#subsec_ast_vs_asts" id="subsec_ast_vs_asts"></a>

| AST                                                  | ASTS                                               |
| ---------------------------------------------------- | -------------------------------------------------- |
| GUI interface                                        | No GUI interface                                   |
| Runs as system user (sys13)                          | Runs as system user (sys12)                        |
| Cleaner approach to killing applications             | No cleaner approach to Killing applications        |
| All dependencies are already included in ADK release | Very limited dependencies to V/OS APIs             |
| Available as part of ADK                             | Does not require ADK, can run on old V/OS releases |
| Does not require VHQ agent update                    | Requires VHQ agent update                          |

**AST** **dependencies:**

* GUI interface
* MAC
* VHQ Agent

**ASTS** **dependencies:**

* VHQ currently supports two release lines that support ASTS:
  * version 2.17.20 and up
  * version 3.2.6 and up
* CR-Skimmer library (dl.skimmerdetect-1.0.2-4)

## Programming <a href="#sec_ast_programming" id="sec_ast_programming"></a>

### Common uses <a href="#subsec_common_uses" id="subsec_common_uses"></a>

#### AST usage in ADK environment <a href="#subsubsec_ast_common_uses" id="subsubsec_ast_common_uses"></a>

* Press X+3 to get to ADK desktop
* Press AST icon on ADK desktop
* ADK will stop running payment applications and initiate communication with probe
* AST app will wait for probe for 30 seconds
* If probe is inserted AST will generate a report and store it on file system in /home/sys13/logs/ast folder.
* It will also pass same report to VHQ agent
* After that ADK applications will be restarted

#### ASTS usage <a href="#subsubsec_asts_common_uses" id="subsubsec_asts_common_uses"></a>

* ASTS boots at system startup. It sits in a background and awaits for specific key combination - X + 0 + 2 (Red key + Green key + 2).
* When user presses this combination, ASTS will start sysmode, which results in stopping payment application.
* Then ASTS will initiate communication with the probe.
* If probe is inserted AST will generate a report and store it on file system in /home/sys12/logs/asts folder.
* It will also pass same report to VHQ agent.
* After that it will restart applications.

## Troubleshooting <a href="#sec_ast_troubleshooting" id="sec_ast_troubleshooting"></a>

### FAQ <a href="#subsec_ast_faq" id="subsec_ast_faq"></a>

Q: What is the difference between AST and ASTS?

A: AST application is designed to work in ADK environment. ASTS - is stand alone version, which doesn't require ADK.

### Logging <a href="#subsec_ast_logging" id="subsec_ast_logging"></a>

AST is using ADK-LOG component for logging. Please refer to the ADK-LOG documentation for details. Used logging channels:

| Logging channel | Description                               |
| --------------- | ----------------------------------------- |
| AST             | [AST application logs](#sec_ast_concepts) |

### Debugging <a href="#debugging" id="debugging"></a>

## Appendix: Glossary <a href="#sec_ast_glossary" id="sec_ast_glossary"></a>

| Term    | Description                           |
| ------- | ------------------------------------- |
| ADK     | Application Development Kit           |
| API     | Application Program Interface         |
| AST     | Anti-Skimming Tool                    |
| ASTS    | Anti-Skimming Stand alone Application |
| GUI     | Graphical User Interface              |
| UI      | User Interface                        |
| OS      | Operating System                      |
| HTML    | Hypertext Markup Language             |
| JSON    | JavaScript object notation            |
| HW      | Hardware                              |
| Sysmode | V/OS system application.              |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/system_overview/pg_all_components/pg_ast_users_guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
