Skip to content

Commit b1b84a0

Browse files
try to copy rom to commen dir
every device uses different mount point for data like mine uses /emmc as internal in recovery and my second device uses /sdcard as internal to fix flaher error copy rom to data/update.zip
1 parent 9dbc0cd commit b1b84a0

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

app/src/main/java/io/github/otaupdater/otaupdater/activity/OpenScriptGenerator.java

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
import com.eminayar.panter.enums.Animation;
1515
import com.stericson.RootTools.RootTools;
1616

17-
import eu.chainfire.libsuperuser.Shell;
1817
import io.github.otaupdater.otaupdater.R;
1918
import io.github.otaupdater.otaupdater.util.Tools;
2019

20+
import static io.github.otaupdater.otaupdater.util.Config.PutStringPreferences;
21+
2122

2223
/**
2324
* Created by sumit on 15/1/17.
@@ -70,31 +71,34 @@ public void onClick(View v) {
7071
});
7172

7273
Path.setText(p);
74+
7375
FlashButton.setOnClickListener(new View.OnClickListener() {
7476
@Override
7577
public void onClick(View v) {
7678
if(RootTools.isRootAvailable()) {
7779

7880
if (RootTools.isAccessGiven()) {
79-
Tools.shell("mount -o rw,remount,rw /cache", true);
80-
Tools.shell("touch " + SCRIPT_PATH, true);
81-
Tools.shell("echo 'install " + p + " ' > " + SCRIPT_PATH, true);
82-
if (mWipeData.isChecked()) {
83-
Tools.shell("echo 'install wipe data ' >> " + SCRIPT_PATH, true);
84-
}
85-
if (mWipeCache.isChecked()) {
86-
Tools.shell("echo 'install wipe cache ' >> " + SCRIPT_PATH, true);
87-
}
8881

8982
FlashDialog.setTitle("Are you sure ?")
9083
.setHeaderBackground(R.color.colorPrimaryDark)
9184
.setMessage(p)
9285
.setPositive("Flash", new View.OnClickListener() {
9386
@Override
9487
public void onClick(View view) {
95-
Shell.SU.run("reboot recovery");
96-
FlashDialog.dismiss();
97-
88+
Tools.shell("dd if="+p+ " of=/data/update.zip", true);
89+
PutStringPreferences(getApplicationContext(),"NewPath","/data/update.zip");
90+
p=getPreferences(getApplicationContext(),"NewPath");
91+
FlashDialog.setMessage(p);
92+
Tools.shell("mount -o rw,remount,rw /cache", true);
93+
Tools.shell("touch " + SCRIPT_PATH, true);
94+
Tools.shell("echo 'install /data/update.zip" + " ' > " + SCRIPT_PATH, true);
95+
if (mWipeData.isChecked()) {
96+
Tools.shell("echo 'install wipe data ' >> " + SCRIPT_PATH, true);
97+
}
98+
if (mWipeCache.isChecked()) {
99+
Tools.shell("echo 'install wipe cache ' >> " + SCRIPT_PATH, true);
100+
}
101+
Tools.shell("reboot recovery",true);
98102
}
99103
})
100104
.setNegative("Cancel", new View.OnClickListener() {

app/src/main/java/io/github/otaupdater/otaupdater/adapter/GithubReleasesAdapter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public GithubReleasesAdapter(Context context)
4444
super(context);
4545
}
4646
private boolean suAvailable;
47+
private View finalConvertView;
4748

4849
@Override
4950
protected View onView(int position, View convertView, ViewGroup parent)
@@ -68,7 +69,7 @@ protected View onView(int position, View convertView, ViewGroup parent)
6869
try
6970
{
7071

71-
final View finalConvertView = convertView;
72+
finalConvertView = convertView;
7273
convertView.setOnClickListener(new View.OnClickListener()
7374
{
7475
@Override

0 commit comments

Comments
 (0)