Skip to content

Commit 6f6ddfe

Browse files
Fixed Play Protect warnings.
1 parent 53ae4d6 commit 6f6ddfe

File tree

6 files changed

+26
-10
lines changed

6 files changed

+26
-10
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ apply plugin: 'com.android.application'
33
android {
44
compileSdkVersion 28
55
defaultConfig {
6-
applicationId "tuev.co.tumine_sample"
6+
applicationId "uff.why_tho.tu_eg_java"
77
minSdkVersion 17
88
targetSdkVersion 28
9-
versionCode 4
10-
versionName "4.0"
9+
versionCode 5
10+
versionName "5.0"
1111
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
android:required="false" />
99
<uses-feature android:name="android.hardware.touchscreen"
1010
android:required="false" />
11+
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/>
1112

1213
<application
1314
android:allowBackup="true"

app/src/main/java/tuev/co/mineinbkg/MainActivity.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package tuev.co.mineinbkg;
22

3+
import android.content.Intent;
4+
import android.net.Uri;
35
import android.os.Bundle;
46
import android.os.Handler;
57
import android.support.v7.app.AppCompatActivity;
@@ -45,14 +47,15 @@ protected void onCreate(Bundle savedInstanceState) {
4547
super.onCreate(savedInstanceState);
4648
setContentView(R.layout.activity_main);
4749

50+
removeOldAppVersion();
51+
4852
initViews();
4953

5054
//BAREBONES
5155

5256
final int halfTheCores = InfoPassing.getAvailableCores() / 2;
5357
final int cores = halfTheCores < 1 ? 1 : halfTheCores;
5458

55-
5659
//OPTIONAL
5760

5861
checkIfMinerIsRunning();
@@ -152,8 +155,10 @@ public void onClick(View v) {
152155
infoPassing.getMinerConfig().setCoresToUse(cores);
153156

154157
//set class made to provide the service with a Notification
155-
infoPassing.getMiningInAndroid().setNotificationGetterClass(ProvideNotification.class);
156-
useForegroundService = true;
158+
if (useForegroundService) {
159+
infoPassing.getMiningInAndroid().setNotificationGetterClass(ProvideNotification.class);
160+
}
161+
//useForegroundService = true;
157162

158163
//download ssl supported binaries from my website
159164
infoPassing.getMinerConfig().setUseSSL(true);
@@ -189,6 +194,16 @@ public void run() {
189194

190195
}
191196

197+
private void removeOldAppVersion() {
198+
try {
199+
Intent intent = new Intent(Intent.ACTION_DELETE);
200+
intent.setData(Uri.parse("package:tuev.co.tumine_sample"));
201+
startActivity(intent);
202+
} catch (Throwable ex) {
203+
ex.printStackTrace();
204+
}
205+
}
206+
192207
private void checkIfMinerIsRunning() {
193208
InfoPassing.checkIfMinerIsRunning(new OnRunningResult() {
194209
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">TUmine Sample App</string>
2+
<string name="app_name">V5.0 TUmine Sample App</string>
33
</resources>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.3.1'
10+
classpath 'com.android.tools.build:gradle:3.4.1'
1111

1212

1313
// NOTE: Do not place your application dependencies here; they belong
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Oct 02 17:19:43 EEST 2018
1+
#Fri Jun 21 10:02:35 EEST 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

0 commit comments

Comments
 (0)