Accept licenses to auto-download support repository components

Description

The latest pre-packaged version of the support-repository is rev41, as published at https://dl.google.com/android/repository/android_m2repository_r41.zip. However, apps are starting to require newer versions, e.g. for constraint-layouts-beta. I do not know if Google will continue to update the repository the "old" way, but in any case, we should get ready to use the new auto-downloading stuff.

Suggested Fix

To do this, we need to have the license-sha1 hash stored in the $ANDROID_HOME folder. The following snippet will accept the current support-repo license:

mkdir "$ANDROID_HOME/licenses" || true
echo -e "\ne6b7c2ab7fa2298c15165e9583d0acf0b04a2232" > "$ANDROID_HOME/licenses/android-sdk-license"

What would be the best location to insert this? I'd guess somewhere around https://gitlab.com/fdroid/fdroidserver/blob/master/buildserver/provision-android-sdk#L16 ? Or (for a quick fix) I can add this to build recipes of apps in question, if $ANDROID_HOME is writeable.

Additional Information

Maybe most of you guys are familiar with how android and the sdk works, but I was not, so I will write up how to get (and verify) this hash -- if you already know, just ignore everything below.

To verify this hash, go to https://dl.google.com/android/repository/addon.xml find the part for the support repository, in this case:

<sdk:extra>
  <!--
      Generated from bid:3552956, branch:git_nyc-support-release
  -->
  <sdk:revision>
    <sdk:major>41</sdk:major>
    <sdk:minor>0</sdk:minor>
    <sdk:micro>0</sdk:micro>
  </sdk:revision>
  <sdk:archives>
    <sdk:archive>
          <!--Built on: Wed Dec  7 11:37:43 2016.-->
          <sdk:size>314015677</sdk:size>
          <sdk:checksum type="sha1">1aa21d8f205a056f2423bf96444ac82a5fcc9ee9</sdk:checksum>
          <sdk:url>android_m2repository_r41.zip</sdk:url>
    </sdk:archive>
  </sdk:archives>
  <sdk:uses-license ref="android-sdk-license"/>
  <sdk:vendor-id>android</sdk:vendor-id>
  <sdk:vendor-display>Android</sdk:vendor-display>
  <sdk:description>Local Maven repository for Support Libraries</sdk:description>
  <sdk:name-display>Android Support Repository</sdk:name-display>
  <sdk:path>m2repository</sdk:path>
</sdk:extra>

<sdk:uses-license ref="android-sdk-license"/> points us to the actual license text, located right at the top of the xml file at <sdk:license id="android-sdk-license" type="text">...</sdk:license>. Generating the sha1sum of the full content of this tag will get you the hash used above.

Short: xmlstarlet sel -t -v '//sdk:license[@id="android-sdk-license"]' addon.xml | sha1sum

References

Ref: https://code.google.com/p/android/issues/detail?id=212128

Ref: addon.xml

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information