├── example_java ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── org │ │ │ └── flyve │ │ │ └── example_java │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── org │ │ └── flyve │ │ └── example_java │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── build.gradle └── google-services.json ├── example_kotlin ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── ids.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── org │ │ │ └── flyve │ │ │ └── example_kotlin │ │ │ └── MainActivity.kt │ ├── test │ │ └── java │ │ │ └── org │ │ │ └── flyve │ │ │ └── example_kotlin │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── org │ │ └── flyve │ │ └── example_kotlin │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── .github ├── invite-contributors.yml ├── ISSUE_TEMPLATE.md ├── label-commenter-config.yml ├── settings.yml ├── PULL_REQUEST_TEMPLATE.md ├── ISSUE_TEMPLATE │ └── Bug_report.md └── workflows │ ├── release-new-version.yml │ └── continuous-integration.yml ├── settings.gradle ├── docs └── glpi_network.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── inventory ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ └── xml │ │ │ │ └── provider_paths.xml │ │ ├── java │ │ │ └── org │ │ │ │ └── flyve │ │ │ │ └── inventory │ │ │ │ ├── GenericFileProvider.java │ │ │ │ ├── categories │ │ │ │ ├── Processes.java │ │ │ │ ├── Envs.java │ │ │ │ ├── LocationProviders.java │ │ │ │ ├── StringUtils.java │ │ │ │ ├── User.java │ │ │ │ ├── Videos.java │ │ │ │ ├── CategoryValue.java │ │ │ │ ├── PhoneStatus.java │ │ │ │ ├── Controllers.java │ │ │ │ ├── Categories.java │ │ │ │ └── Bluetooth.java │ │ │ │ ├── FlyveException.java │ │ │ │ ├── usbManager │ │ │ │ ├── Validation.java │ │ │ │ ├── UsbProperty.java │ │ │ │ └── SysBusUsbManager.java │ │ │ │ ├── InventoryLog.java │ │ │ │ └── CryptoUtil.java │ │ ├── assets │ │ │ ├── cpu_manufacturer.json │ │ │ ├── camera_vendors.json │ │ │ └── cpu_family.json │ │ └── AndroidManifest.xml │ ├── androidTest │ │ └── java │ │ │ └── org │ │ │ └── flyve │ │ │ └── inventory │ │ │ ├── UserTest.java │ │ │ ├── ModemsTest.java │ │ │ ├── VideosTest.java │ │ │ ├── ControllersTest.java │ │ │ ├── InputsTest.java │ │ │ ├── MemoryTest.java │ │ │ ├── BluetoothTest.java │ │ │ ├── BatteryTest.java │ │ │ ├── UsbTest.java │ │ │ ├── OperatingSystemTest.java │ │ │ ├── HardwareTest.java │ │ │ ├── CreateFileTest.java │ │ │ ├── InventoryTaskTest.java │ │ │ ├── BiosTest.java │ │ │ ├── CpusTest.java │ │ │ ├── SensorsTest.java │ │ │ ├── NetworksTest.java │ │ │ ├── DrivesTest.java │ │ │ └── SoftwareTest.java │ └── test │ │ └── java │ │ └── org │ │ └── flyve │ │ └── inventory │ │ └── FunctionUnitTest.java ├── proguard-rules.pro └── build.gradle ├── gradle.properties ├── package.json ├── CREDITS ├── .gitignore ├── gradlew.bat ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── README.md └── gradlew /example_java/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /example_kotlin/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /.github/invite-contributors.yml: -------------------------------------------------------------------------------- 1 | isOutside: true 2 | # Team Name 3 | contributors -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':inventory', ':example_java', ':example_kotlin', ':app' -------------------------------------------------------------------------------- /docs/glpi_network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/docs/glpi_network.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example_kotlin/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_java/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /inventory/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | inventory 3 | (%1$s) - %2$s 4 | 5 | -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/android-inventory-library/HEAD/example_kotlin/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4608m 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.defaults.buildfeatures.buildconfig=true 5 | android.nonTransitiveRClass=false 6 | android.nonFinalResIds=false 7 | -------------------------------------------------------------------------------- /inventory/src/main/java/org/flyve/inventory/GenericFileProvider.java: -------------------------------------------------------------------------------- 1 | package org.flyve.inventory; 2 | 3 | 4 | import androidx.core.content.FileProvider; 5 | 6 | public class GenericFileProvider extends FileProvider { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /example_java/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /example_kotlin/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 02 16:44:40 CET 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /example_java/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /example_kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /example_kotlin/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example_kotlin 3 | Select the format to share 4 | 5 | XML 6 | JSON 7 | 8 | OK 9 | Cancel 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | #### Observed Results: 4 | 5 | 6 | 7 | #### Expected behavior: 8 | 9 | 10 | -------------------------------------------------------------------------------- /example_java/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example_java 3 | 4 | Select the format to share 5 | 6 | XML 7 | JSON 8 | 9 | OK 10 | Cancel 11 | 12 | -------------------------------------------------------------------------------- /inventory/src/main/assets/cpu_manufacturer.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"id": ["mt", "mediatek"], "name": "Mediatek"}, 3 | {"id": ["rk"], "name": "Rockchip"}, 4 | {"id": ["qcom", "msm", "apq"], "name": "Qualcomm"}, 5 | {"id": ["sc"], "name": "Spreadtrum"}, 6 | {"id": ["exynos", "smdk", "samsung"], "name": "Samsung"}, 7 | {"id": ["hi"], "name": "HiSilicon"}, 8 | {"id": ["pxa"], "name": "Marvell"}, 9 | {"id": ["amlogic"], "name": "Amlogic"} 10 | ] 11 | -------------------------------------------------------------------------------- /example_java/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /example_kotlin/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /example_kotlin/src/test/java/org/flyve/example_kotlin/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package org.flyve.example_kotlin 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /inventory/src/main/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /inventory/src/main/assets/camera_vendors.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"id": "ov", "name": "OmniVision"}, 3 | {"id": "imx", "name": "Sony"}, 4 | {"id": "isx", "name": "Sony"}, 5 | {"id": "s5k", "name": "Samsung"}, 6 | {"id": "s5c", "name": "Samsung"}, 7 | {"id": "gc", "name": "GalaxyCore"}, 8 | {"id": "sp", "name": "SuperPix"}, 9 | {"id": "hi", "name": "Hynix"}, 10 | {"id": "hm", "name": "Himax"}, 11 | {"id": "siv", "name": "Seti"}, 12 | {"id": "t4k", "name": "Toshiba"}, 13 | {"id": "mn", "name": "Panasonic"}, 14 | {"id": "jx", "name": "SiliconOptronics"}, 15 | {"id": "ar", "name": "OnSemi"}, 16 | {"id": "sr", "name": "Siliconfile"}, 17 | {"id": "m", "name": "Fujitsu"} 18 | ] 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@teclib/android-inventory-library", 3 | "version": "1.6.1", 4 | "description": "Android Inventory Library", 5 | "main": "index.js", 6 | "scripts": { 7 | "release": "standard-version -t ''" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/glpi-project/android-inventory-library.git" 12 | }, 13 | "keywords": [ 14 | "Android", 15 | "inventory", 16 | "library", 17 | "agent", 18 | "teclib" 19 | ], 20 | "author": "Ivan Del Pino (https://flyve-mdm.com)", 21 | "license": "GPL-3.0", 22 | "bugs": { 23 | "url": "https://github.com/glpi-project/android-inventory-library/issues" 24 | }, 25 | "homepage": "https://github.com/glpi-project/android-inventory-library#readme" 26 | } 27 | -------------------------------------------------------------------------------- /example_java/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /example_kotlin/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /example_kotlin/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | In this file is liste every person who has contributed to the project, 2 | whether to fix a typo or to implement an awesome feature. 3 | 4 | You made this project. 5 | 6 | To everyone Thank you. 7 | 8 | 9 | Legend: 10 | 11 | - N: name 12 | - E: email 13 | - D: description 14 | - U: GitHub user 15 | --------------------------------------------------------------------------------- 16 | 17 | N: Rafael Hernández 18 | E: rhernandez@teclib.com 19 | D: Android/iOS Developer 20 | U: rafaelje 21 | 22 | N: Iván del Pino 23 | E: idelpino@teclib.com 24 | D: Android Developer 25 | U: Ivans51 26 | 27 | N: Naylin Medina 28 | E: nmedina@teclib.com 29 | D: Technical Writer 30 | U: Naylin15 31 | 32 | N: Alexander Salas 33 | E: asalas@teclib.com 34 | D: Project Manager 35 | U: ajsb85 36 | 37 | N: Kevin Esaa 38 | U: kevinesaa 39 | 40 | N: Alan Grosz 41 | U: lalofrosz 42 | 43 | N: José Espinoza 44 | E: josemespiz@gmail.com 45 | U: JMEspiz 46 | 47 | E: mohd.hussayn@gmail.com 48 | U: MohamedHussein02 -------------------------------------------------------------------------------- /inventory/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/ajsb85/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Android Studio 3 | .idea 4 | .idea/libraries 5 | .idea/workspace.xml 6 | .idea/tasks.xml 7 | .idea/datasources.xml 8 | .idea/dataSources.ids 9 | .idea/.name 10 | .idea/gradle.xml 11 | .idea/modules.xml 12 | .idea/vcs.xml 13 | app/app.iml 14 | 15 | *.apk 16 | *.ap_ 17 | 18 | # files for the dex VM 19 | *.dex 20 | 21 | # Java class files 22 | *.class 23 | 24 | # built native files (uncomment if you build your own) 25 | # *.o 26 | # *.so 27 | 28 | # generated files 29 | bin/ 30 | gen/ 31 | 32 | # Ignore gradle files 33 | .gradle/ 34 | build/ 35 | 36 | # Local configuration file (sdk path, etc) 37 | local.properties 38 | 39 | # Proguard folder generated by Eclipse 40 | proguard/ 41 | 42 | # Eclipse Metadata 43 | .metadata/ 44 | 45 | # Mac OS X clutter 46 | *.DS_Store 47 | 48 | # Windows clutter 49 | Thumbs.db 50 | 51 | # Node.js 52 | node_modules 53 | 54 | # Miscellaneous 55 | *.iml 56 | /local.properties 57 | /.idea/workspace.xml 58 | /.idea/libraries 59 | .DS_Store 60 | /build 61 | /inventory/build/ 62 | /captures 63 | .externalNativeBuild 64 | /development 65 | 66 | /vendor/* 67 | -------------------------------------------------------------------------------- /.github/label-commenter-config.yml: -------------------------------------------------------------------------------- 1 | labels: 2 | - name: "invalid" 3 | labeled: 4 | issue: 5 | body: | 6 | This issue has been closed because you did not provide the requested information. 7 | action: "close" 8 | - name: "support" 9 | labeled: 10 | issue: 11 | body: | 12 | This issue has been closed as we only track bugs here. 13 | 14 | You can get community support on [forums](https://forum.glpi-project.org/) or you can consider [taking a subscription](https://glpi-project.org/subscriptions/) to get professional support. 15 | You can also [contact GLPI editor team](https://portal.glpi-network.com/contact-us) directly. 16 | action: close 17 | - name: "feature suggestion" 18 | labeled: 19 | issue: 20 | body: | 21 | This issue has been closed as we only track bugs here. 22 | 23 | You can open a topic to discuss with community about this enhancement on [suggestion website](https://glpi.userecho.com/). 24 | You can also [contact GLPI editor team](https://portal.glpi-network.com/contact-us) directly if you are willing to sponsor this feature. 25 | action: close 26 | -------------------------------------------------------------------------------- /example_java/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /example_java/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdk 34 5 | namespace = "org.flyve.example_java" 6 | 7 | defaultConfig { 8 | applicationId "org.flyve.example_java" 9 | minSdkVersion 21 10 | targetSdkVersion 34 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | lint { 25 | abortOnError false 26 | checkReleaseBuilds false 27 | } 28 | 29 | } 30 | 31 | dependencies { 32 | implementation fileTree(include: ['*.jar'], dir: 'libs') 33 | implementation 'androidx.appcompat:appcompat:1.2.0' 34 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1' 35 | testImplementation 'junit:junit:4.13.2' 36 | androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { 37 | exclude group: 'com.android.support', module: 'support-annotations' 38 | }) 39 | implementation project(':inventory') 40 | } 41 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | repository: 2 | name: android-inventory-library 3 | description: Inventory client library written in Java for developing applications on Android 4 | homepage: http://flyve.org/android-inventory-library/ 5 | topics: flyve-mdm, android-inventory, library 6 | private: false 7 | has_issues: true 8 | has_wiki: false 9 | has_downloads: true 10 | default_branch: develop 11 | allow_squash_merge: true 12 | allow_merge_commit: false 13 | allow_rebase_merge: true 14 | labels: 15 | - name: bug 16 | color: f44336 17 | - name: build 18 | color: 795548 19 | - name: cherry-pick 20 | color: af1c46 21 | - name: ci 22 | color: fbca04 23 | - name: documentation 24 | color: 607d8b 25 | - name: duplicate 26 | color: 9e9e9e 27 | - name: feature 28 | color: 3f51b5 29 | - name: hacktoberfest 30 | color: ff625f 31 | - name: invalid 32 | color: cddc39 33 | - name: performance 34 | color: 009688 35 | - name: question 36 | color: ff5722 37 | - name: refactor 38 | color: 9c27b0 39 | - name: style 40 | color: 2196f3 41 | - name: test 42 | color: 8bc34a 43 | - name: wontfix 44 | color: ffffff 45 | - name: help wanted 46 | color: 33aa3f 47 | - name: good first issue 48 | color: 7057ff 49 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Pull Request 2 | 3 | ## Description 4 | Provide a brief description of the changes made in this pull request. Include the problem this fixes or the feature it implements. 5 | 6 | ### Type of Change 7 | - [ ] Bug fix (non-breaking change that fixes an issue) 8 | - [ ] New feature (non-breaking change that adds functionality) 9 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 10 | - [ ] Documentation update (improvements or additions to documentation) 11 | 12 | --- 13 | 14 | ## Related Issues 15 | List any related issues that are fixed or addressed by this pull request. 16 | 17 | Fixes: # [issue number] 18 | 19 | Closes: # [issue number] 20 | 21 | --- 22 | 23 | ## Testing 24 | Describe the testing performed for these changes: 25 | - Device/Emulator: [e.g., Pixel 5, Android 12] 26 | - Test Cases: [e.g., tested login functionality, navigation, etc.] 27 | - Results: [e.g., passed all tests, fixed rendering issue] 28 | 29 | --- 30 | 31 | ## Screenshots/Recordings 32 | If applicable, attach screenshots or recordings of the changes made. 33 | 34 | --- 35 | 36 | ## Checklist 37 | - [ ] I have tested these changes locally. 38 | - [ ] I have added tests that prove my fix is effective or my feature works. 39 | - [ ] I have updated documentation (if necessary). 40 | - [ ] I have ensured that this PR does not introduce unintended breaking changes. 41 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Bug_report.md: -------------------------------------------------------------------------------- 1 | # Bug Report 2 | 3 | A clear and concise description of the bug. 4 | 5 | ## Steps to Reproduce 6 | Steps to reproduce the behavior: 7 | 1. Go to '...' 8 | 2. Perform action '...' 9 | 3. See error '...' 10 | 11 | ## Expected Behavior 12 | A clear and concise description of what you expected to happen. 13 | 14 | ## Actual Behavior 15 | Describe what actually happens instead. 16 | 17 | ## Screenshots 18 | If applicable, add screenshots to help explain your problem. 19 | 20 | ## Environment Details 21 | - **Library Version:** [e.g., 1.2.3] 22 | - **Android Version:** [e.g., Android 11] 23 | - **Device:** [e.g., Pixel 5] 24 | - **Any other relevant details:** [e.g., build environment, dependencies] 25 | 26 | ## Logs 27 | Please provide relevant logcat output or any other logs that may help in diagnosing the issue. 28 | 29 | ```text 30 | # Paste logs here 31 | ``` 32 | 33 | ## Additional context 34 | Add any other context about the problem here, including links to documentation or issues that might be related. 35 | 36 | ## Possible Solution 37 | (Optional) If you have an idea of how to fix the bug, describe it here. 38 | 39 | ## Checklist 40 | - [ ] I have searched existing issues to see if the bug has already been reported. 41 | - [ ] I have provided sufficient details to reproduce the issue. 42 | - [ ] I have included relevant logs/screenshots. 43 | 44 | 45 | -------------------------------------------------------------------------------- /example_kotlin/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdk 34 6 | namespace = "org.flyve.example_kotlin" 7 | 8 | defaultConfig { 9 | applicationId "org.flyve.example_kotlin" 10 | minSdkVersion 21 11 | targetSdkVersion 34 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 16 | 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | lint { 26 | abortOnError false 27 | checkReleaseBuilds false 28 | } 29 | 30 | compileOptions { 31 | sourceCompatibility = JavaVersion.VERSION_17 32 | targetCompatibility = JavaVersion.VERSION_17 33 | } 34 | 35 | kotlinOptions { 36 | jvmTarget = JavaVersion.VERSION_17 37 | } 38 | 39 | } 40 | 41 | dependencies { 42 | implementation fileTree(include: ['*.jar'], dir: 'libs') 43 | implementation 'androidx.appcompat:appcompat:1.2.0' 44 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1' 45 | testImplementation 'junit:junit:4.13.2' 46 | androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { 47 | exclude group: 'com.android.support', module: 'support-annotations' 48 | }) 49 | implementation 'org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.50' 50 | implementation project(':inventory') 51 | } 52 | -------------------------------------------------------------------------------- /example_java/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "464602262569", 4 | "firebase_url": "https://android-inventory-librar-6398c.firebaseio.com", 5 | "project_id": "android-inventory-librar-6398c", 6 | "storage_bucket": "android-inventory-librar-6398c.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:464602262569:android:032a5675fb60ca1fa80038", 12 | "android_client_info": { 13 | "package_name": "org.flyve.example_java" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "464602262569-iqkse0dn6u58mncsg7fm9v51nn4jpqri.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "org.flyve.example_java", 22 | "certificate_hash": "4287d795b3ca467f0920cca3c9e461129d5f6af1" 23 | } 24 | }, 25 | { 26 | "client_id": "464602262569-vsds504dcuk6kaqhm3bv7jbtcednae0q.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "AIzaSyDaC1lyN-scvtY5eN_vQtoHLKs6N86sLeE" 33 | } 34 | ], 35 | "services": { 36 | "appinvite_service": { 37 | "other_platform_oauth_client": [ 38 | { 39 | "client_id": "464602262569-vsds504dcuk6kaqhm3bv7jbtcednae0q.apps.googleusercontent.com", 40 | "client_type": 3 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | ], 47 | "configuration_version": "1" 48 | } -------------------------------------------------------------------------------- /inventory/src/main/java/org/flyve/inventory/categories/Processes.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory.categories; 28 | 29 | public class Processes 30 | extends Category { 31 | 32 | public Processes(String xType, String tagName) { 33 | super(xType, tagName); 34 | // TODO review how to get all the processes 35 | } 36 | 37 | /** 38 | * 39 | */ 40 | private static final long serialVersionUID = 5399654900099889897L; 41 | 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /example_java/src/test/java/org/flyve/example_java/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.example_java; 28 | 29 | import org.junit.Test; 30 | 31 | import static org.junit.Assert.*; 32 | 33 | /** 34 | * Example local unit test, which will execute on the development machine (host). 35 | * 36 | * @see Testing documentation 37 | */ 38 | public class ExampleUnitTest { 39 | @Test 40 | public void addition_isCorrect() throws Exception { 41 | assertEquals(4, 2 + 2); 42 | } 43 | } -------------------------------------------------------------------------------- /inventory/src/main/assets/cpu_family.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"vid": "0x41", "id": "0xc05", "name": "Cortex-A5"}, 3 | {"vid": "0x41", "id": "0xc07", "name": "Cortex-A7"}, 4 | {"vid": "0x41", "id": "0xc08", "name": "Cortex-A8"}, 5 | {"vid": "0x41", "id": "0xc09", "name": "Cortex-A9"}, 6 | 7 | {"vid": "0x41", "id": "0xc0d", "name": "Cortex-A12"}, 8 | {"vid": "0x41", "id": "0xc0e", "name": "Cortex-A17"}, 9 | {"vid": "0x41", "id": "0xc0f", "name": "Cortex-A15"}, 10 | 11 | {"vid": "0x41", "id": "0xd01", "name": "Cortex-A32"}, 12 | {"vid": "0x41", "id": "0xd01", "name": "Cortex-A32"}, 13 | {"vid": "0x41", "id": "0xd03", "name": "Cortex-A53"}, 14 | {"vid": "0x41", "id": "0xd04", "name": "Cortex-A35"}, 15 | {"vid": "0x41", "id": "0xd05", "name": "Cortex-A55"}, 16 | {"vid": "0x41", "id": "0xd07", "name": "Cortex-A57"}, 17 | {"vid": "0x41", "id": "0xd08", "name": "Cortex-A72"}, 18 | {"vid": "0x41", "id": "0xd09", "name": "Cortex-A73"}, 19 | 20 | {"vid": "0x4e", "id": "0x0", "name": "Denver"}, 21 | 22 | {"vid": "0x51", "id": "0xf", "name": "Scorpion"}, 23 | {"vid": "0x51", "id": "0x2d", "name": "Scorpion"}, 24 | {"vid": "0x51", "id": "0x4d", "name": "Krait"}, 25 | {"vid": "0x51", "id": "0x6f", "name": "Krait"}, 26 | 27 | {"vid": "0x51", "id": "0x201", "name": "Kryo"}, 28 | {"vid": "0x51", "id": "0x205", "name": "Kryo"}, 29 | {"vid": "0x51", "id": "0x211", "name": "Kryo"}, 30 | 31 | {"vid": "0x51", "id": "0x800", "name": "Kryo-2xx"}, 32 | {"vid": "0x51", "id": "0x801", "name": "Kryo-2xx"}, 33 | 34 | {"vid": "0x51", "id": "0x802", "name": "Kryo-3xx"}, 35 | {"vid": "0x51", "id": "0x803", "name": "Kryo-3xx"}, 36 | 37 | {"vid": "0x53", "id": "0x1", "name": "Mongoose"}, 38 | {"vid": "0x53", "id": "0x2", "name": "Mongoose-M3"}, 39 | 40 | {"vid": "0x69", "id": "0x1", "name": "Intel"} 41 | ] 42 | -------------------------------------------------------------------------------- /inventory/src/main/java/org/flyve/inventory/FlyveException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | public class FlyveException extends Exception 30 | { 31 | 32 | /** 33 | * Constructor of the class FlyveException 34 | * Call the superclass constructor 35 | */ 36 | public FlyveException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * The superclass constructor with a matching argument is called 42 | * @param message String 43 | * @param cause Throwable 44 | */ 45 | public FlyveException(String message, Throwable cause) 46 | { 47 | super(message, cause); 48 | } 49 | } -------------------------------------------------------------------------------- /inventory/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.library' 3 | } 4 | 5 | android { 6 | compileSdk 34 7 | 8 | defaultConfig { 9 | minSdkVersion 21 10 | targetSdkVersion 34 11 | 12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 13 | multiDexEnabled true 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | debug { 21 | minifyEnabled false 22 | enableUnitTestCoverage true 23 | enableAndroidTestCoverage true 24 | } 25 | } 26 | 27 | buildFeatures { 28 | viewBinding true 29 | } 30 | namespace 'org.flyve.inventory' 31 | } 32 | 33 | configurations { 34 | javadocDeps 35 | } 36 | 37 | 38 | dependencies { 39 | implementation fileTree(dir: 'libs', include: ['*.jar']) 40 | 41 | androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { 42 | exclude group: 'com.android.support', module: 'support-annotations' 43 | }) 44 | testImplementation 'androidx.test:runner:1.6.2' // Or latest version 45 | testImplementation 'androidx.test:core:1.3.0' 46 | 47 | implementation 'com.orhanobut:logger:2.2.0' 48 | implementation 'androidx.appcompat:appcompat:1.2.0' 49 | implementation 'androidx.core:core:1.3.1' 50 | implementation 'com.android.support:multidex:2.0.1' 51 | 52 | javadocDeps 'com.orhanobut:logger:2.2.0' 53 | javadocDeps 'androidx.appcompat:appcompat:1.2.0' 54 | javadocDeps 'androidx.core:core:1.3.1' 55 | javadocDeps 'com.android.support:multidex:2.0.1' 56 | } 57 | 58 | 59 | Properties properties = new Properties() 60 | if(project.rootProject.file('local.properties').exists()) { 61 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) 62 | } 63 | -------------------------------------------------------------------------------- /inventory/src/androidTest/java/org/flyve/inventory/UserTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import android.content.Context; 30 | import androidx.test.platform.app.InstrumentationRegistry; 31 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 32 | 33 | import org.flyve.inventory.categories.User; 34 | import org.junit.Test; 35 | import org.junit.runner.RunWith; 36 | 37 | import static org.junit.Assert.assertNotEquals; 38 | 39 | @RunWith(AndroidJUnit4ClassRunner.class) 40 | public class UserTest { 41 | 42 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 43 | 44 | @Test 45 | public void getClassTest() { 46 | User user = new User(appContext); 47 | assertNotEquals("", user.getUserName()); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /example_java/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /example_kotlin/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /inventory/src/androidTest/java/org/flyve/inventory/ModemsTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import android.content.Context; 30 | import androidx.test.platform.app.InstrumentationRegistry; 31 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 32 | import org.flyve.inventory.categories.Modems; 33 | import org.junit.Test; 34 | import org.junit.runner.RunWith; 35 | 36 | import static org.junit.Assert.assertNotEquals; 37 | 38 | @RunWith(AndroidJUnit4ClassRunner.class) 39 | public class ModemsTest { 40 | 41 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 42 | 43 | @Test 44 | public void getDriver() { 45 | for (String imei : new Modems(appContext).getIMEI()) { 46 | assertNotEquals("", imei); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /example_kotlin/src/androidTest/java/org/flyve/example_kotlin/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.example_kotlin 28 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner 29 | import org.junit.Assert.assertEquals 30 | import org.junit.Test 31 | import org.junit.runner.RunWith 32 | 33 | /** 34 | * Instrumented test, which will execute on an Android device. 35 | * 36 | * See [testing documentation](http://d.android.com/tools/testing). 37 | */ 38 | @RunWith(AndroidJUnit4ClassRunner::class) 39 | class ExampleInstrumentedTest { 40 | @Test 41 | fun useAppContext() { 42 | // Context of the app under test. 43 | val context= androidx.test.platform.app.InstrumentationRegistry.getInstrumentation().targetContext 44 | assertEquals("org.flyve.example_kotlin", context.packageName) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /inventory/src/main/java/org/flyve/inventory/usbManager/Validation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory.usbManager; 28 | 29 | import java.io.File; 30 | 31 | class Validation { 32 | Validation() { 33 | } 34 | 35 | public boolean isValidUsbDeviceCandidate(File file) { 36 | if (!file.exists()) { 37 | return false; 38 | } 39 | if (!file.isDirectory()) { 40 | return false; 41 | } 42 | if (".".equals(file.getName()) || "..".equals(file.getName())) { 43 | return false; 44 | } 45 | return true; 46 | } 47 | 48 | public File[] getListOfChildren( File path) { 49 | if (path.exists() && path.isDirectory() && path.listFiles() != null) { 50 | return path.listFiles(); 51 | } 52 | return new File[0]; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /inventory/src/androidTest/java/org/flyve/inventory/VideosTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import android.content.Context; 30 | 31 | import androidx.test.platform.app.InstrumentationRegistry; 32 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 33 | 34 | import org.flyve.inventory.categories.Videos; 35 | 36 | import org.junit.Test; 37 | import org.junit.runner.RunWith; 38 | 39 | import static org.junit.Assert.assertNotEquals; 40 | 41 | @RunWith(AndroidJUnit4ClassRunner.class) 42 | public class VideosTest { 43 | 44 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 45 | 46 | @Test 47 | public void getResolution() throws Exception { 48 | Videos videos = new Videos(appContext); 49 | assertNotEquals("", videos.getResolution()); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /inventory/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 32 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /inventory/src/androidTest/java/org/flyve/inventory/ControllersTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import android.content.Context; 30 | 31 | import androidx.test.platform.app.InstrumentationRegistry; 32 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 33 | 34 | import org.flyve.inventory.categories.Controllers; 35 | import org.junit.Test; 36 | import org.junit.runner.RunWith; 37 | 38 | import java.util.ArrayList; 39 | 40 | import static org.junit.Assert.assertNotEquals; 41 | 42 | @RunWith(AndroidJUnit4ClassRunner.class) 43 | public class ControllersTest { 44 | 45 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 46 | 47 | @Test 48 | public void getDriver() { 49 | ArrayList drivers = new Controllers(appContext).getDrivers(); 50 | for (String driver : drivers) { 51 | assertNotEquals("", driver); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /example_java/src/androidTest/java/org/flyve/example_java/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.example_java; 28 | 29 | import android.content.Context; 30 | 31 | import androidx.test.platform.app.InstrumentationRegistry; 32 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 33 | 34 | import org.junit.Test; 35 | import org.junit.runner.RunWith; 36 | 37 | import static org.junit.Assert.*; 38 | 39 | /** 40 | * Instrumented test, which will execute on an Android device. 41 | * 42 | * @see Testing documentation 43 | */ 44 | @RunWith(AndroidJUnit4ClassRunner.class) 45 | public class ExampleInstrumentedTest { 46 | @Test 47 | public void useAppContext() throws Exception { 48 | // Context of the app under test. 49 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 50 | 51 | assertEquals("org.flyve.example_java", appContext.getPackageName()); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /inventory/src/androidTest/java/org/flyve/inventory/InputsTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import android.content.Context; 30 | 31 | import androidx.test.platform.app.InstrumentationRegistry; 32 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 33 | import org.flyve.inventory.categories.Inputs; 34 | 35 | import org.junit.Test; 36 | import org.junit.runner.RunWith; 37 | 38 | import static org.junit.Assert.assertNotEquals; 39 | import static org.junit.Assert.assertNotNull; 40 | 41 | @RunWith(AndroidJUnit4ClassRunner.class) 42 | public class InputsTest { 43 | 44 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 45 | 46 | @Test 47 | public void getKeyboard() throws Exception { 48 | Inputs inputs = new Inputs(appContext); 49 | assertNotNull(inputs.getKeyboard()); 50 | } 51 | 52 | @Test 53 | public void getTouchscreen() throws Exception { 54 | Inputs inputs = new Inputs(appContext); 55 | assertNotEquals("", inputs.getTouchscreen()); 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /inventory/src/androidTest/java/org/flyve/inventory/MemoryTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import android.content.Context; 30 | import androidx.test.platform.app.InstrumentationRegistry; 31 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 32 | 33 | import org.flyve.inventory.categories.Memory; 34 | 35 | import org.junit.Test; 36 | import org.junit.runner.RunWith; 37 | 38 | import static org.junit.Assert.assertNotEquals; 39 | 40 | @RunWith(AndroidJUnit4ClassRunner.class) 41 | public class MemoryTest { 42 | 43 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 44 | 45 | @Test 46 | public void getCapacity() throws Exception { 47 | Memory memory = new Memory(appContext); 48 | assertNotEquals("", memory.getCapacity()); 49 | } 50 | 51 | @Test 52 | public void getType() throws Exception { 53 | Memory memory = new Memory(appContext); 54 | assertNotEquals("", memory.getType()); 55 | } 56 | 57 | @Test 58 | public void getSpeed() throws Exception { 59 | Memory memory = new Memory(appContext); 60 | assertNotEquals("", memory.getSpeed()); 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /inventory/src/test/java/org/flyve/inventory/FunctionUnitTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import org.flyve.inventory.categories.StringUtils; 30 | 31 | import org.junit.Test; 32 | 33 | import java.util.ArrayList; 34 | 35 | import static org.junit.Assert.assertTrue; 36 | 37 | public class FunctionUnitTest { 38 | 39 | @Test 40 | public void createIP_correct() throws Exception { 41 | int ip = 19216801; 42 | String formatIp = StringUtils.intToIp(ip); 43 | assertTrue(formatIp.split("\\.").length==4); 44 | } 45 | 46 | @Test 47 | public void intToByte_correct() throws Exception { 48 | int byteNumber = 19216801; 49 | 50 | try { 51 | byte[] byteFormat = StringUtils.intToByte(byteNumber); 52 | assertTrue(true); 53 | } catch (Exception ex) { 54 | assertTrue(false); 55 | } 56 | } 57 | 58 | @Test 59 | public void join_correct() throws Exception { 60 | ArrayList arr = new ArrayList(); 61 | for (int i =2; i <= 12; i++) { 62 | arr.add(String.valueOf(i*12345)); 63 | } 64 | 65 | assertTrue(StringUtils.join(arr, "#").split("#").length==11); 66 | } 67 | } -------------------------------------------------------------------------------- /inventory/src/main/java/org/flyve/inventory/usbManager/UsbProperty.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory.usbManager; 28 | 29 | public enum UsbProperty { 30 | PID("idProduct"), 31 | VID("idVendor"), 32 | MANUFACTURER("manufacturer"), 33 | PRODUCT("product"), 34 | VERSION("version"), 35 | DEVICE_CLASS("bDeviceClass"), 36 | DEVICE_SUBCLASS("bDeviceSubClass"), 37 | DEVICE_NUMBER("devnum"), 38 | DEVICE_PROTOCOL("bDeviceProtocol"), 39 | MAX_POWER("bMaxPower"), 40 | BUS_NUMBER("busnum"), 41 | SERIAL("serial"), 42 | SPEED("speed"), 43 | SUPPORTS_AUTOSUSPEND("supports_autosuspend"), 44 | AUTHORIZED("authorized"), 45 | MODALIAS("modalias"), 46 | ALTERNATIVE_SETTING("bAlternateSetting"), 47 | NUM_INTERFACES("bNumInterfaces"), 48 | NUM_ENDPOINTS("bNumEndpoints"), 49 | INTERFACE("interface"), 50 | INTERFACE_CLASS("bInterfaceClass"), 51 | INTERFACE_NUMBER("bInterfaceNumber"), 52 | INTERFACE_PROTOCOL("bInterfaceProtocol"), 53 | INTERFACE_SUBCLASS("bInterfaceSubClass"); 54 | 55 | private final String fileName; 56 | 57 | private UsbProperty(String fileName) { 58 | this.fileName = fileName; 59 | } 60 | 61 | public String getFileName() { 62 | return this.fileName; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /inventory/src/androidTest/java/org/flyve/inventory/BluetoothTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import android.content.Context; 30 | import androidx.test.platform.app.InstrumentationRegistry; 31 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 32 | 33 | import org.flyve.inventory.categories.Bluetooth; 34 | 35 | import org.junit.Test; 36 | import org.junit.runner.RunWith; 37 | 38 | import static org.junit.Assert.assertNotEquals; 39 | import static org.junit.Assert.assertTrue; 40 | 41 | @RunWith(AndroidJUnit4ClassRunner.class) 42 | public class BluetoothTest { 43 | 44 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 45 | 46 | @Test 47 | public void getHardware_address() throws Exception { 48 | if(!Utils.isEmulator()) { 49 | Bluetooth bluetooth = new Bluetooth(appContext); 50 | assertNotEquals("", bluetooth.getHardwareAddress()); 51 | } else { 52 | assertTrue(true); 53 | } 54 | } 55 | 56 | @Test 57 | public void getName() throws Exception { 58 | if(!Utils.isEmulator()) { 59 | Bluetooth bluetooth = new Bluetooth(appContext); 60 | assertNotEquals("", bluetooth.getName()); 61 | } else { 62 | assertTrue(true); 63 | } 64 | 65 | 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /inventory/src/main/java/org/flyve/inventory/usbManager/SysBusUsbManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory.usbManager; 28 | 29 | import java.io.File; 30 | import java.util.Collections; 31 | import java.util.HashMap; 32 | import java.util.Map; 33 | 34 | public class SysBusUsbManager { 35 | private final HashMap myUsbDevices; 36 | private final SysBusUsbDeviceFactory sysBusUsbDeviceFactory; 37 | private final String usbSysPath; 38 | private final Validation validation; 39 | 40 | public SysBusUsbManager() { 41 | this("/sys/bus/usb/devices/"); 42 | } 43 | 44 | public SysBusUsbManager(String usbSysPath) { 45 | this.usbSysPath = usbSysPath; 46 | this.myUsbDevices = new HashMap<>(); 47 | this.sysBusUsbDeviceFactory = new SysBusUsbDeviceFactory(); 48 | this.validation = new Validation(); 49 | } 50 | 51 | public Map getUsbDevices() { 52 | populateList(this.usbSysPath); 53 | return Collections.unmodifiableMap(this.myUsbDevices); 54 | } 55 | 56 | private void populateList(String path) { 57 | this.myUsbDevices.clear(); 58 | for (File child : this.validation.getListOfChildren(new File(path))) { 59 | if (this.validation.isValidUsbDeviceCandidate(child)) { 60 | SysBusUsbDevice usb = this.sysBusUsbDeviceFactory.create(child.getAbsoluteFile()); 61 | if (usb != null) { 62 | this.myUsbDevices.put(child.getName(), usb); 63 | } 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /inventory/src/androidTest/java/org/flyve/inventory/BatteryTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import android.content.Context; 30 | 31 | import androidx.test.platform.app.InstrumentationRegistry; 32 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 33 | 34 | import org.flyve.inventory.categories.Battery; 35 | import org.junit.Test; 36 | import org.junit.runner.RunWith; 37 | 38 | import static org.junit.Assert.assertNotEquals; 39 | 40 | @RunWith(AndroidJUnit4ClassRunner.class) 41 | public class BatteryTest { 42 | 43 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 44 | 45 | @Test 46 | public void getTechnology() { 47 | assertNotEquals("", new Battery(appContext).getTechnology()); 48 | } 49 | 50 | @Test 51 | public void getTemperature() { 52 | assertNotEquals("", new Battery(appContext).getTemperature()); 53 | } 54 | 55 | @Test 56 | public void getVoltage() { 57 | assertNotEquals("", new Battery(appContext).getVoltage()); 58 | } 59 | 60 | @Test 61 | public void getLevel() { 62 | assertNotEquals("", new Battery(appContext).getLevel()); 63 | } 64 | 65 | @Test 66 | public void getBatteryHealth() { 67 | assertNotEquals("", new Battery(appContext).getBatteryHealth()); 68 | } 69 | 70 | @Test 71 | public void getBatteryStatus() { 72 | assertNotEquals("", new Battery(appContext).getBatteryStatus()); 73 | } 74 | 75 | @Test 76 | public void getCapacity() { 77 | assertNotEquals("", new Battery(appContext).getCapacity()); 78 | } 79 | } -------------------------------------------------------------------------------- /inventory/src/androidTest/java/org/flyve/inventory/UsbTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LICENSE 3 | * 4 | * This file is part of Flyve MDM Inventory Library for Android. 5 | * 6 | * Inventory Library for Android is a subproject of Flyve MDM. 7 | * Flyve MDM is a mobile device management software. 8 | * 9 | * Flyve MDM is free software: you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 3 12 | * of the License, or (at your option) any later version. 13 | * 14 | * Flyve MDM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * --------------------------------------------------------------------- 19 | * @copyright Copyright © 2018 Teclib. All rights reserved. 20 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html 21 | * @link https://github.com/flyve-mdm/android-inventory-library 22 | * @link https://flyve-mdm.com 23 | * @link http://flyve.org/android-inventory-library 24 | * --------------------------------------------------------------------- 25 | */ 26 | 27 | package org.flyve.inventory; 28 | 29 | import android.content.Context; 30 | import androidx.test.platform.app.InstrumentationRegistry; 31 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; 32 | 33 | import org.flyve.inventory.categories.Usb; 34 | import org.junit.Test; 35 | import org.junit.runner.RunWith; 36 | 37 | import static org.junit.Assert.assertNotEquals; 38 | 39 | @RunWith(AndroidJUnit4ClassRunner.class) 40 | public class UsbTest { 41 | 42 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 43 | 44 | @Test 45 | public void getClassTest() { 46 | Usb usb = new Usb(appContext); 47 | assertNotEquals("", usb.getServiceClass()); 48 | } 49 | 50 | @Test 51 | public void getProductid() { 52 | Usb usb = new Usb(appContext); 53 | assertNotEquals("", usb.getPid()); 54 | } 55 | 56 | @Test 57 | public void getVendorid() { 58 | Usb usb = new Usb(appContext); 59 | assertNotEquals("", usb.getVid()); 60 | } 61 | 62 | @Test 63 | public void getSubclass() { 64 | Usb usb = new Usb(appContext); 65 | assertNotEquals("", usb.getDeviceSubClass()); 66 | } 67 | 68 | @Test 69 | public void getManufacturer() { 70 | Usb usb = new Usb(appContext); 71 | assertNotEquals("", usb.getReportedProductName()); 72 | } 73 | 74 | @Test 75 | public void getCaption() { 76 | Usb usb = new Usb(appContext); 77 | assertNotEquals("", usb.getUsbVersion()); 78 | } 79 | 80 | @Test 81 | public void getSerialNumber() { 82 | Usb usb = new Usb(appContext); 83 | assertNotEquals("", usb.getSerialNumber()); 84 | } 85 | 86 | } -------------------------------------------------------------------------------- /example_kotlin/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 21 | 22 | 34 | 35 | 40 | 41 | 46 | 47 |