Add huawei build flavor

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2021-12-10 11:24:34 +01:00
parent 157f62a775
commit 40796f7612
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
12 changed files with 233 additions and 4 deletions

View file

@ -10,7 +10,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
flavor: [ Generic, Gplay ] flavor: [ Generic, Gplay, Huawei ]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: set up JDK 11 - name: set up JDK 11

View file

@ -165,6 +165,11 @@ android {
dimension "default" dimension "default"
} }
huawei {
applicationId 'com.nextcloud.client'
dimension "default"
}
versionDev { versionDev {
applicationId "com.nextcloud.android.beta" applicationId "com.nextcloud.android.beta"
dimension "default" dimension "default"

View file

@ -94,6 +94,9 @@ lane :makeReleases do
SignedRelease(flavor:"Gplay") SignedRelease(flavor:"Gplay")
sh("cp ../build/outputs/apk/gplay/release/*.apk ../release/") sh("cp ../build/outputs/apk/gplay/release/*.apk ../release/")
SignedRelease(flavor:"Huawei")
sh("cp ../build/outputs/apk/huawei/release/*.apk ../release/")
end end
desc "Create GPlay release" desc "Create GPlay release"
@ -108,6 +111,12 @@ lane :createGenericRelease do |options|
sh("mv ../build/outputs/apk/generic/release/*.apk ../release/") sh("mv ../build/outputs/apk/generic/release/*.apk ../release/")
end end
desc "Create Huawei release"
lane :createHuaweiRelease do |options|
SignedRelease(flavor:"Huawei")
sh("mv ../build/outputs/apk/huawei/release/*.apk ../release/")
end
desc "Create Dev release" desc "Create Dev release"
lane :createDevRelease do |options| lane :createDevRelease do |options|
SignedRelease(flavor:"VersionDev") SignedRelease(flavor:"VersionDev")
@ -131,7 +140,7 @@ private_lane :uploadToHuawei_Final do |options|
client_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_ID"], client_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_ID"],
client_secret: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_SECRET"], client_secret: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_SECRET"],
app_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_APP_ID"], app_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_APP_ID"],
apk_path: "release/nextcloud-" + options["versionCode"] + ".apk", apk_path: "release/huawei-release-" + options["versionCode"] + ".apk",
submit_for_review: true, submit_for_review: true,
) )
end end

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?><!--
Nextcloud Android client application
@author Tobias Kaminsky
Copyright (C) 2021 Tobias Kaminsky
Copyright (C) 2021 Nextcloud GmbH
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. 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.owncloud.android">
<application
android:name=".MainApp"
android:fullBackupContent="@xml/backup_config"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:manageSpaceActivity="com.owncloud.android.ui.activity.ManageSpaceActivity"
android:theme="@style/Theme.ownCloud.Toolbar">
<activity
android:name=".ui.activity.HuaweiCommunityActivity"
android:exported="false" />
<activity-alias
android:name=".ui.activity.CommunityActivity"
android:targetActivity=".ui.activity.HuaweiCommunityActivity"
tools:replace="android:targetActivity" />
<activity
tools:node="remove"
android:name=".ui.activity.CommunityActivity" />
</application>
</manifest>

View file

@ -0,0 +1,31 @@
/*
* Nextcloud Android client application
*
* @author Chris Narkiewicz
* Copyright (C) 2919 Chris Narkiewicz <hello@ezaquarii.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This program 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 AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.di;
import com.owncloud.android.ui.activity.HuaweiCommunityActivity;
import dagger.Module;
import dagger.android.ContributesAndroidInjector;
@Module
abstract class VariantComponentsModule {
@ContributesAndroidInjector
abstract HuaweiCommunityActivity participateActivity();
}

View file

@ -0,0 +1,32 @@
/*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2021 Nextcloud
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This program 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 AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.owncloud.android.ui.activity
import android.view.View
/**
* Activity providing information about ways to participate in the app's development.
*/
class HuaweiCommunityActivity : CommunityActivity() {
override fun setupContent() {
super.setupContent()
binding.communityReleaseCandidatePlaystore.visibility = View.GONE
}
}

View file

@ -0,0 +1,58 @@
/**
* Nextcloud Android client application
*
* @author Mario Danic
* @author Chris Narkiewicz Copyright (C) 2017 Mario Danic Copyright (C) 2019 Chris Narkiewicz
* <p>
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or at your option) any
* later version.
* <p>
* This program 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 Affero General Public License for more
* details.
* <p>
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*/
package com.owncloud.android.utils;
import android.content.Context;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.preferences.AppPreferencesImpl;
import com.owncloud.android.MainApp;
import com.owncloud.android.datamodel.SignatureVerification;
import java.security.Key;
public final class PushUtils {
public static final String KEY_PUSH = "push";
private PushUtils() {
}
public static void pushRegistrationToServer(final UserAccountManager accountManager, final String pushToken) {
// do nothing
}
public static void reinitKeys(UserAccountManager accountManager) {
Context context = MainApp.getAppContext();
AppPreferencesImpl.fromContext(context).setKeysReInitEnabled();
}
public static Key readKeyFromFile(boolean readPublicKey) {
return null;
}
public static SignatureVerification verifySignature(
final Context context,
final UserAccountManager accountManager,
final byte[] signatureBytes,
final byte[] subjectBytes
) {
return null;
}
}

View file

@ -0,0 +1,20 @@
/**
* Nextcloud Android client application
*
* @author Mario Danic Copyright (C) 2018 Mario Danic
* <p>
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or at your option) any
* later version.
* <p>
* This program 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 Affero General Public License for more
* details.
* <p>
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*/
package com.owncloud.android.utils;
public class SecurityUtils {
}

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?><!--
Nextcloud Android client application
@author Tobias Kaminsky
Copyright (C) 2021 Tobias Kaminsky
Copyright (C) 2021 Nextcloud GmbH
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<resources>
<bool name="show_push_warning">false</bool>
</resources>

View file

@ -39,7 +39,7 @@ import com.owncloud.android.utils.theme.ThemeColorUtils;
*/ */
public class CommunityActivity extends DrawerActivity { public class CommunityActivity extends DrawerActivity {
private CommunityLayoutBinding binding; protected CommunityLayoutBinding binding;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -59,7 +59,7 @@ public class CommunityActivity extends DrawerActivity {
setupContent(); setupContent();
} }
private void setupContent() { protected void setupContent() {
binding.communityReleaseCandidateText.setMovementMethod(LinkMovementMethod.getInstance()); binding.communityReleaseCandidateText.setMovementMethod(LinkMovementMethod.getInstance());
TextView contributeIrcView = binding.communityContributeIrcText; TextView contributeIrcView = binding.communityContributeIrcText;

View file

@ -132,6 +132,9 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
} }
private void setupPushWarning() { private void setupPushWarning() {
if (!getResources().getBoolean(R.bool.show_push_warning)) {
return;
}
if (snackbar != null) { if (snackbar != null) {
if (!snackbar.isShown()) { if (!snackbar.isShown()) {
snackbar.show(); snackbar.show();

View file

@ -19,4 +19,5 @@
<!-- Default boolean values --> <!-- Default boolean values -->
<resources> <resources>
<bool name="large_land_layout">false</bool> <bool name="large_land_layout">false</bool>
<bool name="show_push_warning">true</bool>
</resources> </resources>