Skip to content

Commit

Permalink
Update [2.312]
Browse files Browse the repository at this point in the history
-Logging fixed
-Intel partition header check added (on old versions it will be
recognized as invalid image)
  • Loading branch information
Aschot Mkrtchyan committed Apr 24, 2016
1 parent 130bd76 commit 6dbbe17
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 39 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -20,4 +20,6 @@ $RECYCLE.BIN/
*.msp

# Windows shortcuts
*.lnk
*.lnk
local.properties
*.iml
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========

Update [2.3.12]

-Logging fixed
-Intel partition header check added (on old versions it will be recognized as invalid image)

Update [2.3.11]

-Error while creating backups fixed on more devices
Expand Down
2 changes: 1 addition & 1 deletion CardsUILib/build.gradle
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
buildToolsVersion '23.0.3'

sourceSets {
main {
Expand Down
4 changes: 2 additions & 2 deletions Donations/build.gradle
@@ -1,11 +1,11 @@
apply plugin: 'com.android.library'
dependencies {
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:support-v4:23.3.0'
}

android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
buildToolsVersion '23.0.3'

defaultConfig {
minSdkVersion 7
Expand Down
Binary file modified RashrApp/RashrApp-release.apk
Binary file not shown.
14 changes: 7 additions & 7 deletions RashrApp/build.gradle
Expand Up @@ -2,11 +2,11 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 8
versionCode 108
versionName '2.3.11'
versionCode 109
versionName '2.3.12'
}
lintOptions {
abortOnError false
Expand All @@ -19,9 +19,9 @@ dependencies {
compile project(':Utils-Library')
compile project(':CardsUILib')
compile project(':Donations')
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'de.psdev.licensesdialog:licensesdialog:1.8.0'
}
Expand Up @@ -111,8 +111,12 @@ public void onClick(View v) {
String Name;
if (etFileName.getText() != null && etFileName.isEnabled()
&& !etFileName.getText().toString().equals("")) {
//User has defined a name for the backup. Use it.
Name = etFileName.getText().toString();
} else {
//Use hint as backup name. Normally the correct version
//and Recovery System (if Rashr could read it out of
//"/cache/recovery/last_log"
Name = String.valueOf(etFileName.getHint());
}

Expand Down Expand Up @@ -244,7 +248,7 @@ public void onPageScrollStateChanged(int state) {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (!(RashrApp.DEVICE.isRecoveryDD() || RashrApp.DEVICE.isRecoveryMTD())) {
Toast.makeText(mContext, "Operation not supported", Toast.LENGTH_SHORT).show();
Toast.makeText(mContext, R.string.op_not_supported, Toast.LENGTH_SHORT).show();
} else {
showPopup(view);
}
Expand All @@ -254,7 +258,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (!(RashrApp.DEVICE.isKernelDD() || RashrApp.DEVICE.isKernelMTD())) {
Toast.makeText(mContext, "Operation not supported", Toast.LENGTH_SHORT).show();
Toast.makeText(mContext, R.string.op_not_supported, Toast.LENGTH_SHORT).show();
} else {
showPopup(view);
}
Expand Down
Expand Up @@ -66,7 +66,7 @@ public class Const {
* Other constants
*/
public static final String LOG_NAME = "logs.txt";
public static final String RECOVERY_SUMS = "recovery_sums";
public static final String RECOVERY_SUMS = "recovery_links";
public static final String KERNEL_SUMS = "kernel_sums";
public static final String VERSION = "version";

Expand Down
49 changes: 33 additions & 16 deletions RashrApp/src/main/java/de/mkrtchyan/recoverytools/Device.java
Expand Up @@ -469,13 +469,20 @@ private void setPredefinedOptions() {
}
}

/**
* Reads the file raw/recovery_sums. This file contains Recovery-Image names (Placed on my own
* server) and links to Recovery-Images (used for CyanogenMod-Recovery and TWRP. ClockworkMod
* can't be downloaded by direct link because they don't provide any checksum.
*
* Each found image for the Device will be added into the corresponding ArrayList.
*/
public void loadRecoveryList() {

//TempArrayLists
ArrayList<String> CWMList = new ArrayList<>(), TWRPList = new ArrayList<>(),
PHILZList = new ArrayList<>(), StockList = new ArrayList<>(),
XZDualList = new ArrayList<>(), CMList = new ArrayList<>();


//Start reading file
try {
String Line;
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(
Expand All @@ -492,7 +499,7 @@ public void loadRecoveryList() {
CWMList.add(Line.substring(NameStartAt));
} else if (lowLine.contains(REC_SYS_TWRP)) {
if (Line.endsWith(mName + mRECOVERY_EXT))
TWRPList.add(Line.split("/")[1]);
TWRPList.add(Line.split(" ")[1]);
} else if (lowLine.contains(REC_SYS_PHILZ)) {
PHILZList.add(Line.substring(NameStartAt));
} else if (lowLine.contains("cm-")) {
Expand Down Expand Up @@ -551,9 +558,16 @@ public void loadRecoveryList() {
}
}

/**
* Reads the file raw/kernel_sums. This file contains Kernel-Image names (Placed on my own
* server and mostly Nexus-Device kernels)
*
* Each found image for the Device will be added into the corresponding ArrayList.
*/
public void loadKernelList() {
//TempArrayLists
ArrayList<String> StockKernel = new ArrayList<>();

//Start reading file
try {
String Line;
BufferedReader br = new BufferedReader(new InputStreamReader(
Expand All @@ -563,7 +577,7 @@ public void loadKernelList() {
final int NameStartAt = Line.lastIndexOf("/") + 1;
if ((lowLine.contains(mName) || lowLine.contains(Build.DEVICE.toLowerCase()))
&& lowLine.endsWith(mKERNEL_EXT)) {
if (lowLine.contains("stock")) {
if (lowLine.contains(Device.KER_SYS_STOCK)) {
StockKernel.add(Line.substring(NameStartAt));
}
}
Expand Down Expand Up @@ -630,22 +644,27 @@ public void failed(Exception e) {
private void readDeviceInfos() {
for (File i : KernelList) {
if (mKernelPath.equals("")) {
/**
* Partition doesn't exist LOLLIPOP (File.exists() returns always
* false if file is in hidden FS. Lollipop marks /dev/.... as hidden)
* Check over RootShell (if throws exception partition not found check next
*/
try {
RashrApp.SHELL.execCommand("ls " + i.getAbsolutePath());
mKernelPath = i.getAbsolutePath();
break;
} catch (FailedExecuteCommand ignore) {
/**
* Partition doesn't exist LOLLIPOP Workaround File.exists() returns always
* false if file is in hidden FS. Lollipop marks /dev/.... as hidden
* Check over RootShell (if throws exception partition not found check next
*/
}
}
}
for (File i : RecoveryList) {
if (mRecoveryPath.equals("")) {
try {
/**
* Partition doesn't exist LOLLIPOP (File.exists() returns always
* false if file is in hidden FS. Lollipop marks /dev/.... as hidden)
* Check over RootShell (if throws exception partition not found check next
*/
RashrApp.SHELL.execCommand("ls " + i.getAbsolutePath());
mRecoveryPath = i.getAbsolutePath();
//if (mRecoveryPath.endsWith(EXT_TAR)) {
Expand All @@ -654,11 +673,6 @@ private void readDeviceInfos() {
//}
break;
} catch (FailedExecuteCommand ignore) {
/**
* Partition doesn't exist LOLLIPOP Workaround File.exists() returns always
* false if file is in hidden FS. Lollipop marks /dev/.... as hidden
* Check over RootShell (if throws exception partition not found check next
*/
}
}
}
Expand Down Expand Up @@ -757,6 +771,9 @@ private void readDeviceInfos() {
|| mName.equals("im-a840sp") || mName.equals("im-a840s") || mName.equals("taurus"))
mRecoveryPath = "/dev/block/mmcblk0p20";

if (mName.equals("arubaslim"))
mKernelPath = "/dev/block/mmcblk0p8";

// Motorola DEVICEs + Same
if (mName.equals("qinara") || mName.equals("f02e") || mName.equals("vanquish_u")
|| mName.equals("xt897") || mName.equals("solstice") || mName.equals("smq_u"))
Expand Down Expand Up @@ -1015,7 +1032,7 @@ private void readLastLog() {
} else if ((!mKernelPath.equals("") || isKernelMTD())
&& (!mRecoveryPath.equals("") || isRecoveryMTD())) {
/**
* Break if the recovery system and version could be definded and partitions for
* Break if the recovery system and version could be defined and partitions for
* recovery and kernel found.
*/
break;
Expand Down
Expand Up @@ -329,7 +329,7 @@ public void onClick(DialogInterface dialogInterface, int i) {
if (!Const.LastLog.exists()) {
/**
* Device has never been booted to recovery or cache has been cleaned.
* The LastLog-File normaly contains a partition table so Rashr can read it out from
* The LastLog-File normally contains a partition table so Rashr can read it out from
* there if the user restarts into recovery. (probably)
*/
DeviceNotSupported.setNeutralButton(R.string.sReboot, new DialogInterface.OnClickListener() {
Expand Down Expand Up @@ -431,7 +431,7 @@ public void onNavigationDrawerItemSelected(int position) {

/**
* Checks if new version of Rashr is online and links to Play Store
* The current version number is storen on dslnexus.de/Android/rashr/version
* The current version number is stored on dslnexus.de/Android/rashr/version
* as plain text
*/
public void checkAppUpdates() {
Expand All @@ -443,7 +443,7 @@ public void checkAppUpdates() {
@Override
public void onSuccess(File file) {
try {
if (BuildConfig.VERSION_CODE < Integer.valueOf(Common.fileContent(file))) {
if (BuildConfig.VERSION_CODE < Integer.valueOf(Common.fileContent(file).replace("\n", ""))) {
new AlertDialog.Builder(mContext)
.setTitle(R.string.update_available)
.setMessage(R.string.download_update)
Expand Down
4 changes: 2 additions & 2 deletions Utils-Library/build.gradle
Expand Up @@ -2,14 +2,14 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 4
versionCode 1
versionName '1.0'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:support-v4:23.3.0'
}
}
@@ -1,7 +1,7 @@
package de.mkrtchyan.utils;

/**
* Copyright (c) 2015 Aschot Mkrtchyan
* Copyright (c) 2016 Aschot Mkrtchyan
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
Expand All @@ -14,7 +14,7 @@
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Expand Down Expand Up @@ -51,7 +51,7 @@ public DownloadDialog(Context context, Downloader downloader) {
if (mDownloader.getOnCancelListener() != null
|| mDownloader.getOnDownloadListener() != null
|| mDownloader.getOnUpdateListener() != null) {
throw new IllegalArgumentException("Downloader should have blank listeners");
throw new IllegalStateException("Downloader should have blank listeners");
}
ConnectingDialog = new ProgressDialog(mContext);
setOnCancelListener(new OnCancelListener() {
Expand Down
2 changes: 1 addition & 1 deletion root-commands/build.gradle
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 1
versionCode 1
Expand Down

0 comments on commit 6dbbe17

Please sign in to comment.