Giter Club home page Giter Club logo

java-http-libimobiledevice's Introduction

bryan


Codacy Badge

Overview

java-http-libimobiledevice is a simple REST API wrapper of libimobiledevice to communicate with services of Apple iOS devices using native protocols. This service works on Linux and macOS.

libimobiledevice is a cross-platform software library that talks the protocols to support iPhone®, iPod Touch®, iPad® and Apple TV® devices. Unlike other projects, it does not depend on using any existing proprietary libraries and does not require jailbreaking. It allows other software to easily access the device's filesystem, retrieve information about the device and it's internals, backup/restore the device, manage SpringBoard® icons, manage installed applications, etc.

Requirements

Install libimobiledevice:

Linux (Ubuntu)

sudo add-apt-repository ppa:pmcenery/ppa
sudo apt-get update
sudo apt-get install libimobiledevice
sudo apt-get install libimobiledevice-utils

macOS

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install libimobiledevice

Configuration

We need to set the libimobiledevice binaries path. In order to know this path open a terminal and execute:

whereis ideviceinfo 

Copy the path on the ios-service.config file. E.G:

service.port=5050
libimobiledevice.path=/usr/bin/
libimobiledevice.timeout=20000

Execution

  • Download the latest version
  • Place the ios-service.config configuration file in the folder where java-http-libimobiledevice-X.X.X.jar is located.
  • Start service:
java -jar java-http-libimobiledevice-X.X.X.jar

URL structure

The java-http-libimobiledevice API lives at http://127.0.0.1:5050/api/v1/, with particular endpoints following that prefix.

Responses are in JSON

Example calls

API examples use httpie, a command-line HTTP client.

Gets information about the battery of an attached device.

:serial = Target specific device by its 40-digit device UDID.

http http://127.0.0.1:5050/api/v1/device/:serial/battery

Response

{
    "data": {
        "currentCapacity": 100,
        "externalChargeCapable": true,
        "externalConnected": true,
        "fullyCharged": false,
        "gasGaugeCapability": true,
        "health": "good",
        "isCharging": false,
        "temp": "0"
    }
}

Retrieve the CPU Architecture from the target device.

http http://127.0.0.1:5050/api/v1/device/:serial/cpu/architecture

Response

{
    "data": {
        "architecture": "armv7f",
        "status": "Success"
    }
}

Get a device

Retrieve the CPU Architecture from the target device.

http http://127.0.0.1:5050/api/v1/device/:serial

Response

{
    "data":{
               "architecture": "armv7f", 
               "battery": {
                   "currentCapacity": 100, 
                   "externalChargeCapable": true, 
                   "externalConnected": true, 
                   "fullyCharged": false, 
                   "gasGaugeCapability": true, 
                   "health": "good", 
                   "isCharging": false, 
                   "temp": "0"     
               }, 
               "disk": {
                   "amountDataAvailable": 2901368832.0, 
                   "amountDataReserved": 209715200.0, 
                   "calculateDiskUsage": "null", 
                   "calendarUsage": 0.0, 
                   "cameraUsage": 0.0, 
                   "mediaCacheUsage": 0.0, 
                   "notesUsage": 0.0, 
                   "photoUsage": 0.0, 
                   "totalDataAvailable": 3111084032.0, 
                   "totalDataCapacity": 13924319232.0, 
                   "totalDiskCapacity": 15955132416.0, 
                   "totalSystemAvailable": 272629760.0, 
                   "totalSystemCapacity": 2030813184.0, 
                   "voicemailUsage": 0.0, 
                   "webAppCacheUsage": 0.0
               }, 
               "model": "iPad", 
               "manufacturer": "Apple",
               "platform": "ios", 
               "platformVersion": "8.4.1", 
               "present": true,     
               "ready": true,
               "status" : 3, 
               "serial": "0416d649d4c1b9b57e0dae22a42344926a1dcc74",
               "state": "available"     
            }
    }
}

API Documentation

We use apiDoc in order to generate the documentation for java-http-libimobiledevice’s HTTP API.

apiDoc creates a documentation from API annotations in your source code. Please check the documentation here

The proyect come with a Maven task in order to generate the documentation from Maven without any pain, but FIRST you need install apiDoc of course:

npm install apidoc -g 

And now we need execute the following command:

mvn exec:exec

The documentation is generated on the doc directory.

Contribution

Any ideas are welcome. Feel free to submit any issues or pull requests.

PRs Welcome


Java HTTP Libimobiledevice is developed and maintained by Mobilebox team.

java-http-libimobiledevice's People

Contributors

ohtejera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

perc-solutions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.