├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── ic_qr.png
│ │ │ │ ├── github.png
│ │ │ │ ├── readme.png
│ │ │ │ ├── ic_launcher_fore.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── ic_notification_white.png
│ │ │ │ ├── empty_tall_divider.xml
│ │ │ │ ├── radius_btn_blue.xml
│ │ │ │ ├── radius_btn_yellow.xml
│ │ │ │ ├── separator_line.xml
│ │ │ │ └── checkbox_state.xml
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── ci_check.png
│ │ │ │ ├── ic_about.png
│ │ │ │ ├── ic_check.png
│ │ │ │ ├── ic_help.png
│ │ │ │ ├── ic_info.png
│ │ │ │ ├── ic_stat.png
│ │ │ │ ├── ci_uncheck.png
│ │ │ │ ├── ic_uncheck.png
│ │ │ │ ├── logoteclib.png
│ │ │ │ ├── header_menu.png
│ │ │ │ ├── ic_feedback.png
│ │ │ │ ├── logoinventory.png
│ │ │ │ ├── ic_option_white_24dp.png
│ │ │ │ ├── ic_share_white_24dp.png
│ │ │ │ ├── ic_schedule_white_24dp.png
│ │ │ │ └── ic_setting_white_24dp.png
│ │ │ ├── drawable-mdpi
│ │ │ │ └── ic_stat.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ └── ic_stat.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ └── ic_stat.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ │ └── ic_stat.png
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── anim
│ │ │ │ ├── from_bottom.xml
│ │ │ │ ├── from_top.xml
│ │ │ │ ├── rotate_fab_clock.xml
│ │ │ │ ├── rotate_fab_anticlock.xml
│ │ │ │ ├── fab_open.xml
│ │ │ │ └── fab_close.xml
│ │ │ ├── layout
│ │ │ │ ├── pref_dialog_url.xml
│ │ │ │ ├── spinner_item.xml
│ │ │ │ ├── fragment_help.xml
│ │ │ │ ├── list_item.xml
│ │ │ │ ├── fragment_inventory_tab.xml
│ │ │ │ ├── list_item_home_header.xml
│ │ │ │ ├── toolbar.xml
│ │ │ │ ├── activity_scan.xml
│ │ │ │ ├── list_item_home_button.xml
│ │ │ │ ├── custom_preference_category.xml
│ │ │ │ ├── custom_checkbox.xml
│ │ │ │ ├── list_item_inventory_parent.xml
│ │ │ │ ├── list_item_home_check.xml
│ │ │ │ ├── pref_widget_url.xml
│ │ │ │ ├── dialog_title.xml
│ │ │ │ ├── activity_splash.xml
│ │ │ │ ├── list_item_drawer.xml
│ │ │ │ ├── fragment_about.xml
│ │ │ │ ├── list_item_inventory_child.xml
│ │ │ │ ├── activity_list_categories.xml
│ │ │ │ ├── fragment_home.xml
│ │ │ │ ├── activity_permission.xml
│ │ │ │ ├── activity_list_servers.xml
│ │ │ │ ├── list_item_servers.xml
│ │ │ │ ├── list_item_categories.xml
│ │ │ │ ├── activity_inventory.xml
│ │ │ │ └── dialog_list_servers.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── menu
│ │ │ │ └── menu_main.xml
│ │ │ ├── values
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── restrictions_values.xml
│ │ │ │ └── styles.xml
│ │ │ └── xml
│ │ │ │ ├── inventory_parameters.xml
│ │ │ │ ├── app_restrictions.xml
│ │ │ │ └── global_parameters.xml
│ │ ├── assets
│ │ │ └── about.properties
│ │ └── java
│ │ │ └── org
│ │ │ └── glpi
│ │ │ └── inventory
│ │ │ └── agent
│ │ │ ├── core
│ │ │ ├── servers
│ │ │ │ ├── ServersModel.java
│ │ │ │ ├── Servers.java
│ │ │ │ └── ServersPresenter.java
│ │ │ ├── splash
│ │ │ │ ├── Splash.java
│ │ │ │ ├── SplashPresenter.java
│ │ │ │ └── SplashModel.java
│ │ │ ├── categories
│ │ │ │ ├── Categories.java
│ │ │ │ ├── CategoriesPresenter.java
│ │ │ │ └── CategoriesModel.java
│ │ │ ├── permission
│ │ │ │ ├── Permission.java
│ │ │ │ ├── PermissionPresenter.java
│ │ │ │ └── PermissionModel.java
│ │ │ ├── help
│ │ │ │ ├── Help.java
│ │ │ │ ├── HelpPresenter.java
│ │ │ │ └── HelpModel.java
│ │ │ ├── about
│ │ │ │ ├── About.java
│ │ │ │ └── AboutPresenter.java
│ │ │ ├── report
│ │ │ │ ├── Report.java
│ │ │ │ └── ReportPresenter.java
│ │ │ ├── home
│ │ │ │ ├── Home.java
│ │ │ │ ├── HomePresenter.java
│ │ │ │ └── HomeSchema.java
│ │ │ ├── main
│ │ │ │ ├── Main.java
│ │ │ │ └── MainPresenter.java
│ │ │ └── detailserver
│ │ │ │ ├── DetailServer.java
│ │ │ │ └── DetailServerPresenter.java
│ │ │ ├── broadcast
│ │ │ └── BootStartAgent.java
│ │ │ ├── schema
│ │ │ ├── ListInventorySchema.java
│ │ │ └── ServerSchema.java
│ │ │ ├── utils
│ │ │ ├── UtilsAgent.java
│ │ │ ├── CustomX509TrustManager.java
│ │ │ ├── EnvironmentInfo.java
│ │ │ ├── CustomSSLSocketFactory.java
│ │ │ └── AgentLog.java
│ │ │ ├── adapter
│ │ │ └── ViewPagerAdapter.java
│ │ │ ├── preference
│ │ │ ├── GlobalParametersPreference.java
│ │ │ └── InventoryParametersPreference.java
│ │ │ └── ui
│ │ │ └── FragmentHome.java
│ ├── test
│ │ └── java
│ │ │ └── org
│ │ │ └── flyve
│ │ │ └── inventory
│ │ │ └── agent
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── org
│ │ └── glpi
│ │ └── inventory
│ │ └── agent
│ │ ├── AboutModelTest.java
│ │ └── HomeModelTest.java
├── .settings
│ └── org.eclipse.buildship.core.prefs
├── libs
│ └── inventory-release-v1.6.1.aar
├── release
│ └── output.json
├── .classpath
├── .project
└── google-services.json
├── settings.gradle
├── Gemfile
├── .github
├── invite-contributors.yml
├── workflows
│ ├── label-commenter.yml
│ └── deploy-alpha.yml
├── label-commener-config.yml
├── settings.yml
├── ISSUE_TEMPLATE
│ └── Bug_report.md
└── PULL_REQUEST_TEMPLATE.md
├── .vscode
└── settings.json
├── gplay.tar.gz.enc
├── screenshot
├── add-server.png
├── show-share.png
├── select-server.png
├── show-server.png
├── inventory-main.png
├── sending-inventory.png
└── automatic-inventory.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── .classpath
├── SUPPORT.md
├── .tx
├── README.md
└── config
├── package.json
├── CREDITS
├── .project
├── .gitignore
├── gradlew.bat
├── CODE_OF_CONDUCT.md
└── CONTRIBUTING.md
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gem "fastlane"
--------------------------------------------------------------------------------
/.github/invite-contributors.yml:
--------------------------------------------------------------------------------
1 | isOutside: true
2 | # Team Name
3 | contributors
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "java.configuration.updateBuildConfiguration": "disabled"
3 | }
--------------------------------------------------------------------------------
/gplay.tar.gz.enc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/gplay.tar.gz.enc
--------------------------------------------------------------------------------
/screenshot/add-server.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/screenshot/add-server.png
--------------------------------------------------------------------------------
/screenshot/show-share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/screenshot/show-share.png
--------------------------------------------------------------------------------
/screenshot/select-server.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/screenshot/select-server.png
--------------------------------------------------------------------------------
/screenshot/show-server.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/screenshot/show-server.png
--------------------------------------------------------------------------------
/screenshot/inventory-main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/screenshot/inventory-main.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/screenshot/sending-inventory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/screenshot/sending-inventory.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_qr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable/ic_qr.png
--------------------------------------------------------------------------------
/screenshot/automatic-inventory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/screenshot/automatic-inventory.png
--------------------------------------------------------------------------------
/app/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | #Tue Nov 21 16:28:44 CET 2017
2 | eclipse.preferences.version=1
3 | connection.project.dir=..
4 |
--------------------------------------------------------------------------------
/app/libs/inventory-release-v1.6.1.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/libs/inventory-release-v1.6.1.aar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable/github.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/readme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable/readme.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ci_check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ci_check.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_about.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_check.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_help.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_info.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_stat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_stat.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_stat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-mdpi/ic_stat.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_stat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-xhdpi/ic_stat.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ci_uncheck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ci_uncheck.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_uncheck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_uncheck.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/logoteclib.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/logoteclib.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_stat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-xxhdpi/ic_stat.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_stat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-xxxhdpi/ic_stat.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/header_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/header_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_feedback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_feedback.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/logoinventory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/logoinventory.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable/ic_launcher_fore.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable/ic_notification_white.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_option_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_option_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx2048m
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 | android.nonTransitiveRClass=false
5 | android.nonFinalResIds=false
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_schedule_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_schedule_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_setting_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/drawable-hdpi/ic_setting_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/glpi-project/android-inventory-agent/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/release/output.json:
--------------------------------------------------------------------------------
1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1582},"path":"app-release.apk","properties":{"packageId":"org.glpi.inventory.agent","split":"","minSdkVersion":"16"}}]
--------------------------------------------------------------------------------
/app/src/main/res/drawable/empty_tall_divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/radius_btn_blue.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/radius_btn_yellow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/from_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pref_dialog_url.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/assets/about.properties:
--------------------------------------------------------------------------------
1 | about.version=1.7.0
2 | about.build=39441
3 | about.date=Fri Aug 22 07:24:39 2025
4 | about.commit=07edc21
5 | about.commitFull=07edc2104d3e9416a9e4af27e84510002fd07162
6 | about.github=https://github.com/glpi-project/android-inventory-agent
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/from_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/separator_line.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/spinner_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_help.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/SUPPORT.md:
--------------------------------------------------------------------------------
1 | # GLPI Network - Professional support
2 |
3 | You want to report a bug (and get a fix quickly) or do you need a guarantee for GLPI Android Agent?
4 |
5 | You can subscribe to our professional support GLPI Network [here](https://services.glpi-network.com).
6 |
7 | This subscription includes a guarantee through a service level contract between your company and our team in charge of GLPI (core, supported plugins and GLPI Agent) as well as exclusive features and services.
--------------------------------------------------------------------------------
/.github/workflows/label-commenter.yml:
--------------------------------------------------------------------------------
1 | name: "Label commenter"
2 |
3 | on:
4 | issues:
5 | types:
6 | - "labeled"
7 | - "unlabeled"
8 |
9 | jobs:
10 | comment:
11 | permissions:
12 | contents: "read"
13 | issues: "write"
14 | runs-on: "ubuntu-latest"
15 | steps:
16 | - name: "Checkout"
17 | uses: "actions/checkout@v4"
18 |
19 | - name: "Label commenter"
20 | uses: "peaceiris/actions-label-commenter@v1"
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_inventory_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_home_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/rotate_fab_clock.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/test/java/org/flyve/inventory/agent/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package org.flyve.inventory.agent;
2 |
3 | import org.junit.Test;
4 |
5 | import static junit.framework.Assert.assertEquals;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/anim/rotate_fab_anticlock.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 55dp
4 | 105dp
5 | 155dp
6 | 21dp
7 | 45dp
8 |
9 | 4dp
10 | 8dp
11 |
12 | 15sp
13 | 20dp
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/checkbox_state.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_scan.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | app
4 | Project app created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_home_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/custom_preference_category.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fab_open.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
14 |
15 |
20 |
21 |
--------------------------------------------------------------------------------
/.tx/README.md:
--------------------------------------------------------------------------------
1 | # Transifex configuration
2 |
3 | This is a required file to work with transfix:
4 |
5 | ```console
6 | [main]
7 | host = https://www.transifex.com
8 | # just download files if 80% is complete
9 | minimum_perc = 80
10 | # transform file default format to requiered format
11 | lang_map = pt_BR: pt-rBR, ru_RU: ru-rRU, fr_FR: fr-rFR, es_MX: es-rMX, es_ES: es-rES, en_GB: en-rGB, ko_KR: ko-rKR
12 | ```
13 |
14 | ````console
15 | [android-inventory-agent.stringsxml-android]
16 | # where be placed all files when come from service
17 | file_filter = app/src/main/res/values-/strings.xml
18 | # the place of the main file
19 | source_file = app/src/main/res/values/strings.xml
20 | # main language
21 | source_lang = en
22 | # file type
23 | type = ANDROID
24 | ```
--------------------------------------------------------------------------------
/app/src/main/res/anim/fab_close.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
15 |
16 |
17 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/custom_checkbox.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@teclib/android-inventory-agent",
3 | "version": "1.7.0",
4 | "description": "GLPI Android Inventory Agent",
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-agent.git"
12 | },
13 | "keywords": [
14 | "Android",
15 | "inventory",
16 | "flyve",
17 | "device",
18 | "agent",
19 | "teclib"
20 | ],
21 | "author": "Rafael Hernandez (https://flyve-mdm.com)",
22 | "license": "GPL-3.0",
23 | "bugs": {
24 | "url": "https://github.com/glpi-project/android-inventory-agent/issues"
25 | },
26 | "homepage": "http://glpi-project/android-inventory-agent/"
27 | }
28 |
--------------------------------------------------------------------------------
/.tx/config:
--------------------------------------------------------------------------------
1 | [main]
2 | host = https://www.transifex.com
3 | lang_map = es_ES: es-rES, ar_SA: ar-rSA, it_IT: it-rIT, eu_ES: eu-rES, fr_FR: fr-rFR, he_IL: he-rIL, pl_PL: pl-rPL, es_AR: es-rAR, th_TH: th-rTH, pt_BR: pt-rBR, fr: fr, gl_ES: gl-rES, es: es, zh_CN: zh-rCN, ja: ja, ja_JP: ja-rJP, nl_NL: nl-rNL, ko_KR: ko-rKR, cs_CZ: cs-rCZ, hi_IN: hi-rIN, es_MX: es-rMX, en_GB: en-rGB, ca_ES: ca-rES, de_DE: de-rDE, ru_RU: ru-rRU, hu_Hu: hu-rHU, ur_PK: ur-rPK, ar_EG: ar-rEG
4 |
5 | [o:glpi:p:android-inventory-agent:r:stringsxml-android]
6 | file_filter = app/src/main/res/values-/strings.xml
7 | source_file = app/src/main/res/values/strings.xml
8 | source_lang = en
9 | type = ANDROID
10 | replace_edited_strings = false
11 | keep_translations = false
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_inventory_parent.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_home_check.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
21 |
22 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/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 Roy
38 | U: kiniou
39 |
40 | N: David Durieux
41 | U: ddurieux
42 |
43 | N: Gonéri Le Bouder
44 | E: goneri@lebouder.net
45 | U: goneri
46 |
47 | N: Lacroix Sébastien
48 | E: erufu.sennin@gmail.com
49 | U: erufu
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pref_widget_url.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
19 |
20 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_title.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
19 |
20 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
14 |
22 |
23 |
24 |
33 |
34 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | android-inventory-agent
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.ResourceManagerBuilder
15 |
16 |
17 |
18 |
19 | com.android.ide.eclipse.adt.PreCompilerBuilder
20 |
21 |
22 |
23 |
24 | org.eclipse.jdt.core.javabuilder
25 |
26 |
27 |
28 |
29 | com.android.ide.eclipse.adt.ApkBuilder
30 |
31 |
32 |
33 |
34 |
35 | com.android.ide.eclipse.adt.AndroidNature
36 | org.eclipse.jdt.core.javanature
37 | org.eclipse.buildship.core.gradleprojectnature
38 |
39 |
40 |
--------------------------------------------------------------------------------
/.github/label-commener-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 |
--------------------------------------------------------------------------------
/.github/settings.yml:
--------------------------------------------------------------------------------
1 | repository:
2 | name: android-inventory-agent
3 | description: Android Inventory Agent
4 | homepage: https://github.com/glpi-project/android-inventory-agent/
5 | topics: android, inventory-agent
6 | private: false
7 | has_issues: true
8 | has_wiki: false
9 | has_downloads: true
10 | default_branch: main
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 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/inventory_parameters.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
9 |
17 |
18 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #767677
4 | #4C4C4C
5 | #00A6F4
6 | #0095DB
7 | #000000
8 | #fec95c
9 | #e4b452
10 | #8f5a0a
11 | #EA1E31
12 | #FFF
13 | #7E7E7E
14 | #CCCCCC
15 | #4C4C4C
16 | #f1f1f1
17 | #00a6f4
18 | #ffff7663
19 | #00a6f4
20 | #00a6f4
21 |
22 |
23 | #60000000
24 | #cc0000
25 | #ff6600
26 | #b0000000
27 | #c099cc00
28 |
29 | @android:color/transparent
30 |
31 |
32 |
--------------------------------------------------------------------------------
/.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 | - **Agent 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 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .idea/libraries
3 | app/app.iml
4 |
5 | *.apk
6 | *.ap_
7 |
8 | # files for the dex VM
9 | *.dex
10 |
11 | # Java class files
12 | *.class
13 |
14 | # built native files (uncomment if you build your own)
15 | # *.o
16 | # *.so
17 |
18 | # generated files
19 | bin/
20 | gen/
21 |
22 | # Ignore gradle files
23 | .gradle/
24 | build/
25 |
26 | # Local configuration file (sdk path, etc)
27 | local.properties
28 | app.properties
29 |
30 | # Proguard folder generated by Eclipse
31 | proguard/
32 |
33 | # Eclipse Metadata
34 | .metadata/
35 |
36 | # Mac OS X clutter
37 | *.DS_Store
38 |
39 | # Windows clutter
40 | Thumbs.db
41 |
42 | .idea/workspace.xml
43 | .idea/tasks.xml
44 | .idea/datasources.xml
45 | .idea/dataSources.ids
46 | .idea/.name
47 | .idea/gradle.xml
48 | .idea/modules.xml
49 | .idea/vcs.xml
50 |
51 |
52 | # Node.js
53 |
54 | node_modules
55 |
56 | # Miscellaneous
57 |
58 | *.iml
59 | /local.properties
60 | /.idea/workspace.xml
61 | /.idea/libraries
62 | .DS_Store
63 | /build
64 | /captures
65 | .externalNativeBuild
66 |
67 | /gen
68 | /bin
69 | /.settings/
70 | /doc/
71 | local.properties
72 | build
73 | .env
74 | /ci/gplay.json
75 | /ci/gplay.tar.gz
76 | .idea/
77 | #.gradle/
78 | #gradle/
79 | #gradlew
80 | #gradlew.bat
81 |
82 | #fastlane
83 | /fastlane/report.xml
84 | /fastlane/metadata/
85 |
86 | #javadoc and reports
87 | /screenshots
88 | /development
89 | /reports
90 | /reports-beta
91 |
92 | #vendor
93 | vendor/
94 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
22 |
23 |
30 |
31 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "1002939879902",
4 | "firebase_url": "https://android-inventory-agent.firebaseio.com",
5 | "project_id": "android-inventory-agent",
6 | "storage_bucket": "android-inventory-agent.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:1002939879902:android:5652f6e731d1e6d5350d4f",
12 | "android_client_info": {
13 | "package_name": "org.glpi.inventory.agent"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "1002939879902-69don3lar14ts8m1p3sspjm8j2gaq94k.apps.googleusercontent.com",
19 | "client_type": 1,
20 | "android_info": {
21 | "package_name": "org.glpi.inventory.agent",
22 | "certificate_hash": "4287d795b3ca467f0920cca3c9e461129d5f6af1"
23 | }
24 | },
25 | {
26 | "client_id": "1002939879902-fbn5vl95r1i8uar6paiua7d5hkdp26fe.apps.googleusercontent.com",
27 | "client_type": 3
28 | }
29 | ],
30 | "api_key": [
31 | {
32 | "current_key": "AIzaSyBH0VWCAhtYnO1G9AC9WNH6chFMDtE5rZk"
33 | }
34 | ],
35 | "services": {
36 | "appinvite_service": {
37 | "other_platform_oauth_client": [
38 | {
39 | "client_id": "1002939879902-fbn5vl95r1i8uar6paiua7d5hkdp26fe.apps.googleusercontent.com",
40 | "client_type": 3
41 | }
42 | ]
43 | }
44 | }
45 | }
46 | ],
47 | "configuration_version": "1"
48 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/restrictions_values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Type
6 | Type of asset
7 | Computer
8 | Phone
9 |
10 | - @string/entry_server_itemtype_computer
11 | - @string/entry_server_itemtype_phone
12 |
13 |
14 | - Computer
15 | - Phone
16 |
17 | Computer
18 |
19 |
20 | Frequency
21 | Frequency
22 | Day
23 | Week
24 | Month
25 |
26 | - @string/frequency_day
27 | - @string/frequency_week
28 | - @string/frequency_month
29 |
30 |
31 | - Day
32 | - Week
33 | - Month
34 |
35 | Day
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
14 |
22 |
23 |
37 |
38 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_inventory_child.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
24 |
25 |
43 |
44 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_list_categories.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
17 |
18 |
28 |
29 |
30 |
31 |
32 |
39 |
40 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/servers/ServersModel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.servers;
37 |
38 | import android.app.Activity;
39 |
40 | import org.glpi.inventory.agent.utils.LocalPreferences;
41 |
42 | public class ServersModel implements Servers.Model {
43 |
44 | private Servers.Presenter presenter;
45 |
46 | ServersModel(Servers.Presenter presenter) {
47 | this.presenter = presenter;
48 | }
49 |
50 | public void loadServers(final Activity activity) {
51 | presenter.showServers(new LocalPreferences(activity).loadServer());
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
24 |
25 |
26 |
44 |
45 |
46 |
47 |
48 |
53 |
54 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/splash/Splash.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.splash;
37 |
38 | import android.content.Context;
39 |
40 | public interface Splash {
41 |
42 | interface View {
43 | void showError(String message);
44 | void setupStorageReady();
45 | }
46 |
47 | interface Presenter {
48 | // Views
49 | void showError(String message);
50 | void setupStorageReady();
51 |
52 | // Models
53 | void setupStorage(Context context);
54 | }
55 |
56 | interface Model {
57 | void setupStorage(Context context);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/servers/Servers.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.servers;
37 |
38 | import android.app.Activity;
39 |
40 | import java.util.ArrayList;
41 |
42 | public interface Servers {
43 |
44 | interface View {
45 | void showError(String message);
46 | void showServer(ArrayList load);
47 | }
48 |
49 | interface Presenter {
50 | // Views
51 | void showError(String message);
52 | void showServers(ArrayList model);
53 |
54 | // Models
55 | void loadServers(final Activity activity);
56 | }
57 |
58 | interface Model {
59 | void loadServers(final Activity activity);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/categories/Categories.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.categories;
37 |
38 | import android.content.Context;
39 |
40 | import java.util.ArrayList;
41 |
42 | public interface Categories {
43 |
44 | interface View {
45 | void showError(String message);
46 | void showCategories(ArrayList model);
47 | }
48 |
49 | interface Presenter {
50 | // Views
51 | void showError(String message);
52 | void showCategory(ArrayList model);
53 |
54 | // Models
55 | void loadCategory(Context applicationContext);
56 | }
57 |
58 | interface Model {
59 | void loadCategory(Context applicationContext);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/broadcast/BootStartAgent.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.broadcast;
37 |
38 | import android.content.BroadcastReceiver;
39 | import android.content.Context;
40 | import android.content.Intent;
41 | import org.glpi.inventory.agent.ui.ActivityMain;
42 |
43 | public class BootStartAgent extends BroadcastReceiver {
44 |
45 | @Override
46 | public void onReceive(Context context, Intent intent) {
47 | if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
48 | Intent activityIntent = new Intent(context, ActivityMain.class);
49 | activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
50 | context.startActivity(activityIntent);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/permission/Permission.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.permission;
37 |
38 | import android.app.Activity;
39 |
40 | public interface Permission {
41 |
42 | interface View {
43 | void showError(String message);
44 | void permissionSuccess();
45 | }
46 |
47 | interface Presenter {
48 | // Views
49 | void showError(String message);
50 | void permissionSuccess();
51 |
52 | // Models
53 | void requestPermission(Activity activity);
54 | void openMain(Activity activity);
55 | }
56 |
57 | interface Model {
58 | void requestPermission(Activity activity);
59 | void openMain(Activity activity);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/help/Help.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.help;
37 |
38 | import android.app.Activity;
39 | import android.webkit.WebView;
40 |
41 | import androidx.appcompat.widget.Toolbar;
42 |
43 | public interface Help {
44 |
45 | interface View {
46 | void showError(String message);
47 | boolean onBackPressed();
48 | void setToolbar(Toolbar toolbar);
49 |
50 | }
51 |
52 | interface Presenter {
53 | // Views
54 | void showError(String message);
55 |
56 | // Models
57 | void loadWebsite(final Activity activity, WebView wv, String url);
58 | }
59 |
60 | interface Model {
61 | void loadWebsite(final Activity activity, WebView wv, String url);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/help/HelpPresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.help;
37 |
38 | import android.app.Activity;
39 | import android.webkit.WebView;
40 |
41 | public class HelpPresenter implements Help.Presenter {
42 |
43 | private Help.View view;
44 | private Help.Model model;
45 |
46 | public HelpPresenter(Help.View view){
47 | this.view = view;
48 | model = new HelpModel(this);
49 | }
50 |
51 | @Override
52 | public void showError(String message) {
53 | if(view!=null) {
54 | view.showError(message);
55 | }
56 | }
57 |
58 | @Override
59 | public void loadWebsite(Activity activity, WebView wv, String url) {
60 | model.loadWebsite(activity, wv, url);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/schema/ListInventorySchema.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.schema;
37 |
38 | public class ListInventorySchema {
39 |
40 | private String title;
41 | private String description;
42 | private String type;
43 |
44 | public void setTitle(String title) {
45 | this.title = title;
46 | }
47 |
48 | public String getTitle() {
49 | return title;
50 | }
51 |
52 | public void setDescription(String description) {
53 | this.description = description;
54 | }
55 |
56 | public String getDescription() {
57 | return description;
58 | }
59 |
60 | public void setType(String type) {
61 | this.type = type;
62 | }
63 |
64 | public String getType() {
65 | return type;
66 | }
67 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_permission.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
22 |
23 |
35 |
36 |
53 |
54 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/about/About.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.about;
37 |
38 | import android.content.Context;
39 |
40 | import androidx.appcompat.widget.Toolbar;
41 |
42 | public interface About {
43 |
44 | interface View {
45 | void showAboutSuccess(String message);
46 | void showAboutFail();
47 | boolean onBackPressed();
48 | void setToolbar(Toolbar toolbar);
49 | }
50 |
51 | interface Presenter {
52 | // Views
53 | void showAboutSuccess(String message);
54 | void showAboutFail();
55 |
56 | // Models
57 | void crashTestEasterEgg(Context context);
58 | void loadAbout(Context context);
59 | }
60 |
61 | interface Model {
62 | void crashTestEasterEgg(Context context);
63 | void loadAbout(Context context);
64 | }
65 |
66 |
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/report/Report.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.report;
37 |
38 | import android.app.Activity;
39 | import android.content.Context;
40 |
41 | import java.util.ArrayList;
42 |
43 | public interface Report {
44 |
45 | interface View {
46 | void showError(String message);
47 | void sendInventory(String data, ArrayList load);
48 | }
49 |
50 | interface Presenter {
51 | // Views
52 | void showError(String message);
53 | void sendInventory(String data, ArrayList load);
54 |
55 | // Models
56 | void generateReport(final Activity activity);
57 | void showDialogShare(final Context context);
58 | }
59 |
60 | interface Model {
61 | void generateReport(final Activity activity);
62 | void showDialogShare(final Context context);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/splash/SplashPresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.splash;
37 |
38 | import android.content.Context;
39 |
40 | public class SplashPresenter implements Splash.Presenter {
41 |
42 | private Splash.View view;
43 | private Splash.Model model;
44 |
45 | public SplashPresenter(Splash.View view){
46 | this.view = view;
47 | model = new SplashModel(this);
48 | }
49 |
50 |
51 | @Override
52 | public void showError(String message) {
53 | if(view!=null) {
54 | view.showError(message);
55 | }
56 | }
57 |
58 | @Override
59 | public void setupStorageReady() {
60 | if(view!=null) {
61 | view.setupStorageReady();
62 | }
63 | }
64 |
65 | @Override
66 | public void setupStorage(Context context) {
67 | model.setupStorage(context);
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/home/Home.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.home;
37 |
38 | import android.app.Activity;
39 | import android.widget.ListView;
40 |
41 | import androidx.appcompat.widget.Toolbar;
42 |
43 | import java.util.List;
44 |
45 | public interface Home {
46 |
47 | interface View {
48 | void showError(String message);
49 | void setToolbar(Toolbar toolbar);
50 | }
51 |
52 | interface Presenter {
53 | // Views
54 | void showError(String message);
55 |
56 | // Models
57 | void setupList(Activity activity, ListView lst);
58 | void clickItem(final Activity activity, HomeSchema homeSchema);
59 | List getListItems();
60 | }
61 |
62 | interface Model {
63 | void setupList(Activity activity, ListView lst);
64 | void clickItem(final Activity activity, HomeSchema homeSchema);
65 | List getListItems();
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/servers/ServersPresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.servers;
37 |
38 | import android.app.Activity;
39 |
40 | import java.util.ArrayList;
41 |
42 | public class ServersPresenter implements Servers.Presenter {
43 |
44 | private Servers.View view;
45 | private Servers.Model model;
46 |
47 | public ServersPresenter(Servers.View view){
48 | this.view = view;
49 | model = new ServersModel(this);
50 | }
51 |
52 | @Override
53 | public void showError(String message) {
54 | if (view != null) {
55 | view.showError(message);
56 | }
57 | }
58 |
59 | @Override
60 | public void showServers(ArrayList model) {
61 | if (view != null) {
62 | view.showServer(model);
63 | }
64 | }
65 |
66 | @Override
67 | public void loadServers(Activity activity) {
68 | model.loadServers(activity);
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/app_restrictions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
13 |
21 |
22 |
26 |
30 |
31 |
35 |
39 |
43 |
47 |
55 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/about/AboutPresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.about;
37 |
38 | import android.content.Context;
39 |
40 | public class AboutPresenter implements About.Presenter {
41 |
42 | private About.View view;
43 | private About.Model model;
44 |
45 | public AboutPresenter(About.View view){
46 | this.view = view;
47 | model = new AboutModel(this);
48 | }
49 |
50 | @Override
51 | public void showAboutSuccess(String message) {
52 | if(view!=null) {
53 | view.showAboutSuccess(message);
54 | }
55 | }
56 |
57 | @Override
58 | public void showAboutFail() {
59 | if(view!=null) {
60 | view.showAboutFail();
61 | }
62 | }
63 |
64 | @Override
65 | public void crashTestEasterEgg(Context context) {
66 | model.crashTestEasterEgg(context);
67 | }
68 |
69 | @Override
70 | public void loadAbout(Context context) {
71 | model.loadAbout(context);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/categories/CategoriesPresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.categories;
37 |
38 | import android.content.Context;
39 |
40 | import java.util.ArrayList;
41 |
42 | public class CategoriesPresenter implements Categories.Presenter {
43 |
44 | private Categories.View view;
45 | private Categories.Model model;
46 |
47 | public CategoriesPresenter(Categories.View view){
48 | this.view = view;
49 | model = new CategoriesModel(this);
50 | }
51 |
52 | @Override
53 | public void showError(String message) {
54 | if (view != null) {
55 | view.showError(message);
56 | }
57 | }
58 |
59 | @Override
60 | public void showCategory(ArrayList model) {
61 | if (view != null) {
62 | view.showCategories(model);
63 | }
64 | }
65 |
66 | @Override
67 | public void loadCategory(Context applicationContext) {
68 | if (model != null) {
69 | model.loadCategory(applicationContext);
70 | }
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/permission/PermissionPresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.permission;
37 |
38 | import android.app.Activity;
39 |
40 | public class PermissionPresenter implements Permission.Presenter {
41 |
42 | private Permission.View view;
43 | private Permission.Model model;
44 |
45 | public PermissionPresenter(Permission.View view){
46 | this.view = view;
47 | model = new PermissionModel(this);
48 | }
49 |
50 | @Override
51 | public void showError(String message) {
52 | if(view!=null) {
53 | view.showError(message);
54 | }
55 | }
56 |
57 | @Override
58 | public void permissionSuccess() {
59 | if(view!=null) {
60 | view.permissionSuccess();
61 | }
62 | }
63 |
64 | @Override
65 | public void requestPermission(Activity activity) {
66 | model.requestPermission(activity);
67 | }
68 |
69 | @Override
70 | public void openMain(Activity activity) {
71 | model.openMain(activity);
72 | }
73 |
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/categories/CategoriesModel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.categories;
37 |
38 | import android.content.Context;
39 |
40 | import org.glpi.inventory.agent.R;
41 | import org.glpi.inventory.agent.utils.AgentLog;
42 |
43 | import java.util.ArrayList;
44 | import java.util.Collections;
45 |
46 | public class CategoriesModel implements Categories.Model {
47 |
48 | private Categories.Presenter presenter;
49 |
50 | CategoriesModel(Categories.Presenter presenter) {
51 | this.presenter = presenter;
52 | }
53 |
54 | @Override
55 | public void loadCategory(final Context context) {
56 | try {
57 | String[] inventory = context.getResources().getStringArray(R.array.Inventory);
58 | ArrayList categories = new ArrayList<>();
59 | Collections.addAll(categories, inventory);
60 | presenter.showCategory(categories);
61 | } catch (Exception e) {
62 | AgentLog.e(e.getMessage());
63 | presenter.showError("Error");
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/home/HomePresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.home;
37 |
38 | import android.app.Activity;
39 | import android.widget.ListView;
40 |
41 | import java.util.List;
42 |
43 | public class HomePresenter implements Home.Presenter {
44 |
45 | private Home.View view;
46 | private Home.Model model;
47 |
48 | public HomePresenter(Home.View view){
49 | this.view = view;
50 | model = new HomeModel(this);
51 | }
52 |
53 | @Override
54 | public void showError(String message) {
55 | if(view!=null) {
56 | view.showError(message);
57 | }
58 | }
59 |
60 | @Override
61 | public void setupList(Activity activity, ListView lst) {
62 | model.setupList(activity, lst);
63 | }
64 |
65 | @Override
66 | public void clickItem(Activity activity, HomeSchema homeSchema) {
67 | model.clickItem(activity, homeSchema);
68 | }
69 |
70 | @Override
71 | public List getListItems() {
72 | return model.getListItems();
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/report/ReportPresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.report;
37 |
38 | import android.app.Activity;
39 | import android.content.Context;
40 |
41 | import java.util.ArrayList;
42 |
43 | public class ReportPresenter implements Report.Presenter {
44 |
45 | private Report.View view;
46 | private Report.Model model;
47 |
48 | public ReportPresenter(Report.View view){
49 | this.view = view;
50 | model = new ReportModel(this);
51 | }
52 |
53 | @Override
54 | public void showError(String message) {
55 | if (view != null) {
56 | view.showError(message);
57 | }
58 | }
59 |
60 | @Override
61 | public void sendInventory(String data, ArrayList load) {
62 | if (view != null) {
63 | view.sendInventory(data, load);
64 | }
65 | }
66 |
67 | @Override
68 | public void generateReport(Activity activity) {
69 | model.generateReport(activity);
70 | }
71 |
72 | @Override
73 | public void showDialogShare(Context context) {
74 | model.showDialogShare(context);
75 | }
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_list_servers.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
18 |
19 |
29 |
30 |
40 |
41 |
42 |
43 |
44 |
45 |
51 |
52 |
57 |
58 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
20 |
21 |
27 |
28 |
34 |
35 |
41 |
42 |
48 |
49 |
55 |
56 |
65 |
66 |
69 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/splash/SplashModel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.splash;
37 |
38 | import android.content.Context;
39 |
40 | import org.glpi.inventory.agent.utils.AgentLog;
41 | import org.glpi.inventory.agent.utils.LocalStorage;
42 |
43 | public class SplashModel implements Splash.Model {
44 |
45 | private Splash.Presenter presenter;
46 |
47 | public SplashModel(Splash.Presenter presenter) {
48 | this.presenter = presenter;
49 | }
50 |
51 | public void setupStorage(Context context) {
52 | try {
53 | /*LocalStorage localStorage = new LocalStorage(context);
54 | String crashReport = localStorage.getData("crashReport");
55 | if (crashReport == null) {
56 | localStorage.setData("crashReport", "true");
57 | }
58 | String anonymousData = localStorage.getData("anonymousData");
59 | if (anonymousData == null) {
60 | localStorage.setData("anonymousData", "true");
61 | }*/
62 | presenter.setupStorageReady();
63 | } catch (Exception ex) {
64 | AgentLog.e(ex.getMessage());
65 | presenter.showError(ex.getMessage());
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/org/glpi/inventory/agent/AboutModelTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent;
37 |
38 | import android.content.Context;
39 |
40 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
41 | import androidx.test.platform.app.InstrumentationRegistry;
42 |
43 | import org.glpi.inventory.agent.core.about.About;
44 | import org.glpi.inventory.agent.core.about.AboutModel;
45 | import org.junit.Test;
46 | import org.junit.runner.RunWith;
47 |
48 | import static org.junit.Assert.assertTrue;
49 | import static org.mockito.Mockito.mock;
50 |
51 |
52 | @RunWith(AndroidJUnit4ClassRunner.class)
53 | public class AboutModelTest {
54 |
55 | private Context context = InstrumentationRegistry.getInstrumentation().getContext();
56 |
57 | @Test
58 | public void crashTestEasterEgg() {
59 | About.Presenter presenter = mock(About.Presenter.class);
60 | AboutModel model = new AboutModel(presenter);
61 | model.crashTestEasterEgg(context);
62 | assertTrue(true);
63 | }
64 |
65 | @Test
66 | public void loadAbout() {
67 | About.Presenter presenter = mock(About.Presenter.class);
68 | AboutModel model = new AboutModel(presenter);
69 | model.loadAbout(context);
70 | assertTrue(true);
71 | }
72 |
73 | }
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/main/Main.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.main;
37 |
38 | import android.app.Activity;
39 | import android.content.Context;
40 |
41 | import androidx.appcompat.widget.Toolbar;
42 | import androidx.fragment.app.FragmentManager;
43 |
44 | import android.widget.ListView;
45 |
46 | import java.util.HashMap;
47 | import java.util.List;
48 | import java.util.Map;
49 |
50 | public interface Main {
51 |
52 | interface View {
53 | void showError(String message);
54 | }
55 |
56 | interface Presenter {
57 | // Views
58 | void showError(String message);
59 |
60 | // Models
61 | Map setupDrawer(Activity activity, ListView lst);
62 | void loadFragment(FragmentManager fragmentManager, Toolbar toolbar, Map item);
63 | List> getMenuItem();
64 | void setupInventoryAlarm(Context context);
65 | }
66 |
67 | interface Model {
68 | Map setupDrawer(Activity activity, ListView lst);
69 | void loadFragment(FragmentManager fragmentManager, Toolbar toolbar, Map item);
70 | List> getMenuItem();
71 | void setupInventoryAlarm(Context context);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/schema/ServerSchema.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.schema;
37 |
38 | public class ServerSchema {
39 |
40 | private String address;
41 | private String tag;
42 | private String login;
43 | private String pass;
44 | private String itemtype;
45 | private String serial;
46 |
47 | public String getSerial() { return this.serial; }
48 |
49 | public void setSerial(String serial) {
50 | this.serial = serial;
51 | }
52 |
53 | public String getAddress() {
54 | return address;
55 | }
56 |
57 | public void setAddress(String address) {
58 | this.address = address;
59 | }
60 |
61 | public String getTag() {
62 | return tag;
63 | }
64 |
65 | public void setTag(String tag) {
66 | this.tag = tag;
67 | }
68 |
69 | public String getLogin() {
70 | return login;
71 | }
72 |
73 | public void setLogin(String login) {
74 | this.login = login;
75 | }
76 |
77 | public String getPass() {
78 | return pass;
79 | }
80 |
81 | public void setPass(String pass) {
82 | this.pass = pass;
83 | }
84 |
85 | public String getItemtype() {
86 | return itemtype;
87 | }
88 |
89 | public void setItemtype(String itemtype) {
90 | this.itemtype = itemtype;
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_servers.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
17 |
18 |
42 |
43 |
59 |
60 |
61 |
66 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_categories.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
17 |
18 |
42 |
43 |
59 |
60 |
61 |
66 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/detailserver/DetailServer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.detailserver;
37 |
38 | import android.content.Context;
39 |
40 | import org.glpi.inventory.agent.schema.ServerSchema;
41 |
42 | import java.util.ArrayList;
43 |
44 | public interface DetailServer {
45 |
46 | interface View {
47 | void showError(String message);
48 | void successful(String message);
49 | void modelServer(ServerSchema model);
50 | }
51 |
52 | interface Presenter {
53 | // Views
54 | void showError(String message);
55 | void successful(String message);
56 | void modelServer(ServerSchema model);
57 |
58 | // Models
59 | void saveServer(ArrayList message, Context applicationContext);
60 | void deleteServer(String serverName, Context applicationContext);
61 | void updateServer(ArrayList serverInfo, String serverName, Context applicationContext);
62 | void loadServer(String serverName, Context applicationContext);
63 | }
64 |
65 | interface Model {
66 | void saveServer(ArrayList message, Context applicationContext);
67 | void deleteServer(String serverName, Context applicationContext);
68 | void updateServer(ArrayList serverInfo, String serverName, Context applicationContext);
69 | void loadServer(String serverName, Context applicationContext);
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/utils/UtilsAgent.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.utils;
37 |
38 | import android.content.Context;
39 | import android.content.res.AssetManager;
40 |
41 | import java.io.BufferedReader;
42 | import java.io.IOException;
43 | import java.io.InputStream;
44 | import java.io.InputStreamReader;
45 |
46 | public class UtilsAgent {
47 |
48 | /**
49 | * @param fileName name of the xml to extract
50 | * @param context
51 | * @return string xml
52 | */
53 | public static String getXml(String fileName, Context context) {
54 | String xmlString = null;
55 | AssetManager am = context.getAssets();
56 | try {
57 | InputStream is = am.open(fileName);
58 | int length = is.available();
59 | byte[] data = new byte[length];
60 | is.read(data);
61 | xmlString = new String(data);
62 | } catch (IOException e1) {
63 | e1.printStackTrace();
64 | }
65 | return xmlString;
66 | }
67 |
68 | public static String convertStreamToString(InputStream is) throws Exception {
69 | BufferedReader reader = new BufferedReader(new InputStreamReader(is));
70 | StringBuilder sb = new StringBuilder();
71 | String line = null;
72 | while ((line = reader.readLine()) != null) {
73 | sb.append(line).append("\n");
74 | }
75 | reader.close();
76 | return sb.toString();
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/adapter/ViewPagerAdapter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.adapter;
37 |
38 | import android.view.View;
39 | import android.widget.ProgressBar;
40 |
41 | import androidx.fragment.app.Fragment;
42 | import androidx.fragment.app.FragmentManager;
43 | import androidx.fragment.app.FragmentPagerAdapter;
44 |
45 | import org.glpi.inventory.agent.ui.FragmentInventoryList;
46 |
47 | import java.util.ArrayList;
48 | import java.util.Collections;
49 |
50 | public class ViewPagerAdapter extends FragmentPagerAdapter {
51 |
52 | private String data;
53 | private ArrayList listInventory;
54 | private ArrayList load;
55 |
56 | public ViewPagerAdapter(FragmentManager fm, String data, ArrayList listInventory, ArrayList load, ProgressBar progressBar) {
57 | super(fm);
58 | this.data = data;
59 | this.listInventory = listInventory;
60 | this.load = load;
61 | this.load.remove("");
62 | progressBar.setVisibility(View.GONE);
63 | }
64 |
65 | @Override
66 | public Fragment getItem(int position) {
67 | return FragmentInventoryList.newInstance(data, listInventory.get(position));
68 | }
69 |
70 | @Override
71 | public int getCount() {
72 | return listInventory.size() - Collections.frequency(listInventory, "");
73 | }
74 |
75 | @Override
76 | public CharSequence getPageTitle(int position) {
77 | return load.get(position);
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/main/MainPresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.main;
37 |
38 | import android.app.Activity;
39 | import android.content.Context;
40 | import android.widget.ListView;
41 |
42 | import androidx.appcompat.widget.Toolbar;
43 | import androidx.fragment.app.FragmentManager;
44 |
45 | import java.util.HashMap;
46 | import java.util.List;
47 | import java.util.Map;
48 |
49 | public class MainPresenter implements Main.Presenter {
50 |
51 | private Main.View view;
52 | private Main.Model model;
53 |
54 | public MainPresenter(Main.View view){
55 | this.view = view;
56 | model = new MainModel(this);
57 | }
58 |
59 | @Override
60 | public void showError(String message) {
61 | if(view!=null) {
62 | view.showError(message);
63 | }
64 | }
65 |
66 | @Override
67 | public Map setupDrawer(Activity activity, ListView lst) {
68 | return model.setupDrawer(activity, lst);
69 | }
70 |
71 | @Override
72 | public void loadFragment(FragmentManager fragmentManager, Toolbar toolbar, Map item) {
73 | model.loadFragment(fragmentManager, toolbar, item);
74 | }
75 |
76 | @Override
77 | public List> getMenuItem() {
78 | return model.getMenuItem();
79 | }
80 |
81 | @Override
82 | public void setupInventoryAlarm(Context context) {
83 | model.setupInventoryAlarm(context);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/utils/CustomX509TrustManager.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.utils;
37 |
38 | import java.security.cert.X509Certificate;
39 |
40 | import javax.net.ssl.X509TrustManager;
41 |
42 | public class CustomX509TrustManager implements X509TrustManager {
43 |
44 | @Override
45 | public void checkClientTrusted(X509Certificate[] chain, String authType) {
46 | }
47 |
48 | @Override
49 | public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
50 |
51 | // Here you can verify the servers certificate. (e.g. against one which is stored on mobile device)
52 |
53 | /*InputStream inStream = null;
54 | try {
55 | inStream = MeaApplication.loadCertAsInputStream();
56 | CertificateFactory cf = CertificateFactory.getInstance("X.509");
57 | X509Certificate ca = (X509Certificate)
58 | cf.generateCertificate(inStream);
59 | inStream.close();
60 |
61 | for (X509Certificate cert : certs) {
62 | // Verifing by public key
63 | cert.verify(ca.getPublicKey());
64 | }
65 | } catch (Exception e) {
66 | throw new IllegalArgumentException("Untrusted Certificate!");
67 | } finally {
68 | try {
69 | inStream.close();
70 | } catch (IOException e) {
71 | e.printStackTrace();
72 | }
73 | }*/
74 | }
75 |
76 | public X509Certificate[] getAcceptedIssuers() {
77 | return null;
78 | }
79 |
80 | }
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/utils/EnvironmentInfo.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.utils;
37 |
38 | import android.content.Context;
39 | import android.content.res.AssetManager;
40 |
41 | import java.io.InputStream;
42 | import java.util.Properties;
43 |
44 | public class EnvironmentInfo {
45 | private Properties properties = new Properties();
46 |
47 | private Boolean isLoaded = false;
48 |
49 | public EnvironmentInfo(Context context) {
50 | AssetManager assetManager = context.getAssets();
51 | try {
52 | InputStream inputStream = assetManager.open("about.properties");
53 | properties.load(inputStream);
54 | } catch (Exception ex) {
55 | AgentLog.e(ex.getMessage());
56 | isLoaded = false;
57 | }
58 | isLoaded = true;
59 | }
60 |
61 | public Boolean getIsLoaded() {
62 | return isLoaded;
63 | }
64 |
65 | public String getVersion() {
66 | return properties.getProperty("about.version");
67 | }
68 |
69 | public String getBuild() {
70 | return properties.getProperty("about.build");
71 | }
72 |
73 | public String getDate() {
74 | return properties.getProperty("about.date");
75 | }
76 |
77 | public String getCommit() {
78 | return properties.getProperty("about.commit");
79 | }
80 |
81 | public String getCommitFull() {
82 | return properties.getProperty("about.commitFull");
83 | }
84 |
85 | public String getGithub() {
86 | return properties.getProperty("about.github");
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | @rem This is normally unused
30 | set APP_BASE_NAME=%~n0
31 | set APP_HOME=%DIRNAME%
32 |
33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35 |
36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38 |
39 | @rem Find java.exe
40 | if defined JAVA_HOME goto findJavaFromJavaHome
41 |
42 | set JAVA_EXE=java.exe
43 | %JAVA_EXE% -version >NUL 2>&1
44 | if %ERRORLEVEL% equ 0 goto execute
45 |
46 | echo.
47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48 | echo.
49 | echo Please set the JAVA_HOME variable in your environment to match the
50 | echo location of your Java installation.
51 |
52 | goto fail
53 |
54 | :findJavaFromJavaHome
55 | set JAVA_HOME=%JAVA_HOME:"=%
56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 |
58 | if exist "%JAVA_EXE%" goto execute
59 |
60 | echo.
61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62 | echo.
63 | echo Please set the JAVA_HOME variable in your environment to match the
64 | echo location of your Java installation.
65 |
66 | goto fail
67 |
68 | :execute
69 | @rem Setup the command line
70 |
71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72 |
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 %*
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if %ERRORLEVEL% equ 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 | set EXIT_CODE=%ERRORLEVEL%
85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87 | exit /b %EXIT_CODE%
88 |
89 | :mainEnd
90 | if "%OS%"=="Windows_NT" endlocal
91 |
92 | :omega
93 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/org/glpi/inventory/agent/HomeModelTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent;
37 |
38 | import android.app.Activity;
39 | import android.view.KeyEvent;
40 | import android.widget.ListView;
41 |
42 | import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
43 | import androidx.test.rule.ActivityTestRule;
44 |
45 | import org.glpi.inventory.agent.core.home.Home;
46 | import org.glpi.inventory.agent.core.home.HomeModel;
47 | import org.glpi.inventory.agent.core.home.HomeSchema;
48 | import org.glpi.inventory.agent.ui.ActivityMain;
49 | import org.junit.Rule;
50 | import org.junit.Test;
51 | import org.junit.runner.RunWith;
52 |
53 | import static org.mockito.Mockito.mock;
54 |
55 | @RunWith(AndroidJUnit4ClassRunner.class)
56 | public class HomeModelTest {
57 |
58 | @Rule
59 | public ActivityTestRule rule = new ActivityTestRule<>(ActivityMain.class);
60 |
61 | @Test
62 | public void setupList() {
63 | Home.Presenter presenter = mock(Home.Presenter.class);
64 | HomeModel homeModel = new HomeModel(presenter);
65 | ListView lst = mock(ListView.class);
66 |
67 | Activity activity = rule.getActivity();
68 | homeModel.setupList(activity, lst);
69 | }
70 |
71 | @Test
72 | public void clickItem() {
73 | Home.Presenter presenter = mock(Home.Presenter.class);
74 | HomeModel homeModel = new HomeModel(presenter);
75 |
76 | KeyEvent kdown = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK);
77 |
78 | Activity activity = rule.getActivity();
79 | HomeSchema homeSchema = new HomeSchema("1", "");
80 | homeModel.clickItem(activity, homeSchema);
81 | rule.getActivity().dispatchKeyEvent(kdown);
82 | }
83 | }
--------------------------------------------------------------------------------
/app/src/main/res/xml/global_parameters.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
19 |
20 |
28 |
29 |
32 |
33 |
37 |
41 |
42 |
43 |
64 |
65 |
68 |
69 |
73 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/help/HelpModel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.help;
37 |
38 | import android.app.Activity;
39 | import android.app.ProgressDialog;
40 | import android.content.pm.ActivityInfo;
41 | import android.webkit.WebSettings;
42 | import android.webkit.WebView;
43 | import android.webkit.WebViewClient;
44 |
45 | import org.glpi.inventory.agent.R;
46 |
47 | public class HelpModel implements Help.Model {
48 |
49 | private Help.Presenter presenter;
50 |
51 | public HelpModel(Help.Presenter presenter) {
52 | this.presenter = presenter;
53 | }
54 |
55 | public void loadWebsite(final Activity activity, WebView wv, String url) {
56 | WebSettings settings = wv.getSettings();
57 | settings.setJavaScriptEnabled(true);
58 | wv.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
59 |
60 | final ProgressDialog progressBar = ProgressDialog.show(activity, activity.getResources().getString(R.string.help), activity.getResources().getString(R.string.loading));
61 |
62 | wv.setWebViewClient(new WebViewClient() {
63 | public boolean shouldOverrideUrlLoading(WebView view, String url) {
64 | view.loadUrl(url);
65 | return true;
66 | }
67 |
68 | public void onPageFinished(WebView view, String url) {
69 | if (progressBar.isShowing()) {
70 | progressBar.dismiss();
71 | }
72 | }
73 |
74 | public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
75 | presenter.showError(description);
76 | progressBar.dismiss();
77 | }
78 | });
79 |
80 | wv.loadUrl(url);
81 |
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact@teclib.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/utils/CustomSSLSocketFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.utils;
37 |
38 | import org.apache.http.conn.ssl.SSLSocketFactory;
39 |
40 | import java.io.IOException;
41 | import java.net.Socket;
42 | import java.net.UnknownHostException;
43 | import java.security.KeyManagementException;
44 | import java.security.KeyStore;
45 | import java.security.KeyStoreException;
46 | import java.security.NoSuchAlgorithmException;
47 | import java.security.UnrecoverableKeyException;
48 |
49 | import javax.net.ssl.SSLContext;
50 | import javax.net.ssl.TrustManager;
51 |
52 | public class CustomSSLSocketFactory extends SSLSocketFactory {
53 | SSLContext sslContext = SSLContext.getInstance("TLS");
54 |
55 | public CustomSSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException,
56 | KeyStoreException, UnrecoverableKeyException {
57 |
58 | super(truststore);
59 | TrustManager tm = new CustomX509TrustManager();
60 | sslContext.init(null, new TrustManager[] { tm }, null);
61 | }
62 |
63 | CustomSSLSocketFactory(SSLContext context)
64 | throws KeyManagementException, NoSuchAlgorithmException,
65 | KeyStoreException, UnrecoverableKeyException {
66 | super(null);
67 | sslContext = context;
68 | }
69 |
70 | @Override
71 | public Socket createSocket(Socket socket, String host, int port,
72 | boolean autoClose) throws IOException, UnknownHostException {
73 | return sslContext.getSocketFactory().createSocket(socket, host, port,
74 | autoClose);
75 | }
76 |
77 | @Override
78 | public Socket createSocket() throws IOException {
79 | return sslContext.getSocketFactory().createSocket();
80 | }
81 | }
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/permission/PermissionModel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.permission;
37 |
38 | import android.Manifest;
39 | import android.app.Activity;
40 | import android.content.pm.PackageManager;
41 | import androidx.core.app.ActivityCompat;
42 | import androidx.core.content.ContextCompat;
43 |
44 | import org.glpi.inventory.agent.ui.ActivityMain;
45 | import org.glpi.inventory.agent.utils.Helpers;
46 |
47 | public class PermissionModel implements Permission.Model {
48 |
49 | private Permission.Presenter presenter;
50 |
51 | public PermissionModel(Permission.Presenter presenter) {
52 | this.presenter = presenter;
53 | }
54 |
55 | public void requestPermission(final Activity activity) {
56 | boolean isGranted = true;
57 | int result = ContextCompat.checkSelfPermission(activity, Manifest.permission.CAMERA);
58 | if(result != PackageManager.PERMISSION_GRANTED) {
59 | isGranted = false;
60 | }
61 |
62 | result = ContextCompat.checkSelfPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE);
63 | if(result != PackageManager.PERMISSION_GRANTED) {
64 | isGranted = false;
65 | }
66 |
67 | if(!isGranted) {
68 | ActivityCompat.requestPermissions(activity,
69 | new String[]{
70 | Manifest.permission.READ_EXTERNAL_STORAGE,
71 | Manifest.permission.WRITE_EXTERNAL_STORAGE,
72 | Manifest.permission.READ_PHONE_STATE,
73 | Manifest.permission.CAMERA,
74 | },
75 | 1);
76 | }
77 | }
78 |
79 | @Override
80 | public void openMain(Activity activity) {
81 | Helpers.openActivity(activity, ActivityMain.class, true);
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/detailserver/DetailServerPresenter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.detailserver;
37 |
38 | import android.content.Context;
39 |
40 | import org.glpi.inventory.agent.schema.ServerSchema;
41 |
42 | import java.util.ArrayList;
43 |
44 | public class DetailServerPresenter implements DetailServer.Presenter {
45 |
46 | private DetailServer.View view;
47 | private DetailServer.Model model;
48 |
49 | public DetailServerPresenter(DetailServer.View view){
50 | this.view = view;
51 | model = new DetailServerModel(this);
52 | }
53 |
54 | @Override
55 | public void showError(String message) {
56 | if (view != null) {
57 | view.showError(message);
58 | }
59 | }
60 |
61 | @Override
62 | public void successful(String message) {
63 | if (view != null) {
64 | view.successful(message);
65 | }
66 | }
67 |
68 | @Override
69 | public void modelServer(ServerSchema model) {
70 | if (view != null) {
71 | view.modelServer(model);
72 | }
73 | }
74 |
75 | @Override
76 | public void saveServer(ArrayList message, Context applicationContext) {
77 | model.saveServer(message, applicationContext);
78 | }
79 |
80 | @Override
81 | public void deleteServer(String serverName, Context applicationContext) {
82 | model.deleteServer(serverName, applicationContext);
83 | }
84 |
85 | @Override
86 | public void updateServer(ArrayList serverInfo, String serverName, Context applicationContext) {
87 | model.updateServer(serverInfo, serverName, applicationContext);
88 | }
89 |
90 | @Override
91 | public void loadServer(String serverName, Context applicationContext) {
92 | model.loadServer(serverName, applicationContext);
93 | }
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/preference/GlobalParametersPreference.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.preference;
37 |
38 | import android.content.Intent;
39 | import android.content.SharedPreferences;
40 | import android.os.Bundle;
41 | import android.preference.PreferenceActivity;
42 | import android.preference.PreferenceManager;
43 | import android.view.LayoutInflater;
44 | import android.view.View;
45 | import android.widget.LinearLayout;
46 |
47 | import androidx.appcompat.widget.Toolbar;
48 | import androidx.localbroadcastmanager.content.LocalBroadcastManager;
49 |
50 | import org.glpi.inventory.agent.R;
51 | import org.glpi.inventory.agent.utils.AgentLog;
52 |
53 | public class GlobalParametersPreference extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
54 |
55 | @Override
56 | public void onCreate(Bundle savedInstanceState) {
57 | super.onCreate(savedInstanceState);
58 | addPreferencesFromResource(R.xml.global_parameters);
59 | PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
60 | LinearLayout root = (LinearLayout)findViewById(android.R.id.list).getParent().getParent().getParent();
61 | Toolbar bar = (Toolbar) LayoutInflater.from(this).inflate(R.layout.toolbar, root, false);
62 | bar.setTitle(R.string.GlobalAdvanced);
63 | root.addView(bar, 0); // insert at top
64 | bar.setNavigationOnClickListener(new View.OnClickListener() {
65 | @Override
66 | public void onClick(View v) {
67 | finish();
68 | }
69 | });
70 | }
71 |
72 | @Override
73 | public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) {
74 | if ("boot".equals(s)) {
75 | AgentLog.d("Preference "+ s +" changed -> " + sharedPreferences.getBoolean(s, false));
76 | }
77 |
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_inventory.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
17 |
18 |
24 |
25 |
26 |
27 |
28 |
42 |
43 |
49 |
50 |
57 |
58 |
59 |
72 |
73 |
82 |
83 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_list_servers.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
24 |
25 |
26 |
35 |
36 |
45 |
46 |
55 |
56 |
57 |
63 |
64 |
72 |
73 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/utils/AgentLog.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.utils;
37 |
38 | import android.util.Log;
39 |
40 | import com.orhanobut.logger.Logger;
41 |
42 | /**
43 | * This is a Log wrapper
44 | */
45 | public class AgentLog {
46 |
47 | private static final String TAG = "InventoryAgent";
48 |
49 | /**
50 | * private constructor to prevent instances of this class
51 | */
52 | private AgentLog() {
53 | }
54 |
55 | /**
56 | * Sends a DEBUG log message
57 | * @param message to log
58 | */
59 | public static void d(String message, Object... args) {
60 | if(message != null) {
61 | Logger.d(message, args);
62 | }
63 | }
64 |
65 | /**
66 | * Sends a VERBOSE log message
67 | * @param message to log
68 | */
69 | public static void v(String message, Object... args) {
70 | if(message != null) {
71 | Logger.v(message, args);
72 | }
73 | }
74 |
75 | /**
76 | * Sends an INFO log message
77 | * @param message to log
78 | */
79 | public static void i(String message, Object... args) {
80 | if(message != null) {
81 | Logger.i(message, args);
82 | }
83 | }
84 |
85 | /**
86 | * Sends an ERROR log message
87 | * @param message to log
88 | */
89 | public static void e(String message, Object... args) {
90 | if(message != null) {
91 | Logger.e(message, args);
92 | }
93 | }
94 |
95 | /**
96 | * Sends a low level calling log
97 | * @param obj the name of the class
98 | * @param msg the log message
99 | * @param level the priority/type of the log message
100 | */
101 | public static void log(Object obj, String msg, int level) {
102 | String final_msg = String.format("[%s] %s", obj.getClass().getName(), msg);
103 | Log.println(level, "InventoryAgent", final_msg);
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Android Inventory Agent
2 |
3 | Thank you for considering contributing to the Android Inventory Agent! Your contributions help improve the project and ensure its success. Please follow the guidelines below to ensure a smooth and productive collaboration.
4 |
5 | ---
6 |
7 | ## Table of Contents
8 |
9 | 1. [Code of Conduct](#code-of-conduct)
10 | 2. [How to Contribute](#how-to-contribute)
11 | - [Bug Reports](#bug-reports)
12 | - [Pull Requests](#pull-requests)
13 | 3. [Development Environment](#development-environment)
14 | 4. [Code Style](#code-style)
15 | 5. [Testing](#testing)
16 | 6. [Contact](#contact)
17 |
18 | ---
19 |
20 | ## Code of Conduct
21 |
22 | By participating in this project, you agree to abide by the [Code of Conduct](CODE_OF_CONDUCT.md). Please treat others with respect and professionalism.
23 |
24 | ---
25 |
26 | ## How to Contribute
27 |
28 | ### Bug Reports
29 |
30 | 1. **Search existing issues**: Before reporting a bug, check if it has already been reported.
31 | 2. **Create a new issue**: If no similar issue exists, open a new issue and provide:
32 | - A clear and descriptive title.
33 | - Steps to reproduce the issue.
34 | - Expected vs. actual behavior.
35 | - Environment details (e.g., Android version, device model).
36 | 3. **Attach logs and screenshots**: If applicable, include logs or screenshots to help diagnose the issue.
37 |
38 | ### Pull Requests
39 |
40 | 1. Fork the repository and create a new branch for your changes:
41 | ```bash
42 | git checkout -b feature/your-feature-name
43 | ```
44 | 2. Make your changes while adhering to the [Code Style](#code-style) guidelines.
45 | 3. Ensure all tests pass and write new tests for your changes.
46 | 4. Commit your changes with clear and descriptive messages:
47 | ```bash
48 | git commit -m "feat: add new feature description"
49 | ```
50 | 5. Push your branch and create a Pull Request against the `main` branch.
51 |
52 | ---
53 |
54 | ## Development Environment
55 |
56 | To set up the project locally:
57 |
58 | 1. Clone the repository:
59 | ```bash
60 | git clone https://github.com/glpi-project/android-inventory-agent.git
61 | ```
62 | 2. Open the project in **Android Studio**.
63 | 3. Sync Gradle and resolve dependencies.
64 | 4. Build and run the project using the preferred emulator or physical device.
65 |
66 | ---
67 |
68 | ## Code Style
69 |
70 | - Follow **Android's official Kotlin/Java coding standards**.
71 | - Use meaningful variable, method, and class names.
72 | - Format your code using Android Studio's built-in formatter.
73 | - Add comments to explain complex logic or algorithms.
74 |
75 | ---
76 |
77 | ## Testing
78 |
79 | ### Writing Tests
80 | - Use **JUnit** and / or **Espresso** for writing unit and UI tests.
81 | - Place your tests in the appropriate directories:
82 | - `/src/test/` for unit tests.
83 | - `/src/androidTest/` for instrumentation tests.
84 |
85 | ### Running Tests
86 | - To run all tests, execute the following command:
87 | ```bash
88 | ./gradlew test
89 | ./gradlew connectedAndroidTest
90 | ```
91 |
92 | ### Firebase Test Lab (Optional)
93 | - Tests are automatically run using Firebase Test Lab via GitHub Actions for all Pull Requests.
94 |
95 | ---
96 |
97 | ## Contact
98 |
99 | For questions or discussions, feel free to:
100 | - Open an issue.
101 | - Join the [GLPI community forums](https://forum.glpi-project.org/).
102 | - Reach out to the maintainers directly on GitHub.
103 |
104 | ---
105 |
106 | We appreciate your interest in improving Android Inventory Agent. Thank you for contributing!
107 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/core/home/HomeSchema.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.core.home;
37 |
38 | public class HomeSchema {
39 |
40 | private String id;
41 | private String title;
42 | private String subTitle;
43 | private Boolean hasCheck;
44 | private Boolean checkValue;
45 | private Boolean isHeader;
46 |
47 | public HomeSchema(String id, String title) {
48 | this.id = id;
49 | this.title = title;
50 | this.hasCheck = false;
51 | this.isHeader = true;
52 | }
53 |
54 | public HomeSchema(String id, String title, String subTitle) {
55 | this.id = id;
56 | this.title = title;
57 | this.subTitle = subTitle;
58 | this.hasCheck = false;
59 | this.isHeader = false;
60 | }
61 |
62 | public HomeSchema(String id, String title, String subTitle, Boolean checkValue) {
63 | this.id = id;
64 | this.title = title;
65 | this.subTitle = subTitle;
66 | this.hasCheck = true;
67 | this.isHeader = false;
68 | this.checkValue = checkValue;
69 | }
70 |
71 | public String getId() {
72 | return id;
73 | }
74 |
75 | public void setId(String id) {
76 | this.id = id;
77 | }
78 |
79 | public String getTitle() {
80 | return title;
81 | }
82 |
83 | public void setTitle(String title) {
84 | this.title = title;
85 | }
86 |
87 | public String getSubTitle() {
88 | return subTitle;
89 | }
90 |
91 | public void setSubTitle(String subTitle) {
92 | this.subTitle = subTitle;
93 | }
94 |
95 | public Boolean getHasCheck() {
96 | return hasCheck;
97 | }
98 |
99 | public void setHasCheck(Boolean hasCheck) {
100 | this.hasCheck = hasCheck;
101 | }
102 |
103 | public Boolean getCheckValue() {
104 | return checkValue;
105 | }
106 |
107 | public void setCheckValue(Boolean checkValue) {
108 | this.checkValue = checkValue;
109 | }
110 |
111 | public Boolean getHeader() {
112 | return isHeader;
113 | }
114 |
115 | public void setHeader(Boolean header) {
116 | isHeader = header;
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/ui/FragmentHome.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.ui;
37 |
38 | import android.content.Intent;
39 | import android.os.Bundle;
40 | import android.view.LayoutInflater;
41 | import android.view.View;
42 | import android.view.ViewGroup;
43 | import android.widget.Button;
44 |
45 | import androidx.appcompat.widget.Toolbar;
46 | import androidx.fragment.app.Fragment;
47 |
48 | import org.glpi.inventory.agent.R;
49 | import org.glpi.inventory.agent.core.home.Home;
50 | import org.glpi.inventory.agent.core.home.HomePresenter;
51 | import org.glpi.inventory.agent.utils.Helpers;
52 |
53 | public class FragmentHome extends Fragment implements Home.View {
54 |
55 | private Home.Presenter presenter;
56 | private Toolbar toolbar;
57 |
58 |
59 | @Override
60 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
61 |
62 | View v = inflater.inflate(R.layout.fragment_home, null);
63 |
64 | toolbar.setTitle(R.string.app_name);
65 |
66 | ((ActivityMain)getActivity()).enableFab();
67 |
68 | presenter = new HomePresenter(this);
69 |
70 | Button btn_run = v.findViewById(R.id.btn_run_inventory);
71 | btn_run.setOnClickListener(new View.OnClickListener() {
72 | @Override
73 | public void onClick(View view) {
74 | DialogListServers alert = new DialogListServers();
75 | alert.showDialog(FragmentHome.this.getActivity(), presenter);
76 | }
77 | });
78 |
79 | Button btn_show = v.findViewById(R.id.btn_show_inventory);
80 | btn_show.setOnClickListener(new View.OnClickListener() {
81 | @Override
82 | public void onClick(View view) {
83 | Intent miIntent = new Intent(FragmentHome.this.getActivity(), ActivityInventoryReport.class);
84 | FragmentHome.this.getActivity().startActivity(miIntent);
85 | }
86 | });
87 |
88 | return v;
89 | }
90 |
91 | @Override
92 | public void setToolbar(Toolbar toolbar){
93 | this.toolbar = toolbar;
94 | }
95 |
96 |
97 | @Override
98 | public void showError(String message) {
99 | Helpers.snackClose(FragmentHome.this.getActivity(), message, getResources().getString(R.string.snackButton), true);
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/app/src/main/java/org/glpi/inventory/agent/preference/InventoryParametersPreference.java:
--------------------------------------------------------------------------------
1 | /**
2 | * ---------------------------------------------------------------------
3 | * GLPI Android Inventory Agent
4 | * Copyright (C) 2019 Teclib.
5 | *
6 | * https://glpi-project.org
7 | *
8 | * Based on Flyve MDM Inventory Agent For Android
9 | * Copyright © 2018 Teclib. All rights reserved.
10 | *
11 | * ---------------------------------------------------------------------
12 | *
13 | * LICENSE
14 | *
15 | * This file is part of GLPI Android Inventory Agent.
16 | *
17 | * GLPI Android Inventory Agent is a subproject of GLPI.
18 | *
19 | * GLPI Android Inventory Agent is free software: you can redistribute it and/or
20 | * modify it under the terms of the GNU General Public License
21 | * as published by the Free Software Foundation; either version 3
22 | * of the License, or (at your option) any later version.
23 | *
24 | * GLPI Android Inventory Agent is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | * ---------------------------------------------------------------------
29 | * @copyright Copyright © 2019 Teclib. All rights reserved.
30 | * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
31 | * @link https://github.com/glpi-project/android-inventory-agent
32 | * @link https://glpi-project.org/glpi-network/
33 | * ---------------------------------------------------------------------
34 | */
35 |
36 | package org.glpi.inventory.agent.preference;
37 |
38 | import android.content.Intent;
39 | import android.content.SharedPreferences;
40 | import android.os.Bundle;
41 | import android.preference.PreferenceActivity;
42 | import android.preference.PreferenceManager;
43 | import android.view.LayoutInflater;
44 | import android.view.View;
45 | import android.widget.LinearLayout;
46 |
47 | import androidx.appcompat.widget.Toolbar;
48 | import androidx.localbroadcastmanager.content.LocalBroadcastManager;
49 |
50 | import org.glpi.inventory.agent.R;
51 | import org.glpi.inventory.agent.utils.AgentLog;
52 |
53 | public class InventoryParametersPreference extends PreferenceActivity
54 | implements SharedPreferences.OnSharedPreferenceChangeListener {
55 |
56 | @Override
57 | public void onCreate(Bundle savedInstanceState) {
58 | super.onCreate(savedInstanceState);
59 | addPreferencesFromResource(R.xml.inventory_parameters);
60 | PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
61 | LinearLayout root = (LinearLayout)findViewById(android.R.id.list).getParent().getParent().getParent();
62 | Toolbar bar = (Toolbar) LayoutInflater.from(this).inflate(R.layout.toolbar, root, false);
63 | bar.setTitle(R.string.AccueilInventoryParamSummary);
64 | root.addView(bar, 0); // insert at top
65 | bar.setNavigationOnClickListener(new View.OnClickListener() {
66 | @Override
67 | public void onClick(View v) {
68 | finish();
69 | }
70 | });
71 |
72 | }
73 |
74 | @Override
75 | public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) {
76 | if ("timeInventory".equals(s)) {
77 | Intent intent = new Intent("timeAlarmChanged");
78 | LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
79 | AgentLog.d("GLPI-AGENT-JOBSCHEDULER : Preference "+ s +" changed -> " + sharedPreferences.getString(s, "Week"));
80 | }
81 |
82 | if("autoStartInventory".equals(s)){
83 | Intent intent = new Intent("timeAlarmChanged");
84 | LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
85 | AgentLog.d("GLPI-AGENT-JOBSCHEDULER : Preference "+ s +" changed -> " + sharedPreferences.getBoolean(s, false));
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/.github/workflows/deploy-alpha.yml:
--------------------------------------------------------------------------------
1 | name: GLPI Android Inventory Library Deploy Alpha
2 |
3 | env:
4 | module_app: app
5 |
6 | on:
7 | push:
8 | branches:
9 | - "main"
10 |
11 | jobs:
12 | build:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - uses: actions/checkout@v4
16 |
17 | ################################
18 | # Update Version Code #
19 | ################################
20 | - name: Update Android Version code
21 | run: ./gradlew updateVersionCode
22 |
23 | - name: Extract Release Version
24 | run: echo "release_version=$(jq -r ".version" package.json)" >> $GITHUB_ENV
25 |
26 | - name: Extract App VersionCode
27 | run: echo "app_version_code=$(grep versionCode ./app/src/main/AndroidManifest.xml | cut -d\" -f2)" >> $GITHUB_ENV
28 |
29 | - name: Update About Data
30 | run : |
31 | echo "about.version=${{ env.release_version }}" > ./app/src/main/assets/about.properties
32 | echo "about.build=${{ env.app_version_code }}" >> ./app/src/main/assets/about.properties
33 | echo "about.date=$(date "+%a %b %d %H:%M:%S %Y")" >> ./app/src/main/assets/about.properties
34 | echo "about.commit=$(git rev-parse --short "$GITHUB_SHA")" >> ./app/src/main/assets/about.properties
35 | echo "about.commitFull=$(git rev-parse "$GITHUB_SHA")" >> ./app/src/main/assets/about.properties
36 | echo "about.github=https://github.com/glpi-project/android-inventory-agent" >> ./app/src/main/assets/about.properties
37 |
38 | - name: Push Updated Version On AndroidManifest
39 | uses: EndBug/add-and-commit@v9
40 | with:
41 | default_author: github_actions
42 | message: "ci(release): update version on android manifest"
43 |
44 |
45 | ##########################################
46 | # Push / Pull translation files #
47 | ##########################################
48 | # Push Transifex
49 | - name: Push source file using transifex client
50 | uses: transifex/cli-action@v2
51 | with:
52 | args: push
53 | token: ${{ secrets.TX_TOKEN }}
54 |
55 | # Clean Transifex CLI
56 | - name: Clean Transifex CLI
57 | run: rm -fr /tmp/tx
58 |
59 | # Pull from Transifex
60 | - name: Pull source file using transifex client
61 | uses: transifex/cli-action@v2
62 | with:
63 | args: pull --force --all --minimum-perc=80
64 | token: ${{ secrets.TX_TOKEN }}
65 |
66 |
67 | ##############################################
68 | # Prepare / Build project APK / AAR / JAR #
69 | ##############################################
70 | # Build app
71 | - name: Build with Gradle
72 | run: ./gradlew assemble
73 |
74 | - name: Setup build tool version variable
75 | shell: bash
76 | run: |
77 | BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
78 | echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
79 | echo Last build tool version is: $BUILD_TOOL_VERSION
80 |
81 | - name: Sign app APK
82 | uses: r0adkll/sign-android-release@v1
83 | # ID used to access action output
84 | id: sign_app
85 | with:
86 | releaseDirectory: app/build/outputs/apk/release
87 | signingKeyBase64: ${{ secrets.SIGN_APK_SIGNING_KEY }}
88 | alias: ${{ secrets.SIGN_APK_ALIAS }}
89 | keyStorePassword: ${{ secrets.SIGN_APP_STOREPASS }}
90 | keyPassword: ${{ secrets.SIGN_APP_KEYPASS }}
91 | env:
92 | # override default build-tools version (29.0.3) -- optional
93 | BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
94 |
95 | - name: Push to google play
96 | uses: r0adkll/upload-google-play@v1
97 | with:
98 | serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_CONSOLE }}
99 | packageName: org.glpi.inventory.agent
100 | releaseFiles: app/build/outputs/apk/release/app-release-unsigned-signed.apk
101 | track: alpha
102 |
--------------------------------------------------------------------------------