summaryrefslogtreecommitdiff
authoryang.xu <yang.xu@amlogic.com>2018-02-28 09:23:34 (GMT)
committer yang.xu <yang.xu@amlogic.com>2018-02-28 09:23:34 (GMT)
commit7bcda7795e74f526e53b3b776402e2ad659183c3 (patch)
tree4f75005291be40cac3c55a1f86dbfe56bb24533a
parent7111a9fd4f0d6fc4d4580fe1a7b4c8088e7af1d8 (diff)
downloadampere-7bcda7795e74f526e53b3b776402e2ad659183c3.zip
ampere-7bcda7795e74f526e53b3b776402e2ad659183c3.tar.gz
ampere-7bcda7795e74f526e53b3b776402e2ad659183c3.tar.bz2
OTAUpgrade: don't wipe data since bcb update not support it[2/2]
PD# 158967 don't wipe data since bcb update not support it when on upgrading Change-Id: Ice777fdb642454203204ac67170cc5415283c2fe
Diffstat
-rw-r--r--apps/OTAUpgrade2/libs/libotaupdate.jar354
-rw-r--r--apps/OTAUpgrade2/res/values-zh-rCN/strings.xml1
-rw-r--r--apps/OTAUpgrade2/res/values/strings.xml1
-rw-r--r--apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/MainActivity.java9
-rw-r--r--apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/PrefUtils.java9
5 files changed, 215 insertions, 159 deletions
diff --git a/apps/OTAUpgrade2/libs/libotaupdate.jar b/apps/OTAUpgrade2/libs/libotaupdate.jar
index 27bac93..63ec931 100644
--- a/apps/OTAUpgrade2/libs/libotaupdate.jar
+++ b/apps/OTAUpgrade2/libs/libotaupdate.jar
@@ -1,9 +1,13 @@
-PK
-
+PK
+NMIMR()*M
+
+
+
+
SourceFile
-
+
@@ -72,11 +76,11 @@ I

-
+
SourceFile
-
+
@@ -88,7 +92,7 @@ SourceFile
3
-
+
@@ -111,7 +115,7 @@ Y
-
+
downloader
@@ -170,10 +174,10 @@ SourceFile
*
*
-
+

SourceFile
-
+
@@ -190,7 +194,7 @@ SourceFile
-
+
updatename
update.xml
@@ -360,119 +364,146 @@ SourceFile
-
+
SourceFile
*+
*
-
+

-
+
-
+
onProgress
SourceFile
-
+
update.zip
-UPDATE_OTA
+UPDATE_OTA
mFocusStop
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-getDefault
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
sdkVersion
-updateFile
-Exceptions
-
-
- 
-
+updateFile
+
+
+
+startsWith 
+
+
- 
-
- !
-
-
-
-
-
-=A
-@
-@D E
-@H I
-=
-@
-=M NO
-SUT
-Y
-=\ ]^
-`ba
-f
-
-
-SourceFile
+ 
+ 
+
+
+
+(*)
+132
+getDefault
+17 8
+:<;
+@BA
+@G H
+@J KL
+MP Q
+SUT
+
+Ya b
+Exceptions
+
+{ 
+~
+~ 
+~
+
+
+
+
+
+ 
+
+ 
+ 
+
+
+ 
+
+U
+ 
+
+U
+
+M 
+SourceFile
-
-
-
-
-
-,
-,$
-
+
+
+
+
+
+:
+
+2:  ?D
+
+
+:
+
+_ `
+
+
+
+M+Y:66
+,`
+
6 
-  C a7nFj6  
-G J
-K  LY6 PR
-:  X [
--
-G J
-K
-
-*
-
-*
-
-
-
-
+   a7nj6  
+ 
+  Y6 
+:   ȅ
+-
+ 
+
+
+*
+
+*
+
+
+
+
mErrorCode
@@ -498,7 +529,8 @@ SourceFile
*
-
+
+
@@ -543,7 +575,7 @@ SourceFile

-
+
@@ -559,7 +591,7 @@ SourceFile
-
+
@@ -600,7 +632,7 @@ SourceFile
*
-
+
@@ -642,7 +674,7 @@ SourceFile
-
+
update.zip
check_time
@@ -699,7 +731,7 @@ SourceFile
-
+
randomFile
@@ -749,7 +781,7 @@ SourceFile
*
*
 ):ILPRZd E`ct'@e,Qlo;VYjy|
-
+
@@ -884,7 +916,7 @@ e6 *
*
-
+
@@ -920,20 +952,20 @@ SourceFile
-
-
-
-
-
-
-
-
-
-
-SourceFile
-
-*
-
+
+
+
+
+
+
+
+
+
+SourceFile
+
+*
+
+
@@ -951,7 +983,7 @@ SourceFile
-
+
getcountry
@@ -982,7 +1014,7 @@ SourceFile
-
+
Exceptions
@@ -1006,7 +1038,7 @@ CommandRun
-
+
STRING_KEY
@@ -1078,62 +1110,70 @@ PK
<classpathentry kind="lib" path="E:/Project/android-sdk_r24.3.3-windows/android-sdk-windows/platforms/android-19/androidInner.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
-PK
+PK
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
diff --git a/apps/OTAUpgrade2/res/values-zh-rCN/strings.xml b/apps/OTAUpgrade2/res/values-zh-rCN/strings.xml
index 553b55f..b0dacbc 100644
--- a/apps/OTAUpgrade2/res/values-zh-rCN/strings.xml
+++ b/apps/OTAUpgrade2/res/values-zh-rCN/strings.xml
@@ -105,4 +105,5 @@
<string name="update_download">"升级包下载中"</string>
<string name="remove_hit">"保证外设连接正常,否则备份转存失败"</string>
<string name="prepare_waitting">"数据准备中,确认您的外设中有备份文件"</string>
+ <string name="reset_wipe">"升级文件在本机上,此次升级不擦除用户数据"</string>
</resources> \ No newline at end of file
diff --git a/apps/OTAUpgrade2/res/values/strings.xml b/apps/OTAUpgrade2/res/values/strings.xml
index a7e73d7..b7fca51 100644
--- a/apps/OTAUpgrade2/res/values/strings.xml
+++ b/apps/OTAUpgrade2/res/values/strings.xml
@@ -118,4 +118,5 @@
<string name="noti_msg">Download success</string>
<string name="update_download">Update Downloading</string>
<string name="prepare_waitting">"prepare,make sure BACKUP file in your external storage"</string>
+ <string name="reset_wipe">"update file is on the phone,cannot wipe data"</string>
</resources> \ No newline at end of file
diff --git a/apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/MainActivity.java b/apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/MainActivity.java
index 410d67a..9f4bfbe 100644
--- a/apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/MainActivity.java
+++ b/apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/MainActivity.java
@@ -296,13 +296,20 @@ public class MainActivity extends Activity implements OnClickListener {
break;
case R.id.btn_locale_certern:
-
String fullname = filepath.getText().toString();
if ( fullname.lastIndexOf("/") > 0 && (filename != null) && (filename.length() > 0)) {
if (mWipeDate == null)
UpdateMode = mPreference.createAmlScript(fullname, false, false);
else
UpdateMode = mPreference.createAmlScript(fullname,mWipeDate.isChecked(),mWipeMedia.isChecked());
+
+ if (UpdateMode == OtaUpgradeUtils.UPDATE_OTA && mPreference.inLocal(fullname)
+ &&(mWipeDate.isChecked() || mWipeMedia.isChecked())) {
+ mWipeDate.setChecked(false);
+ mWipeMedia.setChecked(false);
+ Toast.makeText(this, getString(R.string.reset_wipe), Toast.LENGTH_LONG).show();
+ }
+
UpdateDialog(fullname);
} else {
Toast.makeText(this, getString(R.string.file_not_exist), 2000).show();
diff --git a/apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/PrefUtils.java b/apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/PrefUtils.java
index 0679a92..c78cf86 100644
--- a/apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/PrefUtils.java
+++ b/apps/OTAUpgrade2/src/com/droidlogic/otaupgrade/PrefUtils.java
@@ -475,7 +475,14 @@ public class PrefUtils implements DownloadUpdateTask.CheckPathCallBack{
}
return res;
}
-
+ public boolean inLocal(String fullpath) {
+ String updateFilePath = getAttribute(fullpath);
+ if (updateFilePath.startsWith("/data") || updateFilePath.startsWith("/cache")
+ || updateFilePath.startsWith("/sdcard") ) {
+ return true;
+ }
+ return false;
+ }
public int createAmlScript(String fullpath, boolean wipe_data, boolean wipe_cache) {
File file;