• Stars
    star
    584
  • Rank 76,276 (Top 2 %)
  • Language
    Java
  • Created about 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An attempt to provide advanced battery stats for Android

Build CircleCI

#License BetterBatteryStats is an open source project unter the terms of the Apache 2.0 License. The license does not apply to the use of the names "BetterBatteryStats" and "Better Battery Stats", nor to the icon / artwork created for BetterBatteryStats.

Build

In order to build (with gradle / Android Studio) following changes to the local project are required

HockeyApp

The environment variable HOCKEYAPP_APP_ID must be set to a valid value

Signing

The signing config uses environment variables:

    signingConfigs {
        release {
            storeFile file(System.getenv("KEYSTORE_RELEASE"))
            storePassword System.getenv("KEYSTORE_PASSWORD")
            keyAlias System.getenv("KEY_ALIAS")
            keyPassword System.getenv("KEY_PASSWORD")
        }
        debug {
            storeFile file(System.getenv("KEYSTORE_DEBUG"))
        }
    }
  • KEYSTORE_RELEASE points to the release .keystore file
  • KEYSTORE_DEBUG points to the debug .keystore file
  • KEY_ALIAS defines the alias name
  • KEY_PASSWORD is the keystore password

Continuous Integration

The continuous integration (in this example CircleCI) needs to have access to some private settings.

Google play publishing

Publishing profile

The encrypted file (sa-google-play.json-cipher) is located in /app, and referenced by the gradle build.

See also https://github.com/Triple-T/gradle-play-publisher.

Deploy task

In circle.yml we define that all the google play publishing (to beta) is triggered on tag release-*

Encrypt

openssl enc -in infile -out infile-cipher -e -aes256 -k $KEY

See also https://github.com/circleci/encrypted-files

Decrypt (on CircleCI, as defined in circle.yml and using an env-variable KEY)

openssl enc -in encrypted-cipher -out encrypted -d -aes256 -k $KEY

The signing keys

The environment variables $KEYSTORE_RELEASE, $KEYSTORE_DEBUG, $KEY_ALIAS, $KEY_PASSWORD and $KEYSTORE_PASSWORDmust be set.

There variables are set in secret-env-plain (not part of the project for obvious reasons).

In order to run your own build create a file secret-env-plain and set the variables:

export KEYSTORE_PASSWORD=<your-keystore-pwd>
export KEY_PASSWORD=<your-key-pwd>
export KEY_ALIAS=<your-key-alias>
export KEYSTORE_DEBUG=<name-of-debug-keystore>
export KEYSTORE_RELEASE=<name-of-release-keystore>

and then encrypt this file using openssl aes-256-cbc -e -in secret-env-plain -out secret-env-cipher -k $KEY

In the piepline the decyption is done using the script circleciscripts/decrypt_env_vars.sh with the $KEY stored in circle-ci's env vars.

As the signing keys are not in the github repo a script circleciscripts/download_keystore.sh does the job of downloading and decrypting the keys at build-time. For that to happen following addition environment variables must be set:

  • $KEYSTORE_URI a public URI from where the files can be downloaded using http
  • $KEY the key to decrypt the keystores (same env var as for google-services.json)

More Repositories

1

BetterBatteryStats-Knowledge-Base

Knowledge around BetterBatteryStats, mainly about partial wakelocks
JavaScript
56
star
2

AndroidCommon

A Lib Project containing common / reusable stuff for Android
Java
42
star
3

BetterWifiOnOff

An intelligent agent to manage your Wifi status
Java
26
star
4

locating-ssh-hackers

A DIY project to show failed ssh login attempts on a map in real-time
JavaScript
11
star
5

sharepoint2013-dev

sharepoint2013-dev image automation
PowerShell
10
star
6

ALTitude

A replacement for google Latitude optimized for updating the location with less battery drain
Java
9
star
7

XposedTrace

An Xposed mod to trace various Android classes
Java
6
star
8

azure-functions-slack-bot

A nodejs Azure Function to post to Slack
JavaScript
5
star
9

CommandCenter

the power of shell without having to use the terminal
Java
5
star
10

BetterBatteryStatsSystemApp

A system app to grant BetterBatteryStats BATTERY_STATS permission on Kitkat
Java
4
star
11

openpolicyagent

Install and play with OPA
3
star
12

learning-envoy

2
star
13

rss2nzb

A powerfull and versatile nzb downloader
Perl
2
star
14

CaptiveBrowser

A simple browser as launcher
JavaScript
2
star
15

BatterynfoTests

Testing the batteryinfo/atterystats service on KitKat
Java
2
star
16

AudioRescue

Controls earpiece and headset
Java
1
star
17

unclutter

An android app to help you manage / remove unused apps
Java
1
star
18

docker-kubernetes-deploy

A helper to deploy to kubernetes
Shell
1
star
19

kubernetes-dr-on-azure

Automation to build a kubernetes DR cluster and restore workloads
Shell
1
star
20

BetterLN

Backlight notification for Android
Java
1
star
21

log4j-poc

A poc to understand the impact of log4j-shell
Dockerfile
1
star
22

asksven.github.com

Webview on my repo
1
star
23

AndroidDev_VA

Not only Android Dev virtual appliance
Shell
1
star
24

maintenance

A little project leveraging nginx's canary annotations to deploy a maintenance page that can be bypassed using a cookie: this allows you to test your application without letter users hit it while you do.
1
star
25

ALTitude_full

License for ALTitude
Java
1
star
26

playground

Just a playground for some testing
1
star
27

LedEffects

LedEffects runs on Android. It runs as a service and applies different selectable notification effects (sound, led, vibration) depending on triggered events
Java
1
star
28

home-automation-blink-control

Control your Blink security cameras based on presence and time
Shell
1
star