copy release notes
This commit is contained in:
parent
dc85e4e156
commit
5f026bc45b
|
@ -0,0 +1,103 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Copyright 2017 Thomas Schneider
|
||||
|
||||
This file is a part of Fedilab
|
||||
|
||||
This program 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.
|
||||
|
||||
Fedilab 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 Fedilab; if not,
|
||||
see <http://www.gnu.org/licenses>
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="app.fedilab.android"
|
||||
android:installLocation="auto">
|
||||
|
||||
|
||||
<application
|
||||
android:name="app.fedilab.android.activities.MainApplication"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:allowBackup="false"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher_bubbles"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppThemeDark"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:allowBackup">
|
||||
|
||||
|
||||
<activity-alias
|
||||
android:name=".activities.MainActivity.Bubbles"
|
||||
android:enabled="true"
|
||||
android:icon="@mipmap/ic_launcher_bubbles"
|
||||
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<meta-data
|
||||
android:name="icon"
|
||||
android:value="bubbles" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PhotoEditorActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerStatusActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerNotificationChartsActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerChartsActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerNotificationActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
|
||||
<activity
|
||||
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
|
||||
android:theme="@style/Base.Theme.AppCompat" />
|
||||
|
||||
|
||||
<receiver
|
||||
android:name=".services.UnifiedPushService"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="org.unifiedpush.android.connector.MESSAGE" />
|
||||
<action android:name="org.unifiedpush.android.connector.UNREGISTERED" />
|
||||
<action android:name="org.unifiedpush.android.connector.NEW_ENDPOINT" />
|
||||
<action android:name="org.unifiedpush.android.connector.REGISTRATION_FAILED" />
|
||||
<action android:name="org.unifiedpush.android.connector.REGISTRATION_REFUSED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
</manifest>
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Copyright 2021 Thomas Schneider
|
||||
|
||||
This file is a part of Fedilab
|
||||
|
||||
This program 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.
|
||||
|
||||
Fedilab 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 Fedilab; if not,
|
||||
see <http://www.gnu.org/licenses>
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="app.fedilab.android"
|
||||
android:installLocation="auto">
|
||||
|
||||
|
||||
<application>
|
||||
<receiver
|
||||
android:name=".services.UnifiedPushService"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="org.unifiedpush.android.connector.MESSAGE" />
|
||||
<action android:name="org.unifiedpush.android.connector.UNREGISTERED" />
|
||||
<action android:name="org.unifiedpush.android.connector.NEW_ENDPOINT" />
|
||||
<action android:name="org.unifiedpush.android.connector.REGISTRATION_FAILED" />
|
||||
<action android:name="org.unifiedpush.android.connector.REGISTRATION_REFUSED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
</manifest>
|
|
@ -13,16 +13,13 @@ package app.fedilab.android.services;
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.util.Log;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.unifiedpush.android.connector.MessagingReceiver;
|
||||
import org.unifiedpush.android.connector.MessagingReceiverHandler;
|
||||
|
||||
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
|
@ -37,55 +34,7 @@ import app.fedilab.android.sqlite.Sqlite;
|
|||
|
||||
import static android.content.Context.MODE_PRIVATE;
|
||||
|
||||
class handler implements MessagingReceiverHandler {
|
||||
class handler {
|
||||
|
||||
|
||||
@Override
|
||||
public void onMessage(@Nullable Context context, @NotNull String s, @NotNull String slug) {
|
||||
new Thread(() -> {
|
||||
SQLiteDatabase db = Sqlite.getInstance(context.getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
String[] slugArray = slug.split("@");
|
||||
Account account = new AccountDAO(context, db).getUniqAccountUsernameInstance(slugArray[0], slugArray[1]);
|
||||
APIResponse apiResponse;
|
||||
if (account.getSocial().compareTo("FRIENDICA") != 0 && account.getSocial().compareTo("GNU") != 0) {
|
||||
API api = new API(context, account.getInstance(), account.getToken());
|
||||
apiResponse = api.getNotificationsSince(DisplayNotificationsFragment.Type.ALL, null, false);
|
||||
} else {
|
||||
GNUAPI gnuApi = new GNUAPI(context, account.getInstance(), account.getToken());
|
||||
apiResponse = gnuApi.getNotificationsSince(DisplayNotificationsFragment.Type.ALL, null);
|
||||
}
|
||||
NotificationsHelper.onRetrieveNotifications(context, apiResponse, account);
|
||||
}).start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewEndpoint(@Nullable Context context, @NotNull String endpoint, @NotNull String slug) {
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.SERVER_ENDPOINT, endpoint);
|
||||
editor.apply();
|
||||
new PushNotifications()
|
||||
.registerPushNotifications(context, endpoint, slug);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistrationFailed(@Nullable Context context, @NotNull String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistrationRefused(@Nullable Context context, @NotNull String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnregistered(@Nullable Context context, @NotNull String s) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class UnifiedPushService extends MessagingReceiver {
|
||||
public UnifiedPushService() {
|
||||
super(new handler());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue