找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 1398|回复: 4

VEER刷机时一直检查电池电量,不知为何?

[复制链接]
发表于 2012-7-12 18:41 | 显示全部楼层 |阅读模式
本帖最后由 phil_rem 于 2012-7-13 00:48 编辑
$ D0 o/ w% T5 U; |% G  u  W, U/ j8 N+ f# N" k# O
5 P4 u+ K( [- z1 @( m
: Z% y2 Q9 y7 i9 i+ r* Y1 C3 Q4 j
满电的Veer刷机一路next,到最后一步,然后一直提示Battery Charging,有基友提示可能电池故障,1 r( N2 d8 C* w6 e8 O! C- F
4 [+ }  n2 @( L  K+ W
找了台可以正常刷机的小v,拆了电池换上后问题依旧,
2 h% q/ |( M  n" P5 K* [  z6 d- x
6 B7 _- X  {: t9 |8 ^% W0 q4 v更杯具的是原来正常的小v刷机也这样了(手机可正常使用,只是无法刷机): G# f1 ]0 G6 d( Q9 I1 T* b- K
) U5 y8 c9 V, s$ t+ d6 B: \
用8%12%修复工具修复无效,. o4 z; q* g4 n; p4 |% U) w: D: w

5 M/ u7 R/ f* O0 G目前两台机器均无法安装软件,商店也不知道为什么一直在转圈圈,想下个preware也没机会了。。。。$ h7 I5 P1 {& ^" N6 P3 @1 [

3 [+ e* ?- `7 U0 Y5 e之前好好的一台被我弄坏了,悲剧啊。
% T. ^2 B, H% N1 e" b$ o0 H% s8 P# `; h* E- z
现在各种抓狂~  
$ v+ [+ H) L2 n( z# I5 _( c. l3 W
" E# B: m: M( P! z跪求解决方案,小礼物送上~% R% N8 g  s0 _

4 u% t- u5 X/ X9 E, y  s  q

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入我们

×
回复

使用道具 举报

 楼主| 发表于 2012-7-12 22:51 | 显示全部楼层
诶,没人鸟我。。。。  看来国内不好混啊,去webosnation看看~
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-7-13 00:02 | 显示全部楼层
// Decompiled by DJ v3.12.12.96 Copyright 2011 Atanas Neshkov  Date: 2012/7/12 23:51:59
$ m  f( P* d% z5 O: I% o// Home Page: http://members.fortunecity.com/neshkov/dj.html  http://www.neshkov.com/dj.html - Check often for new version!% _/ m& ]- w4 |. n
// Decompiler options: packimports(3)
% @: {- {3 B: r- Z  y- l1 j// Source File Name:   ChargeBatteryStage.java. ~# |  p( T; I" T4 B7 U+ p: E
+ O. Z5 G% a( |+ N
package com.palm.nova.installer.core.stages;2 W( E2 a6 k% W3 f6 a) Q. j* p3 N

  Z/ `5 |# {: c$ qimport com.palm.nova.installer.core.*;4 i) {* ~. w% E+ f% h* O+ w5 f
import com.palm.novacom.*;
4 s* _4 C) n2 Fimport java.io.IOException;! K; k1 V& N8 q. n4 f4 R

9 L" V+ D" m2 |$ a// Referenced classes of package com.palm.nova.installer.core.stages:
$ q" E$ o7 k, w; y//            BaseStage, GoIntoUpdateModeStage+ m- v- x; S! u; H3 k' b3 m; }

% n" t' q0 a1 O' u/ Z# {9 tpublic class ChargeBatteryStage extends BaseStage
; P/ a6 p4 X2 `: G    implements IInstallerStage
; \6 ^$ v+ G- a$ _' C7 L{. [7 n4 ~% o- s+ p

: z3 ~7 a, c; Y    public ChargeBatteryStage(INovacomDevice device)
4 k) j. r4 O& b5 n) V; \/ t" E    {: w* {" e- Q9 o9 x$ ]% {& M
        jobId = null;
" I1 M1 S+ a+ g7 {        progress = null;1 N0 [. a) F2 B0 u3 l/ a4 u8 S
        currentChargeLevel = 0;3 u9 Q, e4 u3 b% f6 g
        this.device = device;: E: w4 r( y' C+ y6 f# p
    }
- S* a4 r1 V7 j% A" i% C- L  L% s
" B6 w4 j; y  P1 M* }    public String toString()
. M5 V8 B4 W! `! O  z" C& B: \+ t    {' r) B; ~" G$ m# y6 z
        return "Battery Charger";3 R5 s7 u9 a, k+ l- _% I! s
    }# c, }9 U- |3 @. W7 x
# w9 Z. e9 q# o3 s7 ^
    private void chargeBattery()+ `+ N  p: U" ~( y' R
        throws NovacomException, IOException
" r) c' C! ]( @( Z7 S    {; H& M3 J9 B$ @+ ?$ d
        INovacomStream stream = device.runProgram("", null);
/ e- V/ |4 e- g        String command = (new StringBuilder()).append("charging enable ").append(REQUIRED_POWER_PERCENTAGE).toString();5 P0 j5 E' a" H5 \# J
        byte bytes[] = command.getBytes("US-ASCII");2 [/ R' ?& L* l
        stream.write(bytes);0 L; f. @& X' i# r! _
        stream.closeOutput();6 j; {) B6 a. S3 q) {
        String streamReturn = stream.readLine();
# u) p2 h- ]$ r6 P) [        do& _& U" C- I8 R) J! f/ U, G
        {
2 n  B/ z/ D% l0 r            streamReturn = stream.readLine();4 @- h5 z+ N, }: d) ?  y; B
            if(streamReturn == null)
3 b/ C2 ^; t) N* e            {
/ _* |" k0 V& Z9 D- ?" I" k' l* }                progress.commentOnJob(jobId, "stream interupted");! p7 T) p$ F' z8 }! C7 V, h
                throw new NovacomException(-1, "stream interupted");
+ V! i9 `9 C; S; w, \2 O# A            }
6 s8 t0 T. u8 N, o  B# C            if(streamReturn.length() == 0)6 t4 q+ L6 `- L  p  R* H0 B
            {2 N5 C3 [3 J9 y# j8 O7 n
                progress.commentOnJob(jobId, "power charged up");' p) d1 d* t8 x& v! m0 o
                break;( q# d9 V" t4 v) u+ T3 {
            }- ~0 d0 C6 G; _" w8 ]
            int start;
9 @  \8 G. W1 U# I) c6 W( w! x            int end;
7 _1 n+ n% c! D+ W' A8 Q. m            if((start = streamReturn.indexOf("p=")) >= 0 && (end = streamReturn.indexOf(" ", start + 2)) >= 2)# @! C- Z% b, K# X
            {
2 {! I/ `$ o3 C6 s% m- \1 ^8 p                start += 2;% A" r2 P) c) J. E4 m0 G7 ]
                String strReadBatteryPercentage = streamReturn.substring(start, end);
* F" E# \+ c# d' u( h7 h# E2 R                try
% ^% z; s- A6 S3 v3 I0 d' ^- {                {. b7 n% W" y" d8 V! z& b6 M  V( ?, S0 G, R( V
                    int readBatteryPercentage = (new Integer(strReadBatteryPercentage)).intValue();
# @; \7 W1 z; G0 @, q" w6 [                    if(readBatteryPercentage > currentChargeLevel)
' \, y+ f6 s8 c2 W/ z3 t6 {                    {8 r) G0 ~( o2 D8 R/ _' D6 i9 z* w
                        currentChargeLevel = readBatteryPercentage;7 X9 z  Y6 l# D5 [* v/ z# M2 b
                        progress.updateJob(jobId, currentChargeLevel);, `- E0 T  S$ n/ E; s' r
                        progress.commentOnJob(jobId, (new StringBuilder()).append("battery percentage changed: ").append(currentChargeLevel).toString());
, _: ^. m# K" w5 s1 U: ]                    }4 U4 z: x. A+ q5 H( H9 C: T
                    Thread.sleep(500L);
- T# ]" m$ o. e0 O                }1 \' ]1 O  M7 i+ e# |9 v, S9 T# a% d
                catch(NumberFormatException e)
' C+ S, k( W) z                {1 P* K2 }6 Y- d2 \. z% f
                    progress.commentOnJob(jobId, (new StringBuilder()).append("+++++").append(streamReturn).append("-----").toString());1 p+ n- [" I: U7 e- i% T0 m
                }- E. g$ g, z5 w' x) E( l- `- m7 O
                catch(InterruptedException e) { }9 c" H3 g% m# f7 `
            } else
' [4 [% C3 j; c0 h5 e; C  ?            {
+ X* j) V8 Y5 A                progress.commentOnJob(jobId, (new StringBuilder()).append("+++++").append(streamReturn).append("-----").toString());/ X8 Y' f" u9 a- j4 d7 p& N" E( H
            }
  ^: \  A1 H8 b0 S! E- S8 J            stream.flush();
4 Q1 m# M8 B+ e6 r; r& L3 M        } while(true);" x/ [" ~# t( v6 j
        stream.close();- z* [! {+ X! ~0 K8 G
    }* ^; u2 V& t4 P# Q* ^3 H
" H1 I6 r4 X. l- T) G" D! b% G2 r& ^1 J
    public void run()
" E6 m, x9 n# o; B; S        throws NovacomException, IOException- y$ O# T2 f) W* |# z: S
    {
9 Y5 i2 T3 y( u  e7 [        progress = getProgressHandler();
/ R8 h0 l- H: f4 Y8 x" h        jobId = progress.startJob("Battery Charger Stage", 100);' f* r7 a' I) y
        if(device.getState() != com.palm.novacom.Novacom.DeviceState.BOOTLOADER). e, s; d! ^3 O: d
        {  u. O, J+ Q! n: b) Y/ _
            GoIntoUpdateModeStage intoUpdateMode = new GoIntoUpdateModeStage(device);; `+ d, v% d1 K' |" O
            intoUpdateMode.run();
8 B/ |- P+ M6 Q7 U! ^% e        }
0 }8 c0 R: E3 }) D! _( X+ V. I        BootieUtilities bootie = new BootieUtilities(device);. v, w! X3 c% O$ r' Z; d& ]4 _
        int currentPercentage = bootie.checkPowerStatus().intValue();  ~$ y7 C: V" o# x/ ?& V
        if(REQUIRED_POWER_PERCENTAGE.intValue() > currentPercentage)
+ b; t4 C$ u+ b! W, q& M        {
7 C) F3 \6 c: s, d/ |: O9 S            progress.commentOnJob(jobId, (new StringBuilder()).append("Battery at ").append(currentPercentage).append("%").toString());* Y4 A: e( G  w. Z' G
            int count = 0;, [$ g, g1 m. I: F/ |% o: ^2 o
            do/ C% |# s$ P$ r2 k' A
            {( Y" M; _7 a/ Q6 f8 W
                progress.commentOnJob(jobId, "Battery Charging Started");& q( F/ j! O$ c" }+ V. l
                progress.commentOnJob(jobId, (new StringBuilder()).append("Charging to Sufficient Power (").append(REQUIRED_POWER_PERCENTAGE).append("%), this may take a couple of minutes").toString());7 I& R& j2 N+ ?* z
                chargeBattery();
0 Z6 G5 u- K' v) `/ R3 N! A  P% {                if(++count > RECHARGE_RETRY_COUNT.intValue())' h+ `* W" S6 w" Z
                    throw new NovacomException(-1, "failed to charge batttery");/ h0 n% H% k9 c" B
            } while(REQUIRED_POWER_PERCENTAGE.intValue() > currentChargeLevel);# o7 k4 c. }. w- k5 w3 L" J* r
        }
3 o3 U' _- V; V5 Z' z        progress.endJob(jobId);
0 j2 c+ q: h6 z$ q% ~    }
9 K( S: l8 E- f: g6 j, _+ T/ J/ Q* [8 n2 G/ ~* d9 U6 m/ M
    private static final Integer REQUIRED_POWER_PERCENTAGE = Integer.valueOf(25);: f! V  A9 u3 y( B$ ^
    private static final Integer RECHARGE_RETRY_COUNT = Integer.valueOf(5);
! v9 o! f& o/ K' o1 F: y; Y    private final INovacomDevice device;
- E0 d2 g/ B9 J0 }- F4 a    private Object jobId;
2 ~6 W; i+ E' l0 w9 _4 }    private IStageProgressReporter progress;9 W" j% _9 m9 Q0 |
    private int currentChargeLevel;
; M& g% L% W5 a  Y$ J
) Q/ t9 D) m5 m; ^& A4 j8 r}$ y, ?* j# A- {4 `8 G/ D

2 U* Q3 f' L9 K. o
6 W% D; `7 T! y. a. s0 g7 x求编译~~~~~~~~~~~~~~~~~
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-7-13 00:42 | 显示全部楼层

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入我们

×
回复 支持 反对

使用道具 举报

发表于 2012-7-13 01:04 | 显示全部楼层
phil_rem 发表于 2012-7-13 00:42
; i7 ?+ \5 y; Z+ ^) f
如果目的是为了不让充电,那么把下面的代码注释掉就可以了。
  u: c/ n8 Y1 R- r6 B$ ]; I, B2 V# j3 g$ E+ g! a" w7 _
原来是这样:7 H: q$ H* {/ p1 p- i, E0 ^6 D
BootieUtilities bootie = new BootieUtilities(this.device);+ s3 q( b; h2 s9 z, l0 v/ f
    int currentPercentage = bootie.checkPowerStatus().intValue();& A- L! H1 h- e5 n
    if (REQUIRED_POWER_PERCENTAGE.intValue() > currentPercentage) {  r4 @% C0 m+ g0 U: ~
      this.progress.commentOnJob(this.jobId, "Battery at " + currentPercentage + "%");
8 B1 w9 e, |& g) t$ ?      int count = 0;
- M- k8 l8 U1 `. T0 G0 ^' e5 q      do {/ [5 C9 E' k! v. ]; a! n$ I
        this.progress.commentOnJob(this.jobId, "Battery Charging Started");3 g' a3 Q) I7 s9 A% K6 s
        this.progress.commentOnJob(this.jobId, "Charging to Sufficient Power (" + REQUIRED_POWER_PERCENTAGE + "%), this may take a couple of minutes");. F) P, c2 o) P0 h5 I7 e
        chargeBattery();
% u  f# ^+ F: ]
. ?1 L( ^3 Y0 |7 c        count++;0 Z' S: P! V9 T! M1 g( C) Q9 c( u1 W
        if (count > RECHARGE_RETRY_COUNT.intValue())6 V& R9 H+ U' n: A1 Z9 ]' s
          throw new NovacomException(-1, "failed to charge batttery");1 J; m- \' Z, x& R
      }
2 F0 W4 j* c% q' x: }/ I  D) {      while (REQUIRED_POWER_PERCENTAGE.intValue() > this.currentChargeLevel);7 p. z$ k9 C& z* o
    }  A# P6 h7 l% F+ M% A5 }, A  V! m
0 E4 C5 r* W( O4 B2 C7 X
    this.progress.endJob(this.jobId);1 M, H; @1 }% D; s8 ]! s9 R7 Z

9 a  `* l: }/ R- q+ d$ }注释掉变这样:
& W9 @  X6 L$ e* S1 Q BootieUtilities bootie = new BootieUtilities(this.device);0 i3 Z5 D  N' z) N( ]
    int currentPercentage = bootie.checkPowerStatus().intValue();
$ d/ Y- t. L% L" W& j" m6 T    /*if (REQUIRED_POWER_PERCENTAGE.intValue() > currentPercentage) {( }  b  K# A% _  ]
      this.progress.commentOnJob(this.jobId, "Battery at " + currentPercentage + "%");
3 W: e7 q0 j- Q6 ^' ^      int count = 0;
/ [, g1 G9 e- N' q      do {! E" W: e& l: ~' q
        this.progress.commentOnJob(this.jobId, "Battery Charging Started");* Z' p" R% b* V# P2 M
        this.progress.commentOnJob(this.jobId, "Charging to Sufficient Power (" + REQUIRED_POWER_PERCENTAGE + "%), this may take a couple of minutes");; n% \/ y% m' u( _$ g% n. B6 S% I9 g1 f
        chargeBattery();( B1 b* h4 a$ \

- D, f" y8 |/ M* L+ |& O+ g! n        count++;, o+ \8 F' f2 h3 x% _/ W
        if (count > RECHARGE_RETRY_COUNT.intValue())/ b. r+ R: }0 U: g% o
          throw new NovacomException(-1, "failed to charge batttery");
1 m, k% d% G- O. j0 p      }  q' D, `0 a5 b3 g1 d
      while (REQUIRED_POWER_PERCENTAGE.intValue() > this.currentChargeLevel);
$ u; N9 f: @, w8 k" a/ a, N    }*/! H* P# @+ E: c9 h7 [
: H( J) d# x# z' x
    this.progress.endJob(this.jobId);
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

QQ|Archiver|手机版|小黑屋|吹友吧 ( 京ICP备05078561号 )

GMT+8, 2025-2-23 01:24 , Processed in 0.316266 second(s), 16 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表