Skip to content

Commit

Permalink
1.4.0 - Modern Serviceless Notification Updates, ADB Instructions for…
Browse files Browse the repository at this point in the history
… "Time Remaining", Modern Activity and Preference Themes
  • Loading branch information
Tyler Williamson committed Apr 14, 2022
1 parent 00843f9 commit 0ac6d18
Show file tree
Hide file tree
Showing 74 changed files with 2,751 additions and 590 deletions.
84 changes: 78 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,79 @@
# Built application files
app/release/
*.apk
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
.idea/
#.idea/workspace.xml
#.idea/tasks.xml
#.idea/gradle.xml
#.idea/assetWizardSettings.xml
#.idea/dictionaries
#.idea/libraries
#.idea/caches

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<img src="./fastlane/metadata/android/en-US/images/icon.png" alt="icon" height="60"> BatteryNotification
=================
[![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)](https://opensource.org/licenses/)[![GitHub Release](https://img.shields.io/github/release/TylerWilliamson/BatteryNotification.svg?style=flat)]()

Battery stats at a glance!

[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/com.ominous.batterynotification/)
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=com.ominous.batterynotification)

Description
---

Always Free (No IAPs or Ads) and Always Open Source

Persistent Notification Includes:
* Battery Level (Including Color Indicator for Android 5.0+)
* Battery Temperature (in Fahrenheit or Celcius)
* Charging State
* Battery Health
* Charging/Discharging Amperage (for Android 5.0+)
* (Root/ADB Only for Android 5.0+) Time Remaining Until Fully Charged or Discharged

Required Permissions:
* **android.permission.RECEIVE_BOOT_COMPLETED** - Used to restart the notification after rebooting the device

Optional Permissions:
* **android.permission.ACCESS_SUPERUSER** - Used to give the app the android.permission.BATTERY_STATS permission
* **android.permission.BATTERY_STATS** - Used to access the BatteryStats object to get the time remaining until fully charged or discharged
* **android.permission.ACCESS_WIFI_STATE** - Used to access the BatteryStats object to get the time remaining until fully charged or discharged


License
---
```
Copyright 2016 - 2022 Tyler Williamson
This file is part of BatteryNotification.
BatteryNotification is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
BatteryNotification is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BatteryNotification. If not, see <https://www.gnu.org/licenses/>.
```
Empty file removed adb
Empty file.
Binary file removed app/app-release.apk
Binary file not shown.
59 changes: 50 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,60 @@
apply plugin: 'com.android.application'
/*
* Copyright 2016 - 2022 Tyler Williamson
*
* This file is part of BatteryNotification.
*
* BatteryNotification is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BatteryNotification is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BatteryNotification. If not, see <https://www.gnu.org/licenses/>.
*/

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
apply plugin: "com.android.application"

android {
compileSdkVersion 31
defaultConfig {
applicationId "com.ominous.batterynotification"
minSdkVersion 17

targetSdkVersion 24
versionCode 7
versionName "1.1.1"
targetSdkVersion 31
versionCode 10
versionName "1.4.0"
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-DEBUG"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
}
}
compileOptions {
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
}
}
}

dependencies {
provided fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.activity:activity:1.4.0"
implementation "androidx.preference:preference:1.2.0"
implementation "androidx.work:work-runtime:2.7.1"
//We're going deeper
implementation "com.github.tiann:FreeReflection:9bc252d"
}
Binary file removed app/libs/FullFramework.jar
Binary file not shown.
Binary file removed app/libs/Notification for Change - B-46613 SSIS.docx
Binary file not shown.
62 changes: 54 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 - 2022 Tyler Williamson
~
~ This file is part of BatteryNotification.
~
~ BatteryNotification is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ BatteryNotification is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with BatteryNotification. If not, see <https://www.gnu.org/licenses/>.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.ominous.batterynotification">
Expand All @@ -10,36 +29,63 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.ominous.batterynotification.UPDATE_BATTERY_NOTIFICATION" />
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
<uses-permission android:name="android.permission.BATTERY_STATS" />
<uses-permission
android:name="android.permission.BATTERY_STATS"
tools:ignore="ProtectedPermissions" />

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<!-- OH GOD WHY -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<!-- We only need this for API 28+ -->
<uses-sdk tools:overrideLibrary="me.weishu.freereflection" />

<application
android:name=".application.BatteryNotification"
android:theme="@style/AppTheme"
android:allowBackup="true"
android:hardwareAccelerated="false"
android:fullBackupContent="@xml/backup_scheme"
android:dataExtractionRules="@xml/data_extraction_scheme"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.ominous.batterynotification.SettingsActivity">
tools:ignore="GoogleAppIndexingWarning"
tools:targetApi="s">
<activity android:name=".activity.SettingsActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.ominous.batterynotification.BatteryService" />
<receiver android:name="com.ominous.batterynotification.BatteryBroadcastReceiver"
android:enabled="true"
<service android:name=".service.BatteryService"
android:exported="true"
android:permission="com.ominous.batterynotification.UPDATE_BATTERY_NOTIFICATION">
android:permission="android.permission.BIND_JOB_SERVICE"
/>
<receiver
android:name=".receiver.GlobalBroadcastReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="com.ominous.batterynotification.UPDATE_ACTION" />

<action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
<receiver
android:name=".receiver.BatteryBroadcastReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="com.ominous.batterynotification.UPDATE_ACTION" />
</intent-filter>
</receiver>
</application>

</manifest>
Binary file added app/src/main/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0ac6d18

Please sign in to comment.