Debug iCloud key-value data in the cloud - icloud

I have been banging my head against the wall trying to figure out how to determine what is actually in the key-value store for a given app. Using the api to detect data seems dubious to me as I am afraid of getting false positives. Also I would have to guess at what else might be there (i.e. from previous versions of the app or whatever). So far as I can tell, the developer test website only shows files in the cloud, and not the key-value store. Does anyone know how to access this data, or where in the filesystem the local .plist file is stored (I assume it is in a .plist anyway)?

I finally found it. There is a circuitous route to get there. ~/Library/SyncedPreferences/com.apple.syncedpreferences.plist has a dictionary entry for each application bundle. Inside that dictionary is the key plistPath. This points to the actual plist file that contains the key-value data for your app (on the local device anyway). This file is stored in your app's container at ~/Library/Containers/<bundleName>/Data/Library/SyncedPreferences and appears to be named <bundleName>.plist. Still don't know how to view what is actually in the cloud, so I guess I will have to trust what is in the local file. :)

I know this question is old but shows up in google search so it may help others.
In case that the device is a simulator the path are as follows:
Directory for application bundle list is:
~/Library/Developer/CoreSimulator/Devices/<Device-ID>/data/Library/SyncedPreferences/com.apple.syncedpreferences.plist
File with key-value data for your app:
~/Library/Developer/CoreSimulator/Devices/<Device-ID>/data/Containers/Data/Application/<App-ID>/Library/SyncedPreferences/<bundleName>.plist

Related

Saving offline map atlas inside osmdroid

Is there a solution to save the map tiles inside the app like the Mobile Atlas Creator works on the desktop?
I only found a way by using PC application.
There sure is. It probably needs some more testing, but the example is located here:
https://github.com/osmdroid/osmdroid/blob/master/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleCacheDownloaderArchive.java
Essentially, when you fire up an instance of CacheManager, it gets the map view's IFileSystemCache instance, which is normally the Sqlite tile cache (the kind that expires). This example feeds in an alternate implementation that produces a permanent sql tile archive (no expiration dates in it).
Use it with caution has many tile sources do not allow you to do this in their terms of service and you can get banned for doing so
Edit: there's more info the wiki
https://github.com/osmdroid/osmdroid/wiki/Offline-Map-Tiles#use-osmdroids-cache-manager-on-device---version-52

Making data entry fields remember their values form one run to the next

I'm writing a C++ MFC program, and I see programs that remember the last input values for some fields from one program run to the next. I could do this by saving it to a file and loading that and then repopulating, but is there another, quicker way of doing this, as I think I remember reading somewhere that these values could be stored in the registry? If anyone has an example or personal experiences, I would be very interested.
Thanks,
James
There are many options out there
I personally don't like the registery and prefer to keep my program portable.
so what I can think of right now are
1- ini files
2- property files
3- SQL server
4- you can also synchronize the user settings via web server, but as #Jeeva mentioned there are security considerations
Cheers
It all depends on what kind of values you want remember. If it is an configuration data you can use config files. If it is small application data you can use flat files with proprietary format. If it is huge data you can use a database like SQL Server.
Usually there is a debate about using ini file vs registry.
Other things you want to consider is whether the data will be used across network. Whether you need to encrypt.

How to retrieve a list of files of given repository (MirrorBrain)?

The repository I am asking is for Linux, but my problem is related to client -- i.e. with retrieving those data, and client can be Linux, Windows, Mac OS X, etc. So I opted against asking this question on Unix&Linux site, if admins feel it should be U&L question please move it to the other site.
Consider such repository as http://download.opensuse.org/repositories/LCD/openSUSE_11.4/x86_64/ -- you can fetch the html for it, parse it, and get the list of files. However I hardly believe it is correct way -- since the html is created by website engine (MirrorBrain in this case), there should be some web service API to get this list directly.
I googled, but didn't find anything relevant.
So -- how to get the list of the file directly, no parsing, just call, and getting the collection of file names.
MirrorBrain doesn't have an API call to retrieve a list of files. (It only has API calls to retrieve a list of mirrors for a single file, by appending .mirrorlist or .meta4 to a file's URL.) It would be a worthwhile idea to add such an api call (patches welcome!).
So there's only the standard HTTP server directory index to read a file list from. The format varies from server to server, and even Apache has different variants. With Apache, a little trick that can help is to append ?F=0 to the directory URL if you want to get only the filenames (it will simplify the index), or to append ?F=1 to switch to the fancier variant which includes more details.
Hope this helps.

Setting the label for a Windows networking mapping

Is it possible to give a network drive mapping (as created with the WNetAddConnection functions or "Map network drive..." GUI) a label other than the default "<Target Name> (<Target Path>) (<Drive Letter>:)" one?
I tried giving SetVolumeLabel a go but this always fails, and I see nothing in the WNet API's to specficy the display label.
This isn't a 100% solution but it's more of an answer than a comment...
If you rename a mapped network drive the the GUI (by right clicking on it and going to 'Rename') it adds a value to the registry. Reading round on various sites (notably this one) it looks like Windows may sporadically delete this value by itself, so this may not be a permanent solution...
I have just manually done it through regedit and it worked in the GUI, so I see no reason why it shouldn't work programmatically as well
Add a string value called _LabelFromReg with a value of whatever you want the label to be to the registry key
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##<server-name>#<share-name>
This key should already exist if you have already created the share.
Apparently (see the link above) you then need to make that key read-only to prevent the OS from changing it back at will - I don't know how you would do that programmatically but i'm sure it can be done.
I know there are huge gaps in this answer, but maybe it's a poke in the right direction?

Check USB Content

I have developed an C++ algorithm, which saves the contents of a USB key in a database. In the Database, as well as save the file names are saved on the USB device info: free blocks and vendors.
So when I put more control keys free blocks.
If the comparison were to change, the database must be recreated. So if I remove or add files to the USB key, the database is rebuilt from scratch. But when I rename a file, nothing happens.
You can find out the changes without having to check each file in the database?
How can I better control of the entire contents of a USB device? Some help!
Thanks!
P.s.: I used ioctl for vendor name and free blocks!!
You could create a hash value from the folder file listing and store that in your DB.
Each time the USB stick is inserted perform the hash calculation of the folder listing and compare to the value stored. If they are different you can assume files have been removed, added or renamed and perform a refresh of your DB.
If you control the OS and the USB key, you can use NTFS. It has a change log feature. This contains an Update Sequence Number (USN). Any change to the key will change the USN. So, you only need to save the old value in your database. If you see a new value, reread the whole file system and update the USN in your database.