Compare commits
3 Commits
fd15d10028
...
2d5e0620af
Author | SHA1 | Date |
---|---|---|
Brandon Presley | 2d5e0620af | |
Joseph | 12f906bfc3 | |
Brandon Presley | eb30d81003 |
|
@ -87,8 +87,8 @@ android {
|
|||
applicationId "com.massive"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 36243
|
||||
versionName "2.28"
|
||||
versionCode 36244
|
||||
versionName "2.29"
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.ACCESS_NETWORK_STATE"
|
||||
|
@ -48,6 +49,11 @@
|
|||
|
||||
<service
|
||||
android:name=".TimerService"
|
||||
android:exported="false" />
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="specialUse">
|
||||
<property
|
||||
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
||||
android:value="App does not require SCHEDULE_EXACT_ALARM or USE_EXACT_ALARM, but needs foreground service for foreground timer."/>
|
||||
</service>
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
|
@ -9,6 +9,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE
|
||||
import android.media.AudioAttributes
|
||||
import android.media.MediaPlayer
|
||||
import android.net.Uri
|
||||
|
@ -76,7 +77,14 @@ class TimerService : Service() {
|
|||
secondsLeft = (intent?.getIntExtra("milliseconds", 0) ?: 0) / 1000
|
||||
currentDescription = intent?.getStringExtra("description").toString()
|
||||
secondsTotal = secondsLeft
|
||||
startForeground(ONGOING_ID, getProgress(secondsLeft).build())
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
startForeground(ONGOING_ID, getProgress(secondsLeft).build(), FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
|
||||
} else
|
||||
{
|
||||
startForeground(ONGOING_ID, getProgress(secondsLeft).build())
|
||||
}
|
||||
|
||||
battery()
|
||||
Log.d("TimerService", "onStartCommand seconds=$secondsLeft")
|
||||
|
||||
|
|
36
deploy.mjs
36
deploy.mjs
|
@ -1,42 +1,37 @@
|
|||
import { execSync } from 'child_process';
|
||||
import { readFileSync, writeFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import simpleGit from 'simple-git';
|
||||
import os from 'os';
|
||||
|
||||
execSync('npx tsc', { stdio: 'inherit' });
|
||||
console.log('✅ Passes TypeScript checks ✅')
|
||||
process.chdir('android');
|
||||
|
||||
const buildFilePath = join(process.cwd(), 'app', 'build.gradle');
|
||||
let buildFile = readFileSync(buildFilePath, 'utf8');
|
||||
let build = readFileSync('android/app/build.gradle', 'utf8');
|
||||
|
||||
const versionCodeMatch = buildFile.match(/versionCode (\d+)/);
|
||||
if (!versionCodeMatch) throw new Error('versionCode not found in build.gradle');
|
||||
const versionCode = parseInt(versionCodeMatch[1], 10) + 1;
|
||||
buildFile = buildFile.replace(/versionCode \d+/, `versionCode ${versionCode}`);
|
||||
const codeMatch = build.match(/versionCode (\d+)/);
|
||||
if (!codeMatch) throw new Error('versionCode not found in build.gradle');
|
||||
const versionCode = parseInt(codeMatch[1], 10) + 1;
|
||||
build = build.replace(/versionCode \d+/, `versionCode ${versionCode}`);
|
||||
|
||||
const versionNameMatch = buildFile.match(/versionName "(\d+\.\d+)"/);
|
||||
if (!versionNameMatch) throw new Error('versionName not found in build.gradle');
|
||||
const versionParts = versionNameMatch[1].split('.');
|
||||
const nameMatch = build.match(/versionName "(\d+\.\d+)"/);
|
||||
if (!nameMatch) throw new Error('versionName not found in build.gradle');
|
||||
const versionParts = nameMatch[1].split('.');
|
||||
versionParts[1] = (parseInt(versionParts[1], 10) + 1).toString();
|
||||
const versionName = versionParts.join('.');
|
||||
buildFile = buildFile.replace(/versionName "\d+\.\d+"/, `versionName "${versionName}"`);
|
||||
build = build.replace(/versionName "\d+\.\d+"/, `versionName "${versionName}"`);
|
||||
|
||||
writeFileSync(buildFilePath, buildFile);
|
||||
writeFileSync('android/app/build.gradle', build);
|
||||
|
||||
const packageJsonPath = join(process.cwd(), '..', 'package.json');
|
||||
let packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
||||
let packageJson = JSON.parse(readFileSync('package.json', 'utf8'));
|
||||
packageJson.version = versionName;
|
||||
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
||||
writeFileSync('package.json', JSON.stringify(packageJson, null, 2));
|
||||
|
||||
const git = simpleGit();
|
||||
await git.add([packageJsonPath, buildFilePath]);
|
||||
await git.add(['package.json', 'android/app/build.gradle']);
|
||||
await git.log(['-1']).then(log => {
|
||||
const newTitle = `${log.latest.message} - ${versionName} 🚀`;
|
||||
console.log(newTitle);
|
||||
const newCommitMessage = [newTitle, log.latest.body].join('\n');
|
||||
return git.commit(newCommitMessage, [], ['--amend']);
|
||||
const message = [newTitle, log.latest.body].join('\n');
|
||||
return git.commit(message, [], ['--amend']);
|
||||
}).then(() => {
|
||||
return git.addTag(versionCode.toString());
|
||||
}).then(() => {
|
||||
|
@ -45,6 +40,7 @@ await git.log(['-1']).then(log => {
|
|||
console.error('Error amending commit:', err);
|
||||
});
|
||||
|
||||
process.chdir('android')
|
||||
const isWindows = os.platform() === 'win32';
|
||||
execSync(isWindows ? '.\\gradlew.bat bundleRelease -q' : './gradlew bundleRelease -q', { stdio: 'inherit' });
|
||||
execSync('bundle install --quiet', { stdio: 'inherit' });
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "massive",
|
||||
"version": "2.28",
|
||||
"version": "2.29",
|
||||
"private": true,
|
||||
"license": "GPL-3.0-only",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue