Marketing Apple

apple_water_pageQuesta simpatica foto mostra come si può spacciare per iper-tecnologia qualsiasi cosa.

E’ esattamente quello che fa la Apple con i suoi mediocri prodotti: iPod iPhone iPad sono dei semplici dispositivi touch screen, con un microprocessore, una memoria di massa, e un sistema operativo.

E invece gli zombie che ne sono attratti pensano che siano una invenzione eccezionale, una cosa mai vista !

E non arrivano a capire la differenza tra l’ essere COSTRETTI a passare per iTunes per trasferire contenuti nei dispositivi, e la libertà di spostarli direttamente.
Tra l’ altro, iTunes è un software pachidermico che riempie l’ HD e il SO di cose inutili.ITunes gira solo sotto iOS e Windows, altra grandissima limitazione.

In sintesi: la Apple non è ciò che molti credono, è tantissimo fumo, scarso arrosto, e conto esorbitante.

Formato dei file MBDB e MBDX

Manifest.mbdx

Manifest.mbdb and Manifest.mbdx are the two files in the iPhone backup directory which provide information and data about all the other files, along with filesystem structure data.

The MBDX file is the index file of the backup, and indexes elements that will be found in Manifest.mbdb. It is made of a fixed length header and a number of fixed length records, one for each element to be listed.

Header structure:

uint8[6] containing the string “mbdx\2”.
uint32 containing the number of following records.

Records structure:

uint8[20] key of the referenced element, which is also the name of the element as saved in the backup directory.
uint32 offset of the corresponding record in Manifest.mbdb file. The offset doesn’t count the Manifest.mbdb header (6 bytes), so the absolute offset is calculated by adding 6 to the value read in the field.
uint16 file mode.

The file mode is a 16 bits value (from 15 to 0) whose fields contain:

bits 15 to 12 identify the file type: “A” for a symbolic link, “4” for a directory or “8” for a regular file.
bits 11 to 8 permissions for the file owner to read (bit 10), write (bit 9) and execute (bit 8) the element.
bits 7 to 4 permissions for the users in the file group to read (bit 6), write (bit 5) and execute (bit 4) the element.
bits 3 to 0 permissions for all the other users to read (bit 2), write (bit 1) and execute (bit 0) the element.

 

Introduzione

Con iTunes 9.2 è cambiato il file Manifest.plist, sono stati rimossi i file .mdinfo, e l’ estensione .mddata non viene più usata; comunque la chiave a 40 digit è la stessa.

Ora il database dei file è contenuto in due file: Manifest.mbdb e Manifest.mbdx. La lista delle applicazioni rimane in Manifest.plist, ma il formato è leggermente cambiato.

Details

Importante : tutti i numeri sono big endian.

MBDX

E’ il file indice.

header

uint8[6]    'mbdx\2\0'
uint32      record count in the file

record (fixed size of 26 bytes)

uint8[20]  the Key of the file, it's also the filename in the backup directory
           It's the same key as 9.1 backups.
uint32     offset of file record in .mbdb file
           Offsets are counted from the 7th byte. So you have to add 6 to this number
           to get the absolute position in the file.
uint16     file mode
           Axxx  symbolic link
           4xxx  directory
           8xxx  regular file
           The meaning of xxx is unknown to me, it corresponds to the Mode field
           in the old backup data.

MBDB

header

uint8[6]    'mbdb\5\0'

record (variable size)

string     Domain
string     Path
string     LinkTarget          absolute path
string     DataHash            SHA.1 (some files only)
string     unknown             always N/A
uint16     Mode                same as mbdx.Mode
uint32     unknown             always 0
uint32     unknown
uint32     UserId
uint32     GroupId             mostly 501 for apps
uint32     Time1               relative to unix epoch (e.g time_t)
uint32     Time2               Time1 or Time2 is the former ModificationTime
uint32     Time3
uint64     FileLength          always 0 for link or directory
uint8      Flag                0 if special (link, directory), otherwise unknown
uint8      PropertyCount       number of properties following

Property is a couple of strings:

string      name
string      value               can be a string or a binary content

A string is composed of a uint16 that contains the length in bytes or 0xFFFF (for null or N/A) then the characters, in UTF-8 with canonical decomposition (Unicode normalization form D).

How to parse the Manifest.mbdb file in an iOS 4.0 iTunes Backup

http://stackoverflow.com/questions/3085153/how-to-parse-the-manifest-mbdb-file-in-an-ios-4-0-itunes-backup

iTunes used to store a list of filenames associated with backup files in the Manifest.plist file, but in iOS 4.0 it has moved this information to a Manifest.mbdb

script “iphonels.py”:

#!/usr/bin/env python
import sys

def getint(data, offset, intsize):
    """Retrieve an integer (big-endian) and new offset from the current offset"""
    value = 0
    while intsize > 0:
        value = (value<<8) + ord(data[offset])
        offset = offset + 1
        intsize = intsize - 1
    return value, offset

def getstring(data, offset):
    """Retrieve a string and new offset from the current offset into the data"""
    if data[offset] == chr(0xFF) and data[offset+1] == chr(0xFF):
        return '', offset+2 # Blank string
    length, offset = getint(data, offset, 2) # 2-byte length
    value = data[offset:offset+length]
    return value, (offset + length)

def process_mbdb_file(filename):
    mbdb = {} # Map offset of info in this file => file info
    data = open(filename).read()
    if data[0:4] != "mbdb": raise Exception("This does not look like an MBDB file")
    offset = 4
    offset = offset + 2 # value x05 x00, not sure what this is
    while offset < len(data):
        fileinfo = {}
        fileinfo['start_offset'] = offset
        fileinfo['domain'], offset = getstring(data, offset)
        fileinfo['filename'], offset = getstring(data, offset)
        fileinfo['linktarget'], offset = getstring(data, offset)
        fileinfo['datahash'], offset = getstring(data, offset)
        fileinfo['unknown1'], offset = getstring(data, offset)
        fileinfo['mode'], offset = getint(data, offset, 2)
        fileinfo['unknown2'], offset = getint(data, offset, 4)
        fileinfo['unknown3'], offset = getint(data, offset, 4)
        fileinfo['userid'], offset = getint(data, offset, 4)
        fileinfo['groupid'], offset = getint(data, offset, 4)
        fileinfo['mtime'], offset = getint(data, offset, 4)
        fileinfo['atime'], offset = getint(data, offset, 4)
        fileinfo['ctime'], offset = getint(data, offset, 4)
        fileinfo['filelen'], offset = getint(data, offset, 8)
        fileinfo['flag'], offset = getint(data, offset, 1)
        fileinfo['numprops'], offset = getint(data, offset, 1)
        fileinfo['properties'] = {}
        for ii in range(fileinfo['numprops']):
            propname, offset = getstring(data, offset)
            propval, offset = getstring(data, offset)
            fileinfo['properties'][propname] = propval
        mbdb[fileinfo['start_offset']] = fileinfo
    return mbdb

def process_mbdx_file(filename):
    mbdx = {} # Map offset of info in the MBDB file => fileID string
    data = open(filename).read()
    if data[0:4] != "mbdx": raise Exception("This does not look like an MBDX file")
    offset = 4
    offset = offset + 2 # value 0x02 0x00, not sure what this is
    filecount, offset = getint(data, offset, 4) # 4-byte count of records 
    while offset < len(data):
        # 26 byte record, made up of ...
        fileID = data[offset:offset+20] # 20 bytes of fileID
        fileID_string = ''.join(['%02x' % ord(b) for b in fileID])
        offset = offset + 20
        mbdb_offset, offset = getint(data, offset, 4) # 4-byte offset field
        mbdb_offset = mbdb_offset + 6 # Add 6 to get past prolog
        mode, offset = getint(data, offset, 2) # 2-byte mode field
        mbdx[mbdb_offset] = fileID_string
    return mbdx

def modestr(val):
    def mode(val):
        if (val & 0x4): r = 'r'
        else: r = '-'
        if (val & 0x2): w = 'w'
        else: w = '-'
        if (val & 0x1): x = 'x'
        else: x = '-'
        return r+w+x
    return mode(val>>6) + mode((val>>3)) + mode(val)

def fileinfo_str(f, verbose=False):
    if not verbose: return "(%s)%s::%s" % (f['fileID'], f['domain'], f['filename'])
    if (f['mode'] & 0xE000) == 0xA000: type = 'l' # symlink
    elif (f['mode'] & 0xE000) == 0x8000: type = '-' # file
    elif (f['mode'] & 0xE000) == 0x4000: type = 'd' # dir
    else: 
        print >> sys.stderr, "Unknown file type %04x for %s" % (f['mode'], fileinfo_str(f, False))
        type = '?' # unknown
    info = ("%s%s %08x %08x %7d %10d %10d %10d (%s)%s::%s" % 
            (type, modestr(f['mode']&0x0FFF) , f['userid'], f['groupid'], f['filelen'], 
             f['mtime'], f['atime'], f['ctime'], f['fileID'], f['domain'], f['filename']))
    if type == 'l': info = info + ' -> ' + f['linktarget'] # symlink destination
    for name, value in f['properties'].items(): # extra properties
        info = info + ' ' + name + '=' + repr(value)
    return info

verbose = True
if __name__ == '__main__':
    mbdb = process_mbdb_file("Manifest.mbdb")
    mbdx = process_mbdx_file("Manifest.mbdx")
    for offset, fileinfo in mbdb.items():
        if offset in mbdx:
            fileinfo['fileID'] = mbdx[offset]
        else:
            fileinfo['fileID'] = "<nofileID>"
            print >> sys.stderr, "No fileID found for %s" % fileinfo_str(fileinfo)
        print fileinfo_str(fileinfo, verbose)

Nomi dei file in iOS

http://nelsonslog.wordpress.com/2011/04/22/iphone-consolidated-db-location-tracking-notes/

iPhone consolidated.db location tracking notes

By nelsonminar

I’m trying to understand the consolidated.db iPhone location database, which means understanding how iOS stores and managing data. Here’s some notes.

Resources

  1. @aallan’s original announcement
  2. iPhone Tracker (Objective C code)
  3. Technical instructions from howto.wired
  4. nphonetrack (.NET code)
  5. iPhoneLs.py
  6. iphone-tracker.py
  7. Quick start for sqlite3
Notes
  • When you make a backup of an iPhone, it creates a big directory full of files with random 160 bit filenames. These are named files in the iPhone that iphonels.py can display. My 3 biggest files are named
    HomeDomain::Library/Caches/com.apple.WebAppCache/ApplicationCache.db
    AppDomain-com.foreflight.ForeFlightMobile::Documents/Procedures.zip
    RootDomain::Library/Caches/locationd/consolidated.db
  • consolidated.db is the file with the location data in it. It’s a sqlite3 database.
  • The juicy tables are (apparently) CellLocation and WifiLocation. The *Counts tables seem to contain just a row count. Presumably the Boxes tables are some sort of spatial index. I can find no record of how often I was at a specific location other than what’s implicit in the timestamps and density of cell/wifi locations.
  • I have 32,013 rows in CellLocation, 171,040 rows in WifiLocation
  • Timestamps are like 309803342: I believe this is NSDate seconds since 1 Jan 2001. Add 978307200 to get it in seconds since Unix 1970 epoch.
  • HorizontalAccuracy varies from 50-300 for WifiLocation, and up to 80,000 for CellLocation.
  • Confidence is 0, 50, 60, 65, 68, or 70
  • Speed and Course are always -1 (no surprise).
Some quicky sqlite3 shell code
.mode csv
.output wifilocation.csv
select Timestamp, Latitude, Longitude from WifiLocation order by Timestamp;
.output CellLocation.csv
select Timestamp, Latitude, Longitude from CellLocation order by Timestamp;
Some pasted info from sqlite3
sqlite> .tables
CdmaCellLocation                   CellLocationCounts
CdmaCellLocationBoxes              CellLocationHarvest
CdmaCellLocationBoxes_node         CellLocationHarvestCounts
CdmaCellLocationBoxes_parent       CellLocationLocal
CdmaCellLocationBoxes_rowid        CellLocationLocalBoxes
CdmaCellLocationCounts             CellLocationLocalBoxes_node
CdmaCellLocationHarvest            CellLocationLocalBoxes_parent
CdmaCellLocationHarvestCounts      CellLocationLocalBoxes_rowid
CdmaCellLocationLocal              CellLocationLocalCounts
CdmaCellLocationLocalBoxes         CompassCalibration
CdmaCellLocationLocalBoxes_node    Fences
CdmaCellLocationLocalBoxes_parent  Location
CdmaCellLocationLocalBoxes_rowid   LocationHarvest
CdmaCellLocationLocalCounts        LocationHarvestCounts
Cell                               TableInfo
CellLocation                       Wifi
CellLocationBoxes                  WifiLocation
CellLocationBoxes_node             WifiLocationCounts
CellLocationBoxes_parent           WifiLocationHarvest
CellLocationBoxes_rowid            WifiLocationHarvestCounts

CREATE TABLE CellLocation (
MCC INTEGER,
MNC INTEGER,
LAC INTEGER,
CI INTEGER,
Timestamp FLOAT,
Latitude FLOAT,
Longitude FLOAT,
HorizontalAccuracy FLOAT,
Altitude FLOAT,
VerticalAccuracy FLOAT,
Speed FLOAT,
Course FLOAT,
Confidence INTEGER,
PRIMARY KEY (MCC, MNC, LAC, CI));

CREATE TABLE WifiLocation (
MAC TEXT,
Timestamp FLOAT,
Latitude FLOAT,
Longitude FLOAT,
HorizontalAccuracy FLOAT,
Altitude FLOAT,
VerticalAccuracy FLOAT,
Speed FLOAT,
Course FLOAT,
Confidence INTEGER,
PRIMARY KEY (MAC));

Sincronizzare iphone su più PC

http://www.iphoneitalia.com/come-sincronizzare-liphone-con-due-o-piu-computer-8960.html

Come sapete, infatti, se provate a sincronizzare l’iPhone con iTunes installato su un altro computer, vi verrà chiesto se volete continuare, perdendo però tutti i dati sincronizzati con il precedente computer.

Vediamo oggi come risolvere questo problema e sincronizzare, sullo stesso iPhone, più librerie di musica, video e podcast presenti su diversi computer e gestire manualmente il vostro iPhone su un secondo computer.

Se, invece, vogliamo sincronizzare tali librerie su un computer (magari quello di casa) e  dati PIM, come contatti e calendario, su un altro (per esempio quello dell’ufficio) basta fare così: sincronizzate i soli dati PIM su un computer, ora sulla seconda macchina nella quale avete i file multimediali precedete con un’altra sincronizzazione, deselezionato i dati PIM. iTunes vi avvertirà che state per sovrascrivere le vostre librerie su iPhone, ma dato che non avevamo nessun file questo non sarà un problema.

Ma passiamo ora alla sincronizzazione di musica e video tra iPhone e più computer.

Backup della propria libreria

La prima cosa da fare è copiare i due file “iTunes Music Library.xml” e “iTunes Music Library” (iTunes Music Library.itl su Windows) dal secondo computer che vogliamo sincronizzare, in modo da averne una copia di backup. Su Mac trovate i due file nella directory Music/iTunes, mentre su Windows li trovate nella cartella Musica/iTunes in Documenti (o nome utente per Vista). Questi sono i due file che poi andremo a modificare.

Cercare il Library ID

Ora, dal computer con il quale sincronizzate normalmente l’iPhone, aprite iTunes Music Library.xml con un editor di testo (UltraEdit per Windows e TextExit o HexEdit per Mac vanno benissimo) e cercate il codice presente tra <string></string> subito dopo “Library Persistent ID”. Nell’esempio è 8B6C633F7DACB74B. Copiate questo codice su un foglio, in modo da poterlo ridigitare in seguito sul secondo computer. Ora potete chiudere la finestra.

Cambiare il Library ID

iTunes memorizza la vostra libreria di informazioni in due file. Un file XML e un file binario. È ora necessario modificare l’ID in entrambi in modo che le altre Librerie si possano sincronizzare con l’iPhone senza problemi.

Dal secondo computer che vogliamo sincronizzare accertatevi che iTunes sia chiuso ed aprite il file “iTunes Music Library.xml” con un editor di testo. Ancora una volta cercate il codice tra <string></string> subito dopo “Library Persistent ID” e copiatelo da qualche parte.

Ora sostituite questo codice con quello che avete copiato in precedenza. State attenti a non modificare nient’altro e che le cifre del codice siano 16. Salvate e chiudete il file.

Ora, sempre con un editor di testo, aprite il file “iTunes Music Library” (iTunes Music Library.itl su Windows), selezionate “Find and Replace” dal menù dell’editor di testo e assicuratevi che sia selezionata la voce “HEX” e non “ASCII”, quindi in Find digitate il primo codice che avete copiato  e in “Replace” inserite il secondo codice copiato. Selezionate “Replace All”. salvate e chiudete il file.

ATTENZIONE: assicuratevi di deselezionare l’autorizzazione iTunes Store dal secondo computer che volete sincronizzare prima di fare le modifiche (dopo potete riattivarlo), altrimenti perderete una delle cinque possibilità di autorizzazione che la Apple concede.

Fine

Bene, ora potete aprire iTunes da questo secondo PC e selezionare “Gestisci manualmente musica e video”. iTunes non vi chiederà più se volete sostituire la precedente libreria e i file presenti sull’iPhone non saranno cancellati. Potete anche sincornizzare normalmente musica e video sul secondo computer, purchè la gestione manuale sia invece attivata sul primo.

In pratica è necessario che tra il primo computer (quello “principale”) e gli altri non sia selezionata la stessa modalità di sincronizzazione.

Potete fare la stessa cosa con più computer, partendo sempre dal codice principale (il primo).

Maledetta Apple! – part 2

Finalmente ho finito di combattere con quello stupido iTunes.
Circa 3 ore…….perchè ?
Perchè c’ era la stampante USB accesa !
Complimenti agli sviluppatori software della Apple ! Siete dei grandi !
Avete preso un sistema BSD e siete stati capaci di rovinarlo !!!!

Se solo la gente potesse capire cosa significa “usare” Linux………..

Maledetta Apple !

Ma come caspita si fa ad adorare questi trabiccoli !
Sono oggetti carini, per carità…..ma il software fa pena pietà e compassione !
E questo solo per una scelta “politica” del produttore.
Sono oggetti pagati diverse centinaia di euro, ma non si può trasferire nessun contenuto nè via bluetooth nè via cavo nè via wifi.
Si può solo sincronizzare la libreria con iTunes…..bella cagata ! Così devo intasare un PC con tutti i contenuti multimediali…….e se poi ho diversi PC ? Allora proprio mi vien da ridere…..

Senza contare che il software è a pagamento, ma è stato preso da BSD che è gratuito.

In questo momento sto facendo un recovery di un iPhone 3GS perchè iTunes ha deciso di non vederlo più…..quindi la libreria multimediale del telefono verrà cancellata @#!?!£$ maledizione!

iTunes e iPhone: ridicoli

Ci risiamo.

Ho aggiornato iTunes ed è scomparso il segno di spunta su “Gestisci manualmente”.
Quindi se ora voglio aggiungere o rimuovere qualche file dall’ iphone, devo prima cancellare tutto.

Complimenti ai geni della Apple…..

Chissà se hanno pagato qualcosa quando si sono appropriati di BSD per “creare” Mac OS.