forked from Mine2Gether/m2g_android_miner
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
3,510 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
gradle/ | ||
/local.properties | ||
.idea/ | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build | ||
/release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
buildToolsVersion "28.0.3" | ||
|
||
compileOptions { | ||
sourceCompatibility '1.8' | ||
targetCompatibility '1.8' | ||
} | ||
|
||
|
||
defaultConfig { | ||
applicationId "m2g.mine2gether.androidminer" | ||
minSdkVersion 19 | ||
targetSdkVersion 26 | ||
versionCode 1 | ||
versionName "1.1" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
|
||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
} | ||
|
||
dependencies { | ||
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha5' | ||
implementation 'com.android.support:design:28.0.0' | ||
implementation 'com.android.support:appcompat-v7:28.0.0' | ||
implementation 'com.android.support:support-v4:28.0.0' | ||
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0' | ||
implementation 'org.ocpsoft.prettytime:prettytime:4.0.2.Final' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="m2g.mine2gether.androidminer" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name="m2g.mine2gether.androidminer.MainActivity" android:windowSoftInputMode="adjustPan|stateHidden" android:theme="@style/AppTheme.NoActionBar"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
|
||
<service | ||
android:name="m2g.mine2gether.androidminer.MiningService" | ||
android:enabled="true"/> | ||
</application> | ||
|
||
</manifest> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"algo": "$algo$", | ||
"av": $av$, | ||
"background": false, | ||
"colors": false, | ||
"cpu-affinity": null, | ||
"cpu-priority": 3, | ||
"donate-level": 1, | ||
"low-power-mode": 2, | ||
"log-file": null, | ||
"max-cpu-usage": $maxcpu$, | ||
"print-time": 30, | ||
"retries": 5000, | ||
"retry-pause": 5, | ||
"safe": false, | ||
"syslog": false, | ||
"threads": $threads$, | ||
"pools": [ | ||
{ | ||
"url": "$url$", | ||
"user": "$username$", | ||
"pass": "$pass$", | ||
"keepalive": true, | ||
"nicehash": false | ||
} | ||
] | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions
61
app/src/main/java/m2g/mine2gether/androidminer/AboutFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) 2019, Mine2Gether.com | ||
// | ||
// Please see the included LICENSE file for more information. | ||
package m2g.mine2gether.androidminer; | ||
|
||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v4.app.Fragment; | ||
import android.text.Html; | ||
import android.text.method.LinkMovementMethod; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import java.util.Map; | ||
|
||
public class AboutFragment extends Fragment { | ||
|
||
@Nullable | ||
@Override | ||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | ||
|
||
View view = inflater.inflate(R.layout.fragment_about, container, false ); | ||
|
||
TextView tvWebsite; | ||
TextView tvGithub; | ||
TextView tvDiscord; | ||
TextView tvSystemInfo; | ||
|
||
tvWebsite = view.findViewById(R.id.websiteURL); | ||
tvGithub = view.findViewById(R.id.githubURL); | ||
tvDiscord = view.findViewById(R.id.discordURL); | ||
tvSystemInfo = view.findViewById(R.id.systemInfo); | ||
|
||
tvWebsite.setText(Html.fromHtml(getString(R.string.websiteLink))); | ||
tvWebsite.setMovementMethod(LinkMovementMethod.getInstance()); | ||
|
||
tvGithub.setText(Html.fromHtml(getString(R.string.githubLink))); | ||
tvGithub.setMovementMethod(LinkMovementMethod.getInstance()); | ||
|
||
tvDiscord.setText(Html.fromHtml(getString(R.string.discordLink))); | ||
tvDiscord.setMovementMethod(LinkMovementMethod.getInstance()); | ||
|
||
try { | ||
Map<String, String> m = Tools.getCPUInfo(); | ||
|
||
String i = ""; | ||
for (Map.Entry<String, String> pair : m.entrySet()) { | ||
i += pair.getKey() + ": " + pair.getValue() + "\n"; | ||
} | ||
|
||
tvSystemInfo.setText(i); | ||
} catch (Exception e){ | ||
|
||
} | ||
return view; | ||
|
||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
app/src/main/java/m2g/mine2gether/androidminer/AlgoItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2019, Mine2Gether.com | ||
// | ||
// Please see the included LICENSE file for more information. | ||
|
||
package m2g.mine2gether.androidminer; | ||
|
||
public class AlgoItem { | ||
|
||
private int mId = 0; | ||
private String mAlgo = ""; | ||
private String mAssetExtenstion = ""; | ||
|
||
public AlgoItem(String algo, String assetExtension) { | ||
this.mAlgo = algo; | ||
this.mAssetExtenstion = assetExtension; | ||
this.mId = 0; | ||
} | ||
|
||
public void setId(int id){ | ||
this.mId = id; | ||
} | ||
|
||
public int getId(){ | ||
return this.mId; | ||
} | ||
|
||
public String getAlgo() { | ||
return this.mAlgo; | ||
} | ||
|
||
public String getAssetExtension() { | ||
return this.mAssetExtenstion; | ||
} | ||
|
||
} |
158 changes: 158 additions & 0 deletions
158
app/src/main/java/m2g/mine2gether/androidminer/Config.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
// Copyright (c) 2019, Mine2Gether.com | ||
// | ||
// Please see the included LICENSE file for more information. | ||
|
||
package m2g.mine2gether.androidminer; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class Config { | ||
|
||
public static Config settings = new Config(); | ||
|
||
private ArrayList<PoolItem> mPools = new ArrayList<PoolItem>(); | ||
private ArrayList<AlgoItem> mAlgos = new ArrayList<AlgoItem>(); | ||
|
||
public static int defaultPoolIndex = 1; | ||
public static String defaultWallet = ""; | ||
public static String defaultPassword = ""; | ||
|
||
public Config() { | ||
|
||
mAlgos.add(new AlgoItem("cn", "")); | ||
mAlgos.add(new AlgoItem("cn/0", "")); | ||
mAlgos.add(new AlgoItem("cn/1", "")); | ||
mAlgos.add(new AlgoItem("cn/2", "")); | ||
mAlgos.add(new AlgoItem("cn/xtl", "")); | ||
mAlgos.add(new AlgoItem("cn/msr", "")); | ||
mAlgos.add(new AlgoItem("cn/xao", "")); | ||
mAlgos.add(new AlgoItem("cn/rto", "")); | ||
mAlgos.add(new AlgoItem("cn/half", "")); | ||
mAlgos.add(new AlgoItem("cn/gpu", "")); | ||
mAlgos.add(new AlgoItem("cn/wow", "")); | ||
mAlgos.add(new AlgoItem("cn/r", "")); | ||
mAlgos.add(new AlgoItem("cn/rwz", "")); | ||
mAlgos.add(new AlgoItem("cn/zls", "")); | ||
mAlgos.add(new AlgoItem("cn/double", "")); | ||
mAlgos.add(new AlgoItem("cn-lite", "")); | ||
mAlgos.add(new AlgoItem("cn-lite/0", "")); | ||
mAlgos.add(new AlgoItem("cn-lite/1", "")); | ||
mAlgos.add(new AlgoItem("cn-lite/ipbc", "")); | ||
mAlgos.add(new AlgoItem("cn-heavy", "")); | ||
mAlgos.add(new AlgoItem("cn-heavy/xhv", "")); | ||
mAlgos.add(new AlgoItem("cn-heavy/tube", "")); | ||
mAlgos.add(new AlgoItem("cn-pico/trtl", "")); | ||
mAlgos.add(new AlgoItem("cryptonight-upx/2", "-upx")); | ||
|
||
//User Defined | ||
mPools.add(new PoolItem("custom", "custom", "", "", "", "", "", "", "")); | ||
|
||
// uPlexa (UPX)|upx.pool.mine2gether.com:2223|cryptonight-upx/2 | ||
mPools.add(new PoolItem( | ||
"upx", | ||
"uPlexa (UPX)", | ||
"upx.pool.mine2gether.com:2223", | ||
"cryptonight-upx/2", | ||
"https://upx.mine2gether.com/api", | ||
"https://upx.mine2gether.com", | ||
"https://upx.mine2gether.com/#my_stats", | ||
"https://upx.mine2gether.com/#getting_started", | ||
"" | ||
) | ||
); | ||
|
||
// Loki Network (LOKI) + Turtlecoin (TRTL) Merged Mining|loki.pool.mine2gether.com:2221|cn-pico/trtl | ||
mPools.add(new PoolItem( | ||
"loki", | ||
"Loki Network (LOKI) + Turtlecoin (TRTL) Merged Mining", | ||
"loki.pool.mine2gether.com:2221", | ||
"cn-pico/trtl", | ||
"https://loki.mine2gether.com/api", | ||
"https://loki.mine2gether.com", | ||
"https://loki.mine2gether.com/#my_stats", | ||
"https://loki.mine2gether.com/#getting_started", | ||
"https://trtl.mine2gether.com/api" | ||
) | ||
); | ||
|
||
// XtendCash (XTNC) + Turtlecoin (TRTL) Merged Mining|xtnc.pool.mine2gether.com:2222|cn-pico/trtl | ||
mPools.add(new PoolItem( | ||
"xtnc", | ||
"XtendCash (XTNC) + Turtlecoin (TRTL) Merged Mining", | ||
"xtnc.pool.mine2gether.com:2222", | ||
"cn-pico/trtl", | ||
"https://xtnc.mine2gether.com/api", | ||
"https://xtnc.mine2gether.com", | ||
"https://xtnc.mine2gether.com/#my_stats", | ||
"https://xtnc.mine2gether.com/#getting_started", | ||
"https://trtl.mine2gether.com/api" | ||
) | ||
); | ||
|
||
// Turtlecoin (TRTL)|trtl.pool.mine2gether.com:2225|cn-pico/trtl | ||
mPools.add(new PoolItem( | ||
"trtl", | ||
"Turtlecoin (TRTL)", | ||
"trtl.pool.mine2gether.com:2225", | ||
"cn-pico/trtl", | ||
"https://trtl.mine2gether.com/api", | ||
"https://trtl.mine2gether.com", | ||
"https://trtl.mine2gether.com/#my_stats", | ||
"https://trtl.mine2gether.com/#getting_started", | ||
"https://trtl.mine2gether.com/api" | ||
) | ||
); | ||
|
||
// Alloy (XAO)|xao.pool.mine2gether.com:1117|cn/xao | ||
mPools.add(new PoolItem( | ||
"xao", | ||
"Alloy (XAO)", | ||
"xao.pool.mine2gether.com:1117", | ||
"cn/xao", | ||
"https://xao.mine2gether.com/api", | ||
"https://xao.mine2gether.com", | ||
"https://xao.mine2gether.com/#my_stats", | ||
"https://xao.mine2gether.com/#getting_started", | ||
"" | ||
) | ||
); | ||
|
||
// Citadel (CTL)|ctl.pool.mine2gether.com:1114|cn/1 | ||
mPools.add(new PoolItem( | ||
"ctl", | ||
"Citadel (CTL)", | ||
"ctl.pool.mine2gether.com:1114", | ||
"cn/1", | ||
"https://ctl.mine2gether.com/api", | ||
"https://ctl.mine2gether.com", | ||
"https://ctl.mine2gether.com/#my_stats", | ||
"https://ctl.mine2gether.com/#getting_started", | ||
"" | ||
) | ||
); | ||
|
||
/* | ||
mPools.add(new PoolItem( | ||
"", | ||
"", | ||
"", | ||
"", | ||
"", | ||
"", | ||
"", | ||
"" | ||
) | ||
); | ||
*/ | ||
|
||
} | ||
|
||
public PoolItem[] getPools() { | ||
return this.mPools.toArray(new PoolItem[mPools.size()]); | ||
} | ||
|
||
public AlgoItem[] getAlgos() { | ||
return this.mAlgos.toArray(new AlgoItem[mAlgos.size()]); | ||
} | ||
|
||
} |
Oops, something went wrong.