fdroidcl

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0

README

fdroidcl

GoDoc Build Status

F-Droid desktop client.

go get -u mvdan.cc/fdroidcl/cmd/fdroidcl

While the Android client integrates with the system with regular update checks and notifications, this is a simple command line client that talks to connected devices via ADB.

Quickstart

Download the index:

fdroidcl update

Show all available apps:

fdroidcl search

Install an app:

fdroidcl install org.adaway
Commands
update                Update the index
search <regexp...>    Search available apps
show <appid...>       Show detailed info about an app
devices               List connected devices
download <appid...>   Download an app
install <appid...>    Install or upgrade app
uninstall <appid...>  Uninstall an app
defaults              Reset to the default settings

A specific version of an app can be selected by following the appid with an colon (:) and the version code of the app to select.

Config

You can configure what repositories to use in the config.json file. On Linux, you will likely find it at ~/.config/fdroidcl/config.json.

You can run fdroidcl defaults to create the config with the default settings.

Advantages over the Android client
  • Command line interface
  • Batch install/update/remove apps without root nor system privileges
  • No need to install a client on the device
What it will never do
  • Run as a daemon, e.g. periodic index updates
  • Act as an F-Droid server
  • Swap apps with devices
Caveats
  • Index verification relies on HTTPS (not the JAR signature)
  • The tool can only interact with one device at a time
  • Hardware compatibility of packages is not checked

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoIndex = errors.New("no json index found inside jar")

Functions

This section is empty.

Types

type Apk

type Apk struct {
	VersName string   `json:"versionName"`
	VersCode int      `json:"versionCode"`
	Size     int64    `json:"size"`
	MinSdk   int      `json:"sdkver"`
	MaxSdk   int      `json:"maxsdkver"`
	ABIs     []string `json:"nativecode"`
	ApkName  string   `json:"apkname"`
	SrcName  string   `json:"srcname"`
	Sig      HexVal   `json:"sig"`
	Signer   HexVal   `json:"signer"`
	Added    UnixDate `json:"added"`
	Perms    []string `json:"permissions"`
	Feats    []string `json:"features"`
	Hash     HexVal   `json:"hash"`
	HashType string   `json:"hashType"`

	AppID   string `json:"-"`
	RepoURL string `json:"-"`
}

Apk is an Android package

func (*Apk) IsCompatible added in v0.3.0

func (a *Apk) IsCompatible(device *adb.Device) bool

func (*Apk) IsCompatibleABI added in v0.3.0

func (a *Apk) IsCompatibleABI(ABIs []string) bool

func (*Apk) IsCompatibleAPILevel added in v0.3.0

func (a *Apk) IsCompatibleAPILevel(sdk int) bool

func (*Apk) SrcURL added in v0.2.0

func (a *Apk) SrcURL() string

func (*Apk) URL added in v0.2.0

func (a *Apk) URL() string

type ApkList added in v0.2.0

type ApkList []Apk

func (ApkList) Len added in v0.2.0

func (al ApkList) Len() int

func (ApkList) Less added in v0.2.0

func (al ApkList) Less(i, j int) bool

func (ApkList) Swap added in v0.2.0

func (al ApkList) Swap(i, j int)

type App

type App struct {
	PackageName  string   `json:"packageName"`
	Name         string   `json:"name"`
	Summary      string   `json:"summary"`
	Added        UnixDate `json:"added"`
	Updated      UnixDate `json:"lastUpdated"`
	Icon         string   `json:"icon"`
	Description  string   `json:"description"`
	License      string   `json:"license"`
	Categories   []string `json:"categories"`
	Website      string   `json:"webSite"`
	SourceCode   string   `json:"sourceCode"`
	IssueTracker string   `json:"issueTracker"`
	Changelog    string   `json:"changelog"`
	Donate       string   `json:"donate"`
	Bitcoin      string   `json:"bitcoin"`
	Litecoin     string   `json:"litecoin"`
	FlattrID     string   `json:"flattr"`
	SugVersName  string   `json:"suggestedVersionName"`
	SugVersCode  int      `json:"suggestedVersionCode,string"`

	Localized map[string]Localization `json:"localized"`

	Apks []*Apk `json:"-"`
}

App is an Android application

func (*App) IconURL added in v0.2.0

func (a *App) IconURL() string

func (*App) IconURLForDensity added in v0.2.0

func (a *App) IconURLForDensity(density IconDensity) string

func (*App) SuggestedApk added in v0.3.0

func (a *App) SuggestedApk(device *adb.Device) *Apk

func (*App) TextDesc

func (a *App) TextDesc(w io.Writer)

type AppList added in v0.2.0

type AppList []App

func (AppList) Len added in v0.2.0

func (al AppList) Len() int

func (AppList) Less added in v0.2.0

func (al AppList) Less(i, j int) bool

func (AppList) Swap added in v0.2.0

func (al AppList) Swap(i, j int)

type HexVal added in v0.2.0

type HexVal []byte

func (*HexVal) String added in v0.2.0

func (hv *HexVal) String() string

func (*HexVal) UnmarshalText added in v0.2.0

func (hv *HexVal) UnmarshalText(text []byte) error

type IconDensity added in v0.2.0

type IconDensity uint
const (
	UnknownDensity IconDensity = 0
	LowDensity     IconDensity = 120
	MediumDensity  IconDensity = 160
	HighDensity    IconDensity = 240
	XHighDensity   IconDensity = 320
	XXHighDensity  IconDensity = 480
	XXXHighDensity IconDensity = 640
)

type Index

type Index struct {
	Repo     Repo             `json:"repo"`
	Apps     []App            `json:"apps"`
	Packages map[string][]Apk `json:"packages"`
}

func LoadIndexJSON added in v0.4.0

func LoadIndexJSON(r io.Reader) (*Index, error)

func LoadIndexJar

func LoadIndexJar(r io.ReaderAt, size int64, pubkey []byte) (*Index, error)

type Localization added in v0.4.0

type Localization struct {
	Summary     string `json:"summary"`
	Description string `json:"description"`
}

type Repo added in v0.2.0

type Repo struct {
	Name        string   `json:"name"`
	Timestamp   UnixDate `json:"timestamp"`
	Address     string   `json:"address"`
	Icon        string   `json:"icon"`
	Version     int      `json:"version"`
	MaxAge      int      `json:"maxage"`
	Description string   `json:"description"`
}

type UnixDate added in v0.4.0

type UnixDate struct {
	time.Time
}

UnixDate is F-Droid's timestamp format. It's a unix time, but in milliseconds. We can ignore the extra digits, as they're always zero, and won't be displayed anyway.

func (*UnixDate) String added in v0.4.0

func (ud *UnixDate) String() string

func (*UnixDate) UnmarshalJSON added in v0.4.0

func (ud *UnixDate) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL