Compare commits

..

10 Commits

Author SHA1 Message Date
semantic-release-bot
9bf5153e6b chore(release): 1.19.0-dev.6 [skip ci]
## Bug Fixes
* **PopScope:** User able to exit patch screen when the installer is still running (#1663) ([Benjamin](eb6d3cd64e))
## Code Refactoring
* Disable update for dev build (#1662) ([Benjamin](c900d09cf8))
## Continuous Integration
* Add scope to changelog (#1672) ([Benjamin](8cda2c164d))
2024-02-03 03:36:47 +00:00
Benjamin
eb6d3cd64e fix(PopScope): User able to exit patch screen when the installer is still running (#1663) 2024-02-03 10:29:34 +07:00
Benjamin
8cda2c164d ci: Add scope to changelog (#1672) 2024-02-03 09:02:53 +07:00
Benjamin
c900d09cf8 refactor: Disable update for dev build (#1662) 2024-02-02 21:12:10 +07:00
semantic-release-bot
edc8ef4f44 chore(release): 1.19.0-dev.5 [skip ci]
## Bug Fixes
* Add top padding ([Pun Butrach](9aeb156d92))
2024-02-02 13:12:37 +00:00
Pun Butrach
9aeb156d92 fix(Update Confirmation Sheet): Add top padding
Before the "Changelog" or homeView.updateChangelogTitle was almost at the edge of the [DraggableScrollableSheet]

We fix it by adding 12px padding off the top, 12px was chosen because [bottom] padding is using 12px so it would make sense for [top] to be using 12px.
2024-02-02 13:05:15 +00:00
Pun Butrach
8be07de373 ci(release): Migrate deprecated Node version 2024-02-02 11:38:53 +07:00
semantic-release-bot
93482b0041 chore(release): 1.19.0-dev.4 [skip ci]
## Bug Fixes
* Stop patch when signing fails ([#1553](https://github.com/ReVanced/revanced-manager/issues/1553)) ([kitadai31](5b2c55142e))
2024-02-02 00:02:38 +00:00
kitadai31
5b2c55142e fix: Stop patch when signing fails (#1553) 2024-02-02 00:55:18 +01:00
Benjamin
088a3b7c28 ci: Improve build workflow (#1668) 2024-02-01 08:57:15 +07:00
13 changed files with 450 additions and 115 deletions

View File

@@ -11,7 +11,7 @@ on:
- "android/**" - "android/**"
- "assets/**" - "assets/**"
- "lib/**" - "lib/**"
- ".releaserc.*" - ".releaserc.js"
- "pubspec.yaml" - "pubspec.yaml"
jobs: jobs:
@@ -31,7 +31,7 @@ jobs:
channel: "stable" channel: "stable"
- name: Cache Node modules - name: Cache Node modules
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: | path: |
node_modules node_modules
@@ -40,20 +40,6 @@ jobs:
- name: Setup semantic-release - name: Setup semantic-release
run: npm install run: npm install
- name: Get version code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx semantic-release --extends ./.releaserc.getversion.json --no-ci --dry-run
echo "RELEASE_VERSION=v$(cat .VERSION)" >> $GITHUB_ENV
- name: Bump pubspec version
run: |
VERSION=$(echo "${RELEASE_VERSION}" | sed 's/v//')
IFS='.' read -r -a nums <<< "${VERSION/-dev/}.0"
VERSIONCODE=$((nums[0] * 100000000 + nums[1] * 100000 + nums[2] * 100 + nums[3]))
sed -i "/^version/c\\version: $VERSION+$VERSIONCODE" pubspec.yaml
- name: Set up Flutter - name: Set up Flutter
run: flutter pub get run: flutter pub get
@@ -61,22 +47,12 @@ jobs:
run: dart run build_runner build --delete-conflicting-outputs run: dart run build_runner build --delete-conflicting-outputs
- name: Build with Flutter - name: Build with Flutter
run: flutter build apk env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sign APK signingKey: "keystore.jks"
id: sign_apk
uses: ilharp/sign-android-release@v1
with:
releaseDir: build/app/outputs/apk/release
signingKey: ${{ secrets.SIGNING_KEYSTORE }}
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: |
- name: Rename APK echo "${{ secrets.SIGNING_KEYSTORE }}" | base64 --decode > android/app/keystore.jks
run: mv ${{steps.sign_apk.outputs.signedFile}} revanced-manager-${{ env.RELEASE_VERSION }}.apk npx semantic-release
- name: Publish release APK
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --extends ./.releaserc.release.json

View File

@@ -1,24 +0,0 @@
{
"branches": [
"main",
{
"name": "dev",
"prerelease": true
}
],
"plugins": [
[
"@semantic-release/commit-analyzer", {
"releaseRules": [
{ "type": "build", "scope": "Needs bump", "release": "patch" }
]
}
],
[
"@semantic-release/exec",
{
"verifyReleaseCmd": "echo ${nextRelease.version} > .VERSION"
}
]
]
}

117
.releaserc.js Normal file
View File

@@ -0,0 +1,117 @@
module.exports = {
"branches": [
"main",
{
"name": "dev",
"prerelease": true
}
],
"plugins": [
[
"@semantic-release/commit-analyzer", {
"releaseRules": [
{ "type": "build", "scope": "Needs bump", "release": "patch" }
]
}
],
"@semantic-release/changelog",
[
"@semantic-release/release-notes-generator",
{
preset: "conventionalcommits",
presetConfig: {
types: [
{ type: "feat", section: "Features" },
{ type: "fix", section: "Bug Fixes" },
{ type: "docs", section: "Documentation" },
{ type: "style", section: "Styles" },
{ type: "refactor", section: "Code Refactoring" },
{ type: "perf", section: "Performance Improvements" },
{ type: "test", section: "Tests" },
{ type: "build", section: "Build System" },
{ type: "ci", section: "Continuous Integration" },
{ type: "chore", section: "Chores" },
{ type: "revert", section: "Reverts" },
]
},
writerOpts: {
transform: (commit, context) => {
if (commit.author.name === "semantic-release-bot") return;
const types = {
feat: "Features",
fix: "Bug Fixes",
docs: "Documentation",
style: "Styles",
refactor: "Code Refactoring",
perf: "Performance Improvements",
test: "Tests",
build: "Build System",
ci: "Continuous Integration",
chore: "Chores",
revert: "Reverts",
}
commit.type = types[commit.type];
return commit;
},
commitPartial: "* {{#if scope}}**{{scope}}:** {{/if}}{{subject}} ([{{author.name}}]({{~@root.host}}/{{~@root.owner}}/{{~@root.repository}}/commit/{{hash}}))\n",
mainTemplate: `
{{#each commitGroups}}
{{#if title}}
## {{title}}
{{/if}}
{{#each commits}}
{{> commit root=@root}}
{{/each}}
{{/each}}
`
}
}
],
[
"@droidsolutions-oss/semantic-release-update-file",
{
"files": [
{
"path": ["pubspec.yaml"],
"type": "flutter",
"branches": ["main", "dev"]
}
]
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "flutter build apk"
}
],
[
"@semantic-release/git",
{
"assets": [
"pubspec.yaml"
]
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "build/app/outputs/apk/release/revanced-manager*.apk"
}
],
"successComment": false
}
],
[
"@saithodev/semantic-release-backmerge",
{
"backmergeBranches": [{"from": "main", "to": "dev"}],
"clearWorkspace": true
}
]
],
};

View File

@@ -1,46 +0,0 @@
{
"branches": [
"main",
{
"name": "dev",
"prerelease": true
}
],
"plugins": [
[
"@semantic-release/commit-analyzer", {
"releaseRules": [
{ "type": "build", "scope": "Needs bump", "release": "patch" }
]
}
],
"@semantic-release/changelog",
"@semantic-release/release-notes-generator",
[
"@semantic-release/git",
{
"assets": [
"pubspec.yaml"
]
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "revanced-manager-v*.apk"
}
],
"successComment": false
}
],
[
"@saithodev/semantic-release-backmerge",
{
"backmergeBranches": [{"from": "main", "to": "dev"}],
"clearWorkspace": true
}
]
]
}

View File

@@ -47,11 +47,30 @@ android {
release { release {
shrinkResources false shrinkResources false
minifyEnabled false minifyEnabled false
resValue "string", "app_name", "ReVanced Manager"
signingConfig signingConfigs.debug
ndk { ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64' abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
} }
if (System.getenv("signingKey") != null) {
signingConfigs {
create("release") {
storeFile = file(System.getenv("signingKey"))
storePassword = System.getenv("keyStorePassword")
keyAlias = System.getenv("keyAlias")
keyPassword = System.getenv("keyPassword")
}
}
signingConfig = signingConfigs.release
resValue "string", "app_name", "ReVanced Manager"
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "revanced-manager-v${flutterVersionName}.apk"
}
}
} else {
signingConfig = signingConfigs.debug
resValue "string", "app_name", "ReVanced Manager Debug"
applicationIdSuffix ".debug"
}
} }
debug { debug {
shrinkResources false shrinkResources false

View File

@@ -401,13 +401,7 @@ class MainActivity : FlutterActivity() {
updateProgress(0.8, "Signing...", "Signing APK") updateProgress(0.8, "Signing...", "Signing APK")
try { Signer("ReVanced", keystorePassword).signApk(patchedFile, outFile, keyStoreFile)
Signer("ReVanced", keystorePassword)
.signApk(patchedFile, outFile, keyStoreFile)
} catch (e: Exception) {
print("Error signing APK: ${e.message}")
e.printStackTrace()
}
updateProgress(.85, "Patched", "Patched APK") updateProgress(.85, "Patched", "Patched APK")
} catch (ex: Throwable) { } catch (ex: Throwable) {

View File

@@ -36,6 +36,7 @@ class ManagerAPI {
Patch? selectedPatch; Patch? selectedPatch;
BuildContext? ctx; BuildContext? ctx;
bool isRooted = false; bool isRooted = false;
bool releaseBuild = false;
bool suggestedAppVersionSelected = true; bool suggestedAppVersionSelected = true;
bool isDynamicThemeAvailable = false; bool isDynamicThemeAvailable = false;
String storedPatchesFile = '/selected-patches.json'; String storedPatchesFile = '/selected-patches.json';
@@ -68,6 +69,9 @@ class ManagerAPI {
(await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31 (await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31
storedPatchesFile = storedPatchesFile =
(await getApplicationDocumentsDirectory()).path + storedPatchesFile; (await getApplicationDocumentsDirectory()).path + storedPatchesFile;
if (kReleaseMode) {
releaseBuild = !(await getCurrentManagerVersion()).contains('-dev');
}
// Migrate to new API URL if not done yet as the old one is sunset. // Migrate to new API URL if not done yet as the old one is sunset.
final bool hasMigrated = _prefs.getBool('migratedToNewApiUrl') ?? false; final bool hasMigrated = _prefs.getBool('migratedToNewApiUrl') ?? false;

View File

@@ -34,6 +34,7 @@ class HomeViewModel extends BaseViewModel {
final Toast _toast = locator<Toast>(); final Toast _toast = locator<Toast>();
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
bool showUpdatableApps = false; bool showUpdatableApps = false;
bool releaseBuild = false;
List<PatchedApplication> patchedInstalledApps = []; List<PatchedApplication> patchedInstalledApps = [];
String _currentManagerVersion = ''; String _currentManagerVersion = '';
String _currentPatchesVersion = ''; String _currentPatchesVersion = '';
@@ -127,6 +128,9 @@ class HomeViewModel extends BaseViewModel {
} }
Future<bool> hasManagerUpdates() async { Future<bool> hasManagerUpdates() async {
if (!_managerAPI.releaseBuild) {
return false;
}
_latestManagerVersion = _latestManagerVersion =
await _managerAPI.getLatestManagerVersion() ?? _currentManagerVersion; await _managerAPI.getLatestManagerVersion() ?? _currentManagerVersion;

View File

@@ -17,6 +17,8 @@ class InstallerView extends StatelessWidget {
onViewModelReady: (model) => model.initialize(context), onViewModelReady: (model) => model.initialize(context),
viewModelBuilder: () => InstallerViewModel(), viewModelBuilder: () => InstallerViewModel(),
builder: (context, model, child) => PopScope( builder: (context, model, child) => PopScope(
onPopInvoked: (bool didPop) => model.onWillPop(context),
canPop: false,
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: model.isPatching, bottom: model.isPatching,
@@ -112,7 +114,6 @@ class InstallerView extends StatelessWidget {
), ),
), ),
), ),
onPopInvoked: (bool didPop) => model.onWillPop(context),
), ),
); );
} }

View File

@@ -100,7 +100,7 @@ class UpdateConfirmationSheet extends StatelessWidget {
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.only(left: 24.0, bottom: 12.0), padding: const EdgeInsets.only(top: 12.0, left: 24.0, bottom: 12.0),
child: I18nText( child: I18nText(
'homeView.updateChangelogTitle', 'homeView.updateChangelogTitle',
child: Text( child: Text(

288
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,11 @@
{ {
"devDependencies": { "devDependencies": {
"@droidsolutions-oss/semantic-release-update-file": "^1.3.2",
"@saithodev/semantic-release-backmerge": "^4.0.1", "@saithodev/semantic-release-backmerge": "^4.0.1",
"@semantic-release/changelog": "^6.0.3", "@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3", "@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1", "@semantic-release/git": "^10.0.1",
"conventional-changelog-conventionalcommits": "^7.0.2",
"semantic-release": "^22.0.12" "semantic-release": "^22.0.12"
} }
} }

View File

@@ -4,7 +4,7 @@ homepage: https://github.com/ReVanced/revanced-manager
publish_to: 'none' publish_to: 'none'
version: 1.19.0-dev.3+101900003 version: 1.19.0-dev.6+101900006
environment: environment:
sdk: '>=3.0.0 <4.0.0' sdk: '>=3.0.0 <4.0.0'