Skip to content

Commit 325e55e

Browse files
committed
Versión inicial
0 parents  commit 325e55e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2008
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apply plugin: 'com.android.application'
2+
3+
apply plugin: 'kotlin-android'
4+
5+
apply plugin: 'kotlin-android-extensions'
6+
7+
android {
8+
compileSdkVersion 29
9+
buildToolsVersion "29.0.0"
10+
defaultConfig {
11+
applicationId 'com.adamff.m365'
12+
minSdkVersion 15
13+
targetSdkVersion 32
14+
versionCode 1
15+
versionName '2.2'
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
}
25+
26+
dependencies {
27+
implementation 'com.android.support:recyclerview-v7'
28+
implementation fileTree(dir: 'libs', include: ['*.jar'])
29+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
30+
implementation 'androidx.appcompat:appcompat:1.0.2'
31+
implementation 'androidx.core:core-ktx:1.0.1'
32+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
33+
testImplementation 'junit:junit:4.12'
34+
androidTestImplementation 'androidx.test:runner:1.1.1'
35+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
36+
}

app/src/main/AndroidManifest.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools" package="com.example.m365" tools:ignore="ExtraText">
4+
5+
<uses-permission android:name="android.permission.INTERNET"/>
6+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
7+
8+
<application
9+
android:icon="@mipmap/icon_main"
10+
android:label="@string/app_name"
11+
android:roundIcon="@mipmap/icon_main"
12+
android:supportsRtl="true"
13+
android:theme="@style/AppTheme">
14+
<activity android:name=".view.MainActivity">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN"/>
17+
<category android:name="android.intent.category.LAUNCHER"/>
18+
</intent-filter>
19+
</activity>
20+
</application>
21+
22+
</manifest>

app/src/main/ic_launcher-web.png

29.3 KB
Loading

app/src/main/icon_main-web.png

47 KB
Loading
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
package com.example.m365.model
2+
3+
object Constants {
4+
const val STORAGE_PERMISSION_CODE = 1000
5+
const val BASE_URL = "https://m365.botox.bz/cfw?version=DRV"
6+
const val DOWNG_PACKAGE = "com.m365downgrade"
7+
8+
val FIRM_ORIGINAL = arrayOf(
9+
2, // firmware version index
10+
false, // kers
11+
false, // vel. máx normal
12+
false, // vel. máx ECO
13+
false, // vel. iniciar motor
14+
false, // retardo ctrl. crucero
15+
false, // multi. vel. rueda
16+
false, // power constant
17+
false, // límite batería
18+
false, // Desactivar BEEP
19+
false, // cambio inst. ECO
20+
false, // ECO startup
21+
false, // Russian
22+
false, // Eliminar límite vel.
23+
false, // Eliminar modo carga
24+
false, // ESC - BMS
25+
"6", // kers
26+
"28", // vel. máx normal
27+
"22", // vel. máx ECO
28+
"5", // vel. iniciar motor
29+
"51575",// power constant
30+
"5", // retraso ctrl. crucero
31+
"43.01",// límite batería
32+
"345" // multi. vel. rueda
33+
)
34+
35+
val FIRM_DYOC = arrayOf(
36+
2,
37+
false,
38+
true,
39+
true,
40+
true,
41+
true,
42+
false,
43+
true,
44+
false,
45+
false,
46+
false,
47+
false,
48+
false,
49+
false,
50+
false,
51+
false,
52+
"6", // kers
53+
"31", // vel. máx normal
54+
"20", // vel. máx ECO
55+
"2", // vel. iniciar motor
56+
"40165",// power constant
57+
"5", // retraso ctrl. crucero
58+
"52", // límite batería
59+
"345" // multi. vel. rueda
60+
)
61+
62+
val FIRM_BOTOX = arrayOf(
63+
2, // firmware version index
64+
true, // kers
65+
true, // vel. máx normal
66+
true, // vel. máx ECO
67+
true, // vel. iniciar motor
68+
true, // power constant
69+
false, // retardo ctrl. crucero
70+
true, // límite batería
71+
false, // multi. vel. rueda
72+
false, // Desactivar BEEP
73+
true, // cambio inst. ECO
74+
false, // ECO startup
75+
false, // Russian
76+
true, // Eliminar límite vel.
77+
false, // Eliminar modo carga
78+
false, // ESC - BMS
79+
"40", // kers
80+
"30", // vel. máx normal
81+
"26", // vel. máx ECO
82+
"3", // vel. iniciar motor
83+
"38000",// power constant
84+
"5", // retraso ctrl. crucero
85+
"52", // límite batería
86+
"345" // multi. vel. rueda
87+
)
88+
89+
val FIRM_CHURU = arrayOf(
90+
1, // firmware version index
91+
true, // kers
92+
true, // vel. máx normal
93+
true, // vel. máx ECO
94+
true, // vel. iniciar motor
95+
true, // power constant
96+
false, // retardo ctrl. crucero
97+
false, // límite batería
98+
false, // multi. vel. rueda
99+
false, // Desactivar BEEP
100+
true, // cambio inst. ECO
101+
false, // ECO startup
102+
false, // Russian
103+
false, // Eliminar límite vel.
104+
false, // Eliminar modo carga
105+
false, // ESC - BMS
106+
"35", // kers
107+
"35", // vel. máx normal
108+
"25", // vel. máx ECO
109+
"1", // vel. iniciar motor
110+
"36025",// power constant
111+
"5", // retraso ctrl. crucero
112+
"43.01", // límite batería
113+
"345" // multi. vel. rueda
114+
)
115+
116+
val FIRM_ROLLER = arrayOf(
117+
2, // firmware version index
118+
true, // kers
119+
true, // vel. máx normal
120+
true, // vel. máx ECO
121+
true, // vel. iniciar motor
122+
true, // power constant
123+
false, // retardo ctrl. crucero
124+
false, // límite batería
125+
false, // multi. vel. rueda
126+
false, // Desactivar BEEP
127+
true, // cambio inst. ECO
128+
true, // ECO startup
129+
false, // Russian
130+
true, // Eliminar límite vel.
131+
false, // Eliminar modo carga
132+
false, // ESC - BMS
133+
"40", // kers
134+
"30", // vel. máx normal
135+
"19", // vel. máx ECO
136+
"3", // vel. iniciar motor
137+
"33000",// power constant
138+
"5", // retraso ctrl. crucero
139+
"43.01",// límite batería
140+
"345" // multi. vel. rueda
141+
)
142+
143+
val FIRM_CFW = arrayOf(
144+
2, // firmware version index
145+
true, // kers
146+
true, // vel. máx normal
147+
true, // vel. máx ECO
148+
true, // vel. iniciar motor
149+
true, // power constant
150+
false, // retardo ctrl. crucero
151+
true, // límite batería
152+
false, // multi. vel. rueda
153+
false, // Desactivar BEEP
154+
false, // cambio inst. ECO
155+
false, // ECO startup
156+
true, // Russian
157+
false, // Eliminar límite vel.
158+
false, // Eliminar modo carga
159+
false, // ESC - BMS
160+
"46.3", // kers
161+
"45", // vel. máx normal
162+
"27", // vel. máx ECO
163+
"1.45", // vel. iniciar motor
164+
"27877",// power constant
165+
"5", // retraso ctrl. crucero
166+
"52",// límite batería
167+
"345" // multi. vel. rueda
168+
)
169+
170+
val FIRM_CFW2 = arrayOf(
171+
2, // firmware version index
172+
true, // kers
173+
true, // vel. máx normal
174+
true, // vel. máx ECO
175+
true, // vel. iniciar motor
176+
true, // power constant
177+
false, // retardo ctrl. crucero
178+
true, // límite batería
179+
false, // multi. vel. rueda
180+
false, // Desactivar BEEP
181+
false, // cambio inst. ECO
182+
false, // ECO startup
183+
true, // Russian
184+
false, // Eliminar límite vel.
185+
false, // Eliminar modo carga
186+
false, // ESC - BMS
187+
"46.3", // kers
188+
"45", // vel. máx normal
189+
"27", // vel. máx ECO
190+
"1.45", // vel. iniciar motor
191+
"25787",// power constant
192+
"5", // retraso ctrl. crucero
193+
"52",// límite batería
194+
"345" // multi. vel. rueda
195+
)
196+
197+
val PRED_FIRMS = arrayOf(
198+
FIRM_ORIGINAL,
199+
FIRM_DYOC,
200+
FIRM_BOTOX,
201+
FIRM_CHURU,
202+
FIRM_ROLLER,
203+
FIRM_CFW,
204+
FIRM_CFW2
205+
)
206+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.example.m365.model;
2+
3+
import android.text.InputFilter;
4+
import android.text.Spanned;
5+
6+
import java.util.regex.Matcher;
7+
import java.util.regex.Pattern;
8+
9+
public class FloatFilter implements InputFilter {
10+
private final float min;
11+
private final float max;
12+
private int decimals;
13+
Pattern pattern;
14+
15+
public FloatFilter(float min, float max, int decimals) {
16+
this.min = min;
17+
this.max = max;
18+
this.pattern = Pattern.compile("[0-9]*(\\.[0-9]{0," + (decimals - 1) + "})?");
19+
}
20+
21+
@Override
22+
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
23+
// Check matcher
24+
Matcher matcher = pattern.matcher(dest);
25+
if (!matcher.matches()) return "";
26+
27+
try {
28+
float input = Float.parseFloat(dest.subSequence(0, dstart).toString() + source + dest.subSequence(dend, dest.length()));
29+
if (isInRange(min, max, input))
30+
return null;
31+
} catch (NumberFormatException nfe) {
32+
}
33+
return "";
34+
}
35+
36+
private boolean isInRange(float a, float b, float c) {
37+
return b > a ? c >= a && c <= b : c >= b && c <= a;
38+
}
39+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.example.m365.model;
2+
3+
import android.text.InputFilter;
4+
import android.text.Spanned;
5+
6+
public class IntFilter implements InputFilter {
7+
private final int min;
8+
private final int max;
9+
10+
public IntFilter(int minValue, int maxValue) {
11+
this.min = minValue;
12+
this.max = maxValue;
13+
}
14+
15+
public IntFilter(String minValue, String maxValue) {
16+
this.min = Integer.parseInt(minValue);
17+
this.max = Integer.parseInt(maxValue);
18+
}
19+
20+
@Override
21+
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
22+
try {
23+
int input = Integer.parseInt(dest.toString() + source.toString());
24+
if (isInRange(min, max, input))
25+
return null;
26+
} catch (NumberFormatException nfe) {
27+
}
28+
return "";
29+
}
30+
31+
private boolean isInRange(int a, int b, int c) {
32+
return b > a ? c >= a && c <= b : c >= b && c <= a;
33+
}
34+
}

0 commit comments

Comments
 (0)