Android SDK Manager Request to access "~/.android" folder

Hello
Requires access to Android files for the Android SDK. This is due to the fact that I could not change the location of the sdkamanager configurations from Google. The configurations are in the $HOME/.android folder. Without access to it, skdmanager will not be able to work.

An automatic connection with android-config is also required.

Package Card:
Name: androidsdk
Source Code: GitHub
Page: Snap-Store
Owner: quasarrapp

SnapCraft:

name: androidsdk 
version: '1.0.1'
summary: The package contains android sdkmanager. # 79 char long summary
description: |
  This is snap version of console sdk manager for Android. For more information about sdkmanager see official google documentation git@github.com:EndrII/sdkmanager-android.git. 

grade: stable 
confinement: strict 
base: core18
architectures:
  - build-on: amd64
  
parts:
  androidsdk:
    # See 'snapcraft plugins'
    plugin: dump
    source: https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
    stage-packages:
      - libfreetype6
      - libpng16-16
      - openjdk-8-jdk
      - openjdk-8-jre
      - openjdk-8-jre-headless
    build-packages:
      - ca-certificates
      - ca-certificates-java
      - openjdk-8-jre-headless
    override-stage: |
      snapcraftctl stage
      chmod 777 -R "$SNAPCRAFT_STAGE/tools"

    after:
      - androidsdk-wraper


  androidsdk-wraper:
    # See 'snapcraft plugins'
    plugin: dump
    source: scripts

plugs:
  android-config:
    interface: personal-files
    read:
    - $HOME/.android
    write:
    - $HOME/.android

apps:
  androidsdk:
    command: start.sh
    plugs:
      - home
      - removable-media
      - network
      - android-config
      
    environment:
      PATH: '$SNAP:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH'
      LD_LIBRARY_PATH: '$SNAP_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu'

What is required of me to get permission to use the android-config?

I moved the home environment to the snap folder.
the request is no longer relevant

export _JAVA_OPTIONS=-Duser.home=$HOME
1 Like