Skip to content

Commit

Permalink
Merge branch 'testing'
Browse files Browse the repository at this point in the history
  • Loading branch information
Xorok authored and Xorok committed Nov 4, 2016
2 parents 9d364dc + c4e1bd7 commit d9a7b3b
Show file tree
Hide file tree
Showing 20 changed files with 78 additions and 141 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
/.idea
.DS_Store
/build
/captures
Expand Down
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

22 changes: 0 additions & 22 deletions .idea/gradle.xml

This file was deleted.

46 changes: 0 additions & 46 deletions .idea/misc.xml

This file was deleted.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

Binary file modified app/app-release.apk
Binary file not shown.
28 changes: 18 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,32 @@ def gitRevision() {
return cmd.execute().text.trim()
}

def gitDirty() {
def cmd = "git diff-index --name-only HEAD"
if(cmd.execute().text.trim().length()>0)
return "-dirty";
return "";
}

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
applicationId "org.efidroid.efidroidmanager"
minSdkVersion 15
targetSdkVersion 24
targetSdkVersion 25
versionCode 3
versionName "1.0-g${gitRevision()}"
versionName "1.0-g${gitRevision()}${gitDirty()}"

buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
buildConfigField "String", "USERNAME", "\""+System.getProperty("user.name")+"\""
buildConfigField "String", "HOSTNAME", "\""+InetAddress.getLocalHost().getHostName()+"\""
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -37,11 +45,11 @@ dependencies {
compile('com.github.afollestad.material-dialogs:commons:0.8.5.6@aar') {
transitive = true
}
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.android.volley:volley:1.0.0'
compile 'org.ini4j:ini4j:0.5.4'
compile 'commons-io:commons-io:2.5'
compile 'com.melnykov:floatingactionbutton:1.3.0'
Expand Down
3 changes: 3 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Ignore warnings caused by ini4j referencing non Android-runtime classes
-dontwarn java.beans.*
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public final class AppConstants {
public static final String DEVICE_NAME = Build.MANUFACTURER.toLowerCase()+"/"+Build.DEVICE.toLowerCase();
public static final String SHAREDPREFS_GLOBAL = "org.efidroid.efidroidmanager";
public static final String SHAREDPREFS_GLOBAL_LAST_DEVICEINFO_UPDATE = "last_deviceinfo_update";
public static final String SHAREDPREFS_GLOBAL_LAST_APP_VERSION = "last_app_version";

public static final String PATH_INTERNAL_DEVICES = "devices.json";
public static final String PATH_INTERNAL_FSTAB = "fstab.multiboot";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.efidroid.efidroidmanager;

import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Build;
import android.util.Base64;
Expand Down Expand Up @@ -684,14 +685,19 @@ public static void dd(String source, String destination) throws Exception {
}

public static void init(Context context) {
SharedPreferences sp = context.getSharedPreferences(AppConstants.SHAREDPREFS_GLOBAL, Context.MODE_PRIVATE);
int lastVersionCode = sp.getInt(AppConstants.SHAREDPREFS_GLOBAL_LAST_APP_VERSION, 0);

try {
InputStream is = context.getAssets().open(Build.CPU_ABI+"/busybox");
File out = new File(context.getFilesDir(), "/busybox");
if(!out.exists())
if(!out.exists() || lastVersionCode!=BuildConfig.VERSION_CODE)
FileUtils.copyInputStreamToFile(is, out);
out.setExecutable(true, false);
out.setReadable(true, false);
RootShell.shellPathExtension = context.getFilesDir().getAbsolutePath();

sp.edit().putInt(AppConstants.SHAREDPREFS_GLOBAL_LAST_APP_VERSION, BuildConfig.VERSION_CODE).apply();
} catch (IOException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
locationTextView.setVisibility(View.GONE);

final ArrayList<OperatingSystemEditActivity.MultibootDir> multibootDirectories = mListener.getMultibootDirectories();
locationSpinner.setAdapter(new ArrayAdapter<>(getContext(), R.layout.support_simple_spinner_dropdown_item, multibootDirectories));
locationSpinner.setAdapter(new ArrayAdapter<>(getContext(), R.layout.efidroid_simple_spinner_dropdown_item, multibootDirectories));
locationSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public void onProcess(Bundle extras) {
mSuccess = false;

int progress = 0;
String romDir = null;
try {
String romDir;
if(os.isCreationMode()) {
progress = publishProgress(1, getService().getString(R.string.creating_os_dir));

Expand Down Expand Up @@ -153,6 +153,19 @@ else if(RootToolsEx.nodeExists(iconPath)) {
}
catch (Exception e) {
mSuccess = false;

if(os.isCreationMode()) {
publishProgress(progress, "Undoing changes");

// delete rom directory
try {
if (romDir != null) {
RootTools.deleteFileOrDirectory(romDir, false);
}
} catch (Exception ignored) {
}
}

publishProgress(progress, e.getLocalizedMessage());
}

Expand Down
24 changes: 24 additions & 0 deletions app/src/main/res/layout/efidroid_simple_spinner_dropdown_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?><!--
**
** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="?attr/spinnerDropDownItemStyle"
android:layout_width="match_parent"
android:layout_height="?attr/dropdownListPreferredItemHeight"
android:ellipsize="middle"
android:maxLines="1" />
8 changes: 4 additions & 4 deletions sub_projects/RootShell/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
minSdkVersion 11
targetSdkVersion 24
targetSdkVersion 25
}

buildTypes {
Expand All @@ -20,5 +20,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:appcompat-v7:25.0.0'
}
8 changes: 4 additions & 4 deletions sub_projects/RootTools/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
minSdkVersion 11
targetSdkVersion 24
targetSdkVersion 25
}

buildTypes {
Expand All @@ -21,5 +21,5 @@ dependencies {
compile project(':sub_projects:RootShell')
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:appcompat-v7:25.0.0'
}

0 comments on commit d9a7b3b

Please sign in to comment.