Skip to content

Commit b239a50

Browse files
authored
Upgrade targetSdkVersion to Oreo (27) (#392)
* targetSdkVersion 27 * fix unescaped apostrophes in strings * update Oreo notifications
1 parent 6a2de36 commit b239a50

File tree

7 files changed

+47
-24
lines changed

7 files changed

+47
-24
lines changed

app/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion '27.0.3'
4+
compileSdkVersion 27
5+
buildToolsVersion '28.0.2'
66
defaultConfig {
77
applicationId "com.m2049r.xmrwallet"
88
minSdkVersion 21
9-
targetSdkVersion 25
9+
targetSdkVersion 27
1010
versionCode 113
1111
versionName "1.6.3 'Nano S'"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -70,11 +70,11 @@ android {
7070
}
7171

7272
dependencies {
73-
implementation 'com.android.support:appcompat-v7:25.4.0'
74-
implementation 'com.android.support:design:25.4.0'
75-
implementation 'com.android.support:support-v4:25.4.0'
76-
implementation 'com.android.support:recyclerview-v7:25.4.0'
77-
implementation 'com.android.support:cardview-v7:25.4.0'
73+
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportVersion"
74+
implementation "com.android.support:design:$rootProject.ext.supportVersion"
75+
implementation "com.android.support:support-v4:$rootProject.ext.supportVersion"
76+
implementation "com.android.support:recyclerview-v7:$rootProject.ext.supportVersion"
77+
implementation "com.android.support:cardview-v7:$rootProject.ext.supportVersion"
7878
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
7979

8080
implementation "com.squareup.okhttp3:okhttp:$rootProject.ext.okHttpVersion"

app/src/main/java/com/m2049r/xmrwallet/service/WalletService.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,22 @@
1717
package com.m2049r.xmrwallet.service;
1818

1919
import android.app.Notification;
20+
import android.app.NotificationChannel;
21+
import android.app.NotificationManager;
2022
import android.app.PendingIntent;
2123
import android.app.Service;
2224
import android.content.Context;
2325
import android.content.Intent;
2426
import android.os.Binder;
27+
import android.os.Build;
2528
import android.os.Bundle;
2629
import android.os.Handler;
2730
import android.os.IBinder;
2831
import android.os.Looper;
2932
import android.os.Message;
3033
import android.os.Process;
34+
import android.support.annotation.RequiresApi;
35+
import android.support.v4.app.NotificationCompat;
3136

3237
import com.m2049r.xmrwallet.R;
3338
import com.m2049r.xmrwallet.WalletActivity;
@@ -45,6 +50,7 @@ public class WalletService extends Service {
4550
public static boolean Running = false;
4651

4752
final static int NOTIFICATION_ID = 2049;
53+
final static String CHANNEL_ID = "m_service";
4854

4955
public static final String REQUEST_WALLET = "wallet";
5056
public static final String REQUEST = "request";
@@ -566,11 +572,26 @@ private Wallet openWallet(String walletName, String walletPassword) {
566572
private void startNotfication() {
567573
Intent notificationIntent = new Intent(this, WalletActivity.class);
568574
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
569-
Notification notification = new Notification.Builder(this)
575+
576+
String channelId = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? createNotificationChannel() : "";
577+
Notification notification = new NotificationCompat.Builder(this, channelId)
570578
.setContentTitle(getString(R.string.service_description))
579+
.setOngoing(true)
571580
.setSmallIcon(R.drawable.ic_monerujo)
581+
.setPriority(NotificationCompat.PRIORITY_MIN)
582+
.setCategory(NotificationCompat.CATEGORY_SERVICE)
572583
.setContentIntent(pendingIntent)
573584
.build();
574585
startForeground(NOTIFICATION_ID, notification);
575586
}
587+
588+
@RequiresApi(Build.VERSION_CODES.O)
589+
private String createNotificationChannel() {
590+
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
591+
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, getString(R.string.service_description),
592+
NotificationManager.IMPORTANCE_LOW);
593+
channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
594+
notificationManager.createNotificationChannel(channel);
595+
return CHANNEL_ID;
596+
}
576597
}

app/src/main/res/values-fr/help.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<p>Entrez votre phrase Mnémonique dans le champ \"Phrase Mnémonique\".<p>
3131
<p>Entrez le numéro du bloc de la première transaction utilisée pour cette adresse dans le
3232
champ \"Hauteur de restauration\". Vous pouvez également utiliser une date au format AAA-MM-JJ.
33-
Si vous n'êtes pas sûr, entrer une date / hauteur de block approximative <em>avant</em> que vous
33+
Si vous n\'êtes pas sûr, entrer une date / hauteur de block approximative <em>avant</em> que vous
3434
n’ayez utilisé cette adresse de portefeuille pour la première fois.</p>
3535
]]></string>
3636

@@ -43,7 +43,7 @@
4343
<p>Entrez votre adresse Monero dans le champ \"Adresse Publique\" et remplissez \"Clef d’Audit\" et \"Clef de dépense\".</p>
4444
<p>Entrez le numéro du bloc de la première transaction utilisée pour cette adresse dans le
4545
champ \"Hauteur de restauration\". Vous pouvez également utiliser une date au format AAA-MM-JJ.
46-
Si vous n'êtes pas sûr, entrer une date / hauteur de block approximative <em>avant</em> que vous
46+
Si vous n\'êtes pas sûr, entrer une date / hauteur de block approximative <em>avant</em> que vous
4747
n’ayez utilisé cette adresse de portefeuille pour la première fois.</p>
4848
]]></string>
4949

@@ -56,7 +56,7 @@
5656
<p>Entrez votre adresse Monero dans le champ \"Adresse Publique\" et remplissez la \"Clef d’Audit\".</p>
5757
<p>Entrez le numéro du bloc de la première transaction utilisée pour cette adresse dans le
5858
champ \"Hauteur de restauration\". Vous pouvez également utiliser une date au format AAA-MM-JJ.
59-
Si vous n'êtes pas sûr, entrer une date / hauteur de block approximative <em>avant</em> que vous
59+
Si vous n\'êtes pas sûr, entrer une date / hauteur de block approximative <em>avant</em> que vous
6060
n’ayez utilisé cette adresse de portefeuille pour la première fois.</p>
6161
]]></string>
6262

@@ -257,7 +257,7 @@
257257
fort, ou mieux, utilisez une phrase de sécurité.</p>
258258
<p>Entrez le numéro du bloc de la première transaction utilisée pour cette adresse dans le
259259
champ \"Hauteur de restauration\". Vous pouvez également utiliser une date au format AAA-MM-JJ.
260-
Si vous n'êtes pas sûr, entrer une date / hauteur de block approximative <em>avant</em> que vous
260+
Si vous n\'êtes pas sûr, entrer une date / hauteur de block approximative <em>avant</em> que vous
261261
n’ayez utilisé cette adresse de portefeuille pour la première fois.</p>
262262
]]></string>
263263
</resources>

app/src/main/res/values-it/about.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<p>Altri dati personali non sono raccolti dall\'app.</p>
2828
<p>Se usi la funzionalità (opzionale) del cambio, monerujo recupera il tasso di cambio attraverso le API pubbliche di coinmarketcap.com.
2929
Controlla la loro politica per la privacy (in lingua inglese) su https://coinmarketcap.com/privacy per conoscere i dettagli su come vengono raccolti i dati nelle tue richieste.</p>
30-
<p>Se utilizzi l'app per effettuare pagamenti ad indirizzi BTC, stai usando il servizio XMR.TO.
31-
Controlla la loro politica per la privacy (in lingua inglese) su https://xmr.to/ per conoscere i dettagli. Monerujo invia a loro l'indirizzo di destinazione BTC e l'ammontare della transazione. Anche il tuo IP potrebbe essere raccolto.</p>
30+
<p>Se utilizzi l\'app per effettuare pagamenti ad indirizzi BTC, stai usando il servizio XMR.TO.
31+
Controlla la loro politica per la privacy (in lingua inglese) su https://xmr.to/ per conoscere i dettagli. Monerujo invia a loro l\'indirizzo di destinazione BTC e l\'ammontare della transazione. Anche il tuo IP potrebbe essere raccolto.</p>
3232
<h2>Permessi app</h2>
3333
<ul>
3434
<li>INTERNET : Connessione alla rete Monero attraverso un nodo </li>

app/src/main/res/values-it/help.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,24 @@
5858
E&apos; molto importante mantenerlo privato e conservarlo in un luogo sicuro, poiché può concedere a <em>chiunque</em>
5959
pieno accesso ai tuoi Moneroj! Se non lo hai già fatto, annotati il Seed Mnemonico e conservalo in un luogo sicuro!
6060
<h2>Password di ripristino dei file del portafoglio</h2>
61-
Assicurati di aver salvato questa password. Se resetti il tuo dispositivo o disinstalli l'app
61+
Assicurati di aver salvato questa password. Se resetti il tuo dispositivo o disinstalli l\'app
6262
ne avrai bisogno per accedere di nuovo al tuo portafoglio.<br/>
6363
<h3>CrAzYpass</h3>
6464
Se la password visualizzata qui contiene 52 caratteri alfanumerici in gruppi di 4 - Congratulazioni!
6565
I file del tuo portafoglio sono criptati con una chiave a 256-bit generata dal tuo dispositivo
66-
e basata sulla passphrase che hai scelto (alla creazione o quando l'hai modificata). Questo la rende estremamente
66+
e basata sulla passphrase che hai scelto (alla creazione o quando l\'hai modificata). Questo la rende estremamente
6767
difficile da hackerare!<br/>
6868
Questa funzionalità è obbligatoria per tutti i nuovi portafogli.
6969
<h3>Password precedente</h3>
7070
Se vedi la tua passphrase qui, i file del tuo portaglio non sono così sicuri come
7171
quelli criptati da CrAzYpass. Per adeguare la tua password semplicemente seleziona \"Cambia Passphrase\" dal menu.
72-
Dopo aver inserito una nuova passphrase (eventualmente la stessa usata in precedenza) l'applicazione genererà
72+
Dopo aver inserito una nuova passphrase (eventualmente la stessa usata in precedenza) l\'applicazione genererà
7373
una CrAzYpass per te e la userà per mettere al sicuro i file del tuo wallet. Annotala!
7474
<h3>Portafogli CrAzYpass</h3>
7575
Se dovessi avere bisogno di reinstallare Monerujo (per esempio dopo aver resettato il tuo telefono
7676
o dopo averlo sostituito) o vuoi usare i file del tuo portafoglio su un diverso dispositivo o PC, devi
7777
usare questa password di recupero per poter accedere nuovamente al tuo portafoglio.<br/>
78-
Selezionando \'Cambia Passphrase\' dal menu, potrai scegliere un'altra passphrase. Questa azione
78+
Selezionando \'Cambia Passphrase\' dal menu, potrai scegliere un\'altra passphrase. Questa azione
7979
creerà una nuova password di recupero. Ricordati di annotarla!
8080
<h2>Chiave di Visualizzazione</h2>
8181
La tua chiave di visualizzazione può essere usata per monitorare le transazioni in ingresso al tuo portafoglio senza concedere il permesso di spendere i fondi.

app/src/main/res/values/about.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@
392392
included with this distribution is covered by the same copyright terms
393393
except that the holder is Tim Hudson ([email protected]).<br/>
394394
<br/>
395-
Copyright remains Eric Young's, and as such any Copyright notices in
395+
Copyright remains Eric Young\'s, and as such any Copyright notices in
396396
the code are not to be removed.
397397
If this package is used in a product, Eric Young should be given attribution
398398
as the author of the parts of the library used.
@@ -411,13 +411,13 @@
411411
must display the following acknowledgement:<br/>
412412
\"This product includes cryptographic software written by
413413
Eric Young ([email protected])\"
414-
The word 'cryptographic' can be left out if the rouines from the library
414+
The word \'cryptographic\' can be left out if the rouines from the library
415415
being used are not cryptographic related :-).<br/>
416416
4. If you include any Windows specific code (or a derivative thereof) from
417417
the apps directory (application code) you must include an acknowledgement:
418418
\"This product includes software written by Tim Hudson ([email protected])\"<br/>
419419
<br/>
420-
THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
420+
THIS SOFTWARE IS PROVIDED BY ERIC YOUNG "AS IS" AND
421421
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
422422
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
423423
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
@@ -545,7 +545,7 @@
545545
terms of any subsequent revision of the license.<br/>
546546
<br/>
547547
THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS
548-
CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
548+
CONTRIBUTORS "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
549549
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
550550
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
551551
SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S)
@@ -595,7 +595,7 @@
595595
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
596596
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
597597
598-
<h2>'Poppins' Font</h2>
598+
<h2>\'Poppins\' Font</h2>
599599
<h3>SIL Open Font License</h3>
600600
<p>Copyright (c) 2014, Indian Type Foundry ([email protected]).</p>
601601
<p>This Font Software is licensed under the SIL Open Font License, Version 1.1.<br />

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ allprojects {
1616
maven {
1717
url "https://maven.google.com"
1818
}
19+
google()
1920
}
2021
}
2122

@@ -29,4 +30,5 @@ ext {
2930
junitVersion = '4.12'
3031
mockitoVersion = '1.10.19'
3132
timberVersion = '4.7.0'
33+
supportVersion = '27.1.1'
3234
}

0 commit comments

Comments
 (0)