lib/AppleBackup.rb
##
# This method iterates through the app UUIDs of a physical backup to 
# identify which one contains Notes. It does it this way to ensure that all 
# files were correctly pulled. It returns the String representing the UUID or 
# nil if not appropriate.
This method iterates through the app UUIDs of a physical backup to
identify which one contains Notes. It does it this way to ensure that all
files were correctly pulled. It returns the String representing the UUID or
nil if not appropriate.
This method iterates through the app UUIDs of a physical backup to identify which one contains Notes . It does it this way to ensure that all files were correctly pulled . It returns the String representing the UUID or nil if not appropriate .
def find_physical_backup_app_uuid
    return nil if (!@root_folder or !@root_folder.directory? or !(@root_folder + "private" + "var" + "mobile" + "Containers" + "Shared" + "AppGroup").directory?)
    app_uuid = nil
    app_folder = @root_folder + "private" + "var" + "mobile" + "Containers" + "Shared" + "AppGroup"
    app_folder.children.each do |child_entry|
      if child_entry.directory? and (child_entry + "NoteStore.sqlite").exist?
        app_uuid = child_entry.basename
      end
    end
    return app_uuid
  end
def find_physical_backup_app_uuid return nil if ( ! @root_folder or ! @root_folder . directory? or ! ( @root_folder + "private" + "var" + "mobile" + "Containers" + "Shared" + "AppGroup" ) . directory? ) app_uuid = nil app_folder = @root_folder + "private" + "var" + "mobile" + "Containers" + "Shared" + "AppGroup" app_folder . children . each do | child_entry | if child_entry . directory? and ( child_entry + "NoteStore.sqlite" ) . exist? app_uuid = child_entry . basename end end return app_uuid end
This method iterates through the app UUIDs of a physical backup to
identify which one contains Notes.
This method iterates through the app UUIDs of a physical backup to identify which one contains Notes .
# Bail out if this doesn't look obviously right # Create a variable to return # Create a variable for simplicity # Loop over each child entry to check them for what we want