All Projects → filipp → Gsxlib

filipp / Gsxlib

A PHP library for communicating with Apple's GSX web service API

Projects that are alternatives of or similar to Gsxlib

Spalert
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.
Stars: ✭ 1,014 (+1436.36%)
Mutual labels:  apple
Yesterday I Learned
Brainfarts are caused by the rupturing of the cerebral sphincter.
Stars: ✭ 50 (-24.24%)
Mutual labels:  apple
Sabotage
an experimental distribution based on musl libc and busybox
Stars: ✭ 62 (-6.06%)
Mutual labels:  unmaintained
Xiaomi Ruby 15.6 Uma Only
macOS Big Sur on XiaoMi Ruby 15.6 (Opencore)
Stars: ✭ 44 (-33.33%)
Mutual labels:  apple
Wwdc
The unofficial WWDC app for macOS
Stars: ✭ 8,137 (+12228.79%)
Mutual labels:  apple
Cordova Plugin Sign In With Apple
A native-implemented plugin of Sign in with Apple // Thanks to your contribution! // Cordova>=8 iOS>=13
Stars: ✭ 57 (-13.64%)
Mutual labels:  apple
Swift Keylogger
Keylogger for mac written in Swift using HID
Stars: ✭ 995 (+1407.58%)
Mutual labels:  apple
Cirrus
☁️ Simple CloudKit sync for Codable Swift models
Stars: ✭ 65 (-1.52%)
Mutual labels:  apple
Autocomplete Ruby
Provides intelligent code completion for Ruby in the Atom editor. Requires RSense.
Stars: ✭ 50 (-24.24%)
Mutual labels:  unmaintained
Ios Developer Tools
Tools that every iOS developer should know.
Stars: ✭ 1,111 (+1583.33%)
Mutual labels:  apple
Rxswift To Combine Cheatsheet
RxSwift to Apple’s Combine Cheat Sheet
Stars: ✭ 1,040 (+1475.76%)
Mutual labels:  apple
Amazon Fresh Whole Foods Delivery Slot Finder
A Mac tool that finds available delivery slots for Amazon's Whole Foods delivery and Amazon Fresh services
Stars: ✭ 1,048 (+1487.88%)
Mutual labels:  apple
Syncthing Macos
Frugal and native macOS Syncthing application bundle
Stars: ✭ 1,096 (+1560.61%)
Mutual labels:  apple
Ipfs Textbook
[unmaintained] Helping me understand what IPFS is and how it works
Stars: ✭ 43 (-34.85%)
Mutual labels:  unmaintained
Nord Xcode
An arctic, north-bluish clean and elegant Xcode color theme.
Stars: ✭ 63 (-4.55%)
Mutual labels:  apple
Grocer
Pushing your Apple notifications since 2012.
Stars: ✭ 1,005 (+1422.73%)
Mutual labels:  apple
Go Apns2
Go package for HTTP/2 Apple Push Notification Service.
Stars: ✭ 53 (-19.7%)
Mutual labels:  apple
Mkringprogressview
⭕️ Ring progress view similar to Activity app on Apple Watch
Stars: ✭ 1,140 (+1627.27%)
Mutual labels:  apple
Cluster
Easy Map Annotation Clustering 📍
Stars: ✭ 1,132 (+1615.15%)
Mutual labels:  apple
Contacttracing Framework Interface
Objective-C header and synthesized Swift interface for Apple & Google's Contact Tracing Framework
Stars: ✭ 59 (-10.61%)
Mutual labels:  apple

About

GsxLib is a PHP library that simplifies communication with Apple's GSX web service API. It frees the application developer from knowing the underlying PHP SOAP architecture and to some extent even the GSX API itself. GsxLib also tries to provide some performance benefits by minimizing the number of requests made to the servers as well as doing some rudimentary input validation (as opposed to burdening Apple's servers with totally invalid requests).

Requrements

  • SOAP support in your PHP
  • Client certificates for GSX access
  • Whitelisted IP address of the source of your requests
  • GSX account with the "Can access Web Services" privilege enabled

Usage

Best illustrated with a simple example:

<?php

  include 'gsxlib/gsxlib.php';
  $_ENV['GSX_CERT'] = '/path/to/gsx/client/cert.pem';
  $_ENV['GSX_KEYPASS'] = 'MySuperSecretPrivateKeyPassPhrase';
  $gsx = GsxLib::getInstance($sold_to, $username);
  $info = $gsx->warrantyStatus($serialnumber);
  echo $info->productDescription;
  > MacBook Pro (15-inch 2.4/2.2GHz)
  
?>

If you're in the US, remember to set the fifth argument to the constructor to 'am'.

gsxcl

The package includes a rudimentary command line client to the GSX API called gsxcl. It can perform various functions in the library and is meant mainly as a simple test tool for the library.

FAQ

Q: How do I create the necessary PEM file?

A: The PEM file must be a concatenation of the certificate you got from Apple and your private key file. You can create this from the Terminal:

$ cat Applecare-APP1234-0000123456.Test.apple.com.chain.pem privatekey.pem > certbundle.pem

After that you would use certbundle.pem as your client certificate. The contents of certbundle.pem should look something like this:

-----BEGIN CERTIFICATE-----
BLASOQ()*Q#()**)REW)*(EW*)*E)WUR)*EW(UR)
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
0990320003q43090435J403439590S-S=DS=-
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
)_#_)#)$IK_#@))KDE_)FD_SF)DSF_DS)FDS_FDSFSD
....
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: ....
DEK-Info: ...
BUNCH OF GIBBERISH
-----END RSA PRIVATE KEY-----

Q: Do I need to make changes to my web server configuration for the SSL authentication to work?

A: No, the library takes care of everything. That's why the certificate path and passphrase are implemented as environment variables. This ensures the certificate is sent with each request and you only have to define the paths once in your code.

Q: How can I remove the passphrase from my private key?

$ openssl rsa -in privatekey.pem -out privatekey.nopass.pem

Q: How do I run the test suite?

A: First, install simpletest, then:

$ GSX_DEBUG=1 GSX_TECHID=123456 GSX_SN=12345678 GSX_SHIPTO=123456 [email protected] GSX_KEYPASS='MySuperSecretKey' GSX_SOLDTO=123456 GSX_CERT=/path/to/my/cert.chain.pem php runtests.php

Q: How can I get Find My iPhone status?

A: Use the following code:

$warrantylookup = $gsx->warrantyStatus($serialnumber);
if (strpos($warrantylookup->activationLockStatus,'Find My iPhone is active') !== false) {
  $fmid = 1;
} else {
  $fmid = 0;
}

License

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]> 
Everyone is permitted to copy and distribute verbatim or modified 
copies of this license document, and changing it is allowed as long 
as the name is changed. 

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 
0. You just DO WHAT THE FUCK YOU WANT TO.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].