Showing posts with label dropbox. Show all posts
Showing posts with label dropbox. Show all posts

Saturday, 30 July 2016

WatchMaker - unpacking the .watch file - updated!

WatchMaker has been enhanced since I wrote this post originally, so I thought I'd post an updated version.

When you export a watch from WatchMaker, the app creates a ".watch" file.  This can then be imported by someone else, or uploaded to a face sharing website (such as FaceRepo) for others to enjoy.  

If you're like me though, you might be interested in how this ".watch" file is made up though, what it contains.  So let's take one of my first watch faces for example...



The file itself is a ZIP archive, so the first step is to extract the files.  Personally I prefer 7-Zip, but you can use the tool of your choice for this.

After you've unpacked the files, you should see a structure something like this...



The files included in this example are...

  • fonts
    • Roboto-Regular.ttf
  • images
    • .img25.jpg
    • .img60.png
    • .img61.png
    • .img62.png
    • .img63.png
  • preview.jpg
  • preview_dim.jpg
  • watch.xml

So any fonts and images that are used in the watch face are included in their respective folders.  For example, the ".img60.png" and ".img61.png" are Sprites that hold multiple images in one, for the battery levels.  There is also the background (".img25.jpg") and both watch hands (".img62.png" and ".img63.png").

There are also two preview images, for both the normal/bright preview ("preview.jpg") and the dimmed preview ("preview_dim.jpg").

The final file (watch.xml) is probably the most interesting, as this contains all of the settings and configuration of the watch face and the layers that make it up.  You can open this file to view in a web browser, or you can edit it in any text editor (I prefer Notepad++)...



This ".xml" file has a root <Watch> tag, with attributes that contain the settings for the watch face, and then a number of <Layer> tags, with attributes that contain the configuration for each layer.  Whilst you may or may not be familiar with XML, it should be easy enough to tell from the attributes and their values how these match up with the different properties in the WatchMaker app.  

The main addition in recent months is the "features" attribute of the <Watch> tag - this is automatically updated as you edit the watch face and add/remove tags.  It is then used by sites (such as FaceRepo) to list the features that your watch face has.

This includes the layers of type "image" which have a "path" and those of type "text" which have a "font", both of which link to the included files above.  Also there's the "display" attribute, which is "b" for bright only, "d" for dimmed only and "bd" for always.

Next time I'm working on a complicated LUA script, I may well export it to Dropbox so I can write it on my laptop, then import it back into the WatchMaker app - much easier than typing curly braces on my phone keyboard!

There is also the option now to export a watch face in "protected" mode.  This creates a slightly different set of files...


Now there is an extra file called "watch.pxml", and the contents of the "watch.xml" file are quite different...


Now "watch.xml" only contains the <Watch> tag, with the "protection" attribute set.  

All of the layers are in "watch.pxml"...



...but they're encrypted!  This is great for when you've created a watch that you want to sell on the Play store, or upload without the risk of someone copying and modifying your watch face.

Hopefully you've found this update useful.

Sunday, 8 March 2015

New favourite app - Authenticator Plus

It's official, I have a new favourite app!

I think it's universally accepted that Two Factor Authentication (2FA) is a good idea.  In short, many sites allow you to add an extra later of authentication.  Typically this works by having a code that needs to be entered whilst logging into a new device, which is tied physically to the user in some way...


It is also common to have two factor authentication using additional information, such as a pin number or security question.  However, this is still something that can be guessed more easily, so I personally don't count these as proper two factor authentication.  And there's also biometrics, but we've all seen Minority Report!

With each of the options in the list above, you have to register your device in some way.  Once registered, you log in by entering your username and password as before, but then you are taken to a second screen.  This second screen insists that you enter a code, which only you can generate/retrieve using your registered device, thus proving that it is you who are logging in.  You usually get the option to make this a trusted device, which means you won't be asked for the two factor code on this device for a while, usually 30 days.

Initially I setup my main accounts (especially Google!) to use SMS authentication.  This is easy to setup, as all they need is your mobile number.  However, there can sometimes be a delay in the site sending your message, or it being delivered, especially if you're in an area with poor reception.  So I had to investigate other options.

I have a Yubikey and it is pretty cool, you plug it into a USB port and when required you put the cursor in the code field and click the button on the device - it is registered like a keyboard so it can generate and spit out a code directly into the field.  It even clicks enter for you, submitting the form - very cool!  Unfortunately, not many sites support them, and you then have to make sure that you have the Yubikey on you all the time.

The best option I've found is to use an authenticator app.  This is on your phone, and who doesn't have their phone on them all the time anyway?  There are a few options, but here are a couple of examples...

Google Authenticator                    Authenticator Plus

Originally I loved Google Authenticator, but now I prefer Authenticator Plus, and here's why...
  1. It uses the Material Design - this is a Google thing, so I'm sure they'll catch up soon.
  2. It shows the icons appropriate for the account, making them more easily distinguishable at a glance.
  3. It can backup and restore the linked accounts from the cloud - mine is saved to Dropbox, which is also one of my linked accounts).
  4. You can also see the codes on your smartwatch - no need to get your phone out of your pocket!

I find this so convenient, I love it.  I'm a big user of Dropbox, which means I'm often finding I want to grab a file on a public computer, and this means I often need to grab a new code.  The voice command is "Start Authenticator" and then you immediately have your first linked account on the screen, with the current code.  Swipe up and down to move between the linked accounts, simple as that.

If you don't have two factor authentication in your digital life, get it!  And if you don't have Authenticator Plus on your phone and watch to manage your linked accounts, get it!

Monday, 23 February 2015

WatchMaker - unpacking the .watch file

When you export a watch from WatchMaker, the app creates a ".watch" file.  This can then be imported by someone else, or uploaded to a face sharing website (such as FaceRepo) for others to enjoy.  

If you're like me though, you might be interested in how this ".watch" file is made up though, what it contains.  So let's take one of my first watch faces for example...



The file itself is a ZIP archive, so the first step is to extract the files.  Personally I prefer 7-Zip, but you can use the tool of your choice for this.

After you've unpacked the files, you should see a structure something like this...



The files included in this example are...

  • fonts
    • Roboto-Regular.ttf
  • images
    • battery_set_1.png
    • bg_premium5.jpg
    • hand_hour_22.png
    • hand_minute_22.png
  • preview.jpg
  • watch.xml

So any fonts and images that are used in the watch face are included in their respective folders.  For example, the "battery_set_1.png" is a Sprite that holds multiple images in one.  There is also the background ("bg_premium5.jpg") and both watch hands.

There is also a preview image ("preview.jpg") - this is the image that is displayed above, and it's also the one that FaceRepo uses.  There is currently a feature request to add a dimmed preview image to the ".watch" file as well.

The final file (watch.xml) is probably the most interesting, as this contains all of the settings and configuration of the watch face and the layers that make it up.  You can open this file to view in a web browser, or you can edit it in any text editor (I prefer Notepad++)...


This ".xml" file has a root <Watch> tag, with attributes that contain the settings for the watch face, and then a number of <Layer> tags, with attributes that contain the configuration for each layer.  Whilst you may or may not be familiar with XML, it should be easy enough to tell from the attributes and their values how these match up with the different properties in the WatchMaker app.  

This includes the layers of type "image" which have a "path" and those of type "text" which have a "font", both of which link to the included files above.  Also there's the "display" attribute, which is "b" for bright only, "d" for dimmed only and "bd" for always.

Next time I'm working on a complicated LUA script, I may well export it to Dropbox so I can write it on my laptop, then import it back into the WatchMaker app - much easier than typing curly braces on my phone keyboard!