找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 1379|回复: 4

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

[复制链接]
发表于 2012-7-12 18:41 | 显示全部楼层 |阅读模式
本帖最后由 phil_rem 于 2012-7-13 00:48 编辑
" k. Y' n. y, L% T7 @
$ D) t5 E9 l' U# i2 t
, a3 P6 w7 |7 q- o; [( \/ T9 }8 A& L- P3 S* U( L$ p
满电的Veer刷机一路next,到最后一步,然后一直提示Battery Charging,有基友提示可能电池故障,
8 W4 T8 v- A  b6 _; z, }% W4 Y4 v: |7 Q, Q: \
找了台可以正常刷机的小v,拆了电池换上后问题依旧,
4 o, ]" f$ i7 [% S
& w- `  l: Q' o, k更杯具的是原来正常的小v刷机也这样了(手机可正常使用,只是无法刷机)
) V+ E+ h) O; C/ G6 ?- c) G) D% `2 t( S9 m4 J0 Q% a+ j1 z8 @/ r
用8%12%修复工具修复无效,
9 _6 L% V/ \6 Y. x5 s
4 d8 |. @2 I: a( h/ q目前两台机器均无法安装软件,商店也不知道为什么一直在转圈圈,想下个preware也没机会了。。。。
& v9 e$ M1 e/ |& q0 ~! |. Z6 y" c6 [8 E. p
之前好好的一台被我弄坏了,悲剧啊。  c$ i+ [+ E6 x

& S7 c7 m" }6 I9 q( N* ~- B现在各种抓狂~  " ?3 v4 M+ k) z7 @, t0 J& f5 \! j/ L
  S! Q) N  Z9 y2 A4 R1 F
跪求解决方案,小礼物送上~( @: h# r3 H! F( ^& r4 i  l

$ B3 d- Z$ R5 V. A# j

本帖子中包含更多资源

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

×
回复

使用道具 举报

 楼主| 发表于 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- c, S- m1 D' |5 O: |
// Home Page: http://members.fortunecity.com/neshkov/dj.html  http://www.neshkov.com/dj.html - Check often for new version!; f5 H# E* F1 M5 L8 a$ {
// Decompiler options: packimports(3) " v7 m/ T7 Q; T9 u+ ^
// Source File Name:   ChargeBatteryStage.java- r  S/ s$ ~& k* B2 I4 t- {

. R) e" G" ?) M8 l  |package com.palm.nova.installer.core.stages;  H  J7 K: ]" u
" T* n& ?+ e2 }/ {& P! x6 g/ _4 ?
import com.palm.nova.installer.core.*;
, u- G4 g2 M4 Dimport com.palm.novacom.*;
8 o  o9 `% ^& D. q" D( fimport java.io.IOException;
4 f) M7 j5 P! {) {! b; D3 v  Y! q$ [/ r5 V9 r# d
// Referenced classes of package com.palm.nova.installer.core.stages:
1 O4 C0 B$ e2 X4 v* N" u  I//            BaseStage, GoIntoUpdateModeStage
  N! \) s$ \" A& ^5 [4 S# g( |/ H: i: J
public class ChargeBatteryStage extends BaseStage. B' {; W5 g) l! ]8 `
    implements IInstallerStage
2 \4 w9 i. @, w8 G# j7 j4 c/ Q{- t. D8 w8 U/ L& Y% {: F
& s3 g5 y( _9 b4 g. w* x
    public ChargeBatteryStage(INovacomDevice device)
4 f* m$ f( i" W6 b    {* S) t( J" W% M8 C% F
        jobId = null;
, y8 j4 N5 T$ b7 H# c        progress = null;8 _: N6 @8 O  b" Y7 R: a
        currentChargeLevel = 0;
, f, e* a$ J1 m! \0 P        this.device = device;, [- ?- O8 D" z+ B) e% _
    }8 c% z" X+ {- z( I& N
/ Z  g9 M. T/ p8 m7 K; f3 a
    public String toString()( y/ f+ I: f4 u* p' J: r* V
    {4 L0 p1 \! }: v6 s- L8 H6 f9 q4 M* T
        return "Battery Charger";
7 [/ d4 ~4 k  f, p4 f    }
$ Q8 U% b" V7 s6 \3 N" n, h. d3 S8 @2 c9 h
    private void chargeBattery()0 f$ x1 Y% f; [* ^5 C/ x) Y3 k
        throws NovacomException, IOException7 k+ o' j8 _; c% H, Y
    {2 A" @1 T( a. b5 O
        INovacomStream stream = device.runProgram("", null);* W8 n1 u6 Q1 a- K
        String command = (new StringBuilder()).append("charging enable ").append(REQUIRED_POWER_PERCENTAGE).toString();5 A( o/ m$ {. A$ w$ N% Q6 j
        byte bytes[] = command.getBytes("US-ASCII");3 c" l: |: t9 K* W/ X  Z
        stream.write(bytes);
$ d2 |! F7 d/ u5 y8 o        stream.closeOutput();4 ~, E0 {9 e- Z
        String streamReturn = stream.readLine();
9 \) |8 O; B0 v7 N& B3 _6 p, ~        do
0 _; f1 V+ A+ _6 v        {
% `5 G; w. h! w; I) O            streamReturn = stream.readLine();' i3 P- I! T. \
            if(streamReturn == null)5 N8 }. x& h7 m; t. b" F( Y9 C
            {0 Q: w, {* ]% H! v9 w
                progress.commentOnJob(jobId, "stream interupted");
. r; K, ]4 J3 Q                throw new NovacomException(-1, "stream interupted");$ Z- v+ G, h5 K% U9 C
            }! u- n9 ~% r; U0 P
            if(streamReturn.length() == 0)" r! y: Z+ ?0 y9 M
            {
# W* Z# m2 F8 t" G+ q+ V" q. |                progress.commentOnJob(jobId, "power charged up");( a3 I- ?- I  E' ~, w
                break;
( n: T9 n8 W: Z: [  K! C            }
8 H2 ]3 u0 W& d6 @$ A            int start;
+ e8 R8 N2 o7 @. z3 R6 H            int end;
. L/ S* r& n" v- F# W% V            if((start = streamReturn.indexOf("p=")) >= 0 && (end = streamReturn.indexOf(" ", start + 2)) >= 2)$ \6 R# P3 Q! }+ S% z
            {$ H3 K& u/ r* V0 }; J- b
                start += 2;3 N# ~) J' I) w- m' G# A
                String strReadBatteryPercentage = streamReturn.substring(start, end);8 h1 P4 W* X' m( z
                try+ j+ m0 M/ G' J; w, |5 ~
                {9 a0 V" l1 ~3 j) P; b& E4 ~
                    int readBatteryPercentage = (new Integer(strReadBatteryPercentage)).intValue();
  [; E( X- x1 m$ e4 Y- U3 a: R                    if(readBatteryPercentage > currentChargeLevel); {+ `) H4 K, n5 O1 |7 A
                    {" [. Z5 `5 f% m/ h
                        currentChargeLevel = readBatteryPercentage;8 Z% o3 d: x% F% p
                        progress.updateJob(jobId, currentChargeLevel);
' S  a- [3 C; {3 b& V2 Q                        progress.commentOnJob(jobId, (new StringBuilder()).append("battery percentage changed: ").append(currentChargeLevel).toString());! X* D& P0 Z) B
                    }. Z, V/ ]: K# m7 N
                    Thread.sleep(500L);, z+ S* S* A. g' l0 `9 W' c2 k& P
                }
9 g7 X& D0 L! I" W1 K$ e7 d3 j                catch(NumberFormatException e)
7 Q# _, _2 D  x& _# ^4 b2 ]9 @                {
* \" y  P' u, u( |3 R                    progress.commentOnJob(jobId, (new StringBuilder()).append("+++++").append(streamReturn).append("-----").toString());
" L3 W6 [" R$ Q/ N  m! K- v2 |' S                }& Y% Q7 \0 A+ \
                catch(InterruptedException e) { }9 |3 K. M7 B5 Z3 \- Y
            } else# @" K" Z5 `, b4 @" p
            {
! z1 g- f3 o: I3 d$ o, S                progress.commentOnJob(jobId, (new StringBuilder()).append("+++++").append(streamReturn).append("-----").toString());
6 l' A1 f5 f7 m# G# u0 Q' q; E            }! p3 Q3 ^! Q' V( E( _4 [! x
            stream.flush();7 M/ k9 L  U( t
        } while(true);2 n( s% V: E3 L( c, d/ v
        stream.close();
7 g% }$ ]! S: s1 J3 S$ u    }3 _, r, V, Z6 o# k  R

8 C* {; O0 X  @( h    public void run()
+ m. V( \  l  G# `: V7 C! t+ b        throws NovacomException, IOException
" ]" ?! U: \8 I2 }: Y    {% G% b5 J2 x8 O$ O: d9 d& A8 `
        progress = getProgressHandler();" r0 `$ q% B; Q: V& d+ r  Q! s
        jobId = progress.startJob("Battery Charger Stage", 100);
% f  C: F9 W2 S        if(device.getState() != com.palm.novacom.Novacom.DeviceState.BOOTLOADER)7 V( q5 C; ^' d! C, t
        {% @6 D' a  @- [; R3 u+ v
            GoIntoUpdateModeStage intoUpdateMode = new GoIntoUpdateModeStage(device);7 f  U0 z" h! H4 T
            intoUpdateMode.run();/ F) ]9 `( E$ r) H8 R! G! ^
        }
# d8 d7 \1 b( x' Z# P, c1 h        BootieUtilities bootie = new BootieUtilities(device);
! r, z; f) s5 y, b. \$ m/ a        int currentPercentage = bootie.checkPowerStatus().intValue();
6 \4 J7 J  \2 @        if(REQUIRED_POWER_PERCENTAGE.intValue() > currentPercentage)
3 A- C8 I6 z/ W. f( p: H4 h6 Y9 {        {' b1 _+ y* [, p$ _: H
            progress.commentOnJob(jobId, (new StringBuilder()).append("Battery at ").append(currentPercentage).append("%").toString());! }6 r$ B, U- U1 l2 T; l5 K
            int count = 0;# }: a3 n9 O) ^, _# G6 e# I
            do7 \* h+ A6 M. _' {# Q! b7 D6 W
            {9 F2 X0 B$ @( P' m6 O
                progress.commentOnJob(jobId, "Battery Charging Started");+ O% D2 ~8 b9 T2 v8 e! b
                progress.commentOnJob(jobId, (new StringBuilder()).append("Charging to Sufficient Power (").append(REQUIRED_POWER_PERCENTAGE).append("%), this may take a couple of minutes").toString());
0 O- U: e. x% t$ D                chargeBattery();; ^% ?# j! ~7 i6 D' Z) {
                if(++count > RECHARGE_RETRY_COUNT.intValue())& j! X7 y3 W5 |* N
                    throw new NovacomException(-1, "failed to charge batttery");
& x$ _. o0 _. ]2 O4 n            } while(REQUIRED_POWER_PERCENTAGE.intValue() > currentChargeLevel);% T1 {! [. j6 y3 ~' e1 j
        }
( O; f( n. K% {( K        progress.endJob(jobId);
, l, e: C3 _7 o2 R" Q" u    }
$ z& Z1 M7 l0 |* [: h6 B$ ^  f2 n! s  k( a
    private static final Integer REQUIRED_POWER_PERCENTAGE = Integer.valueOf(25);
2 x1 m/ i2 _$ o: j4 ~# m    private static final Integer RECHARGE_RETRY_COUNT = Integer.valueOf(5);  |% @$ ?2 a* `3 [
    private final INovacomDevice device;
6 v+ ~3 S1 @5 s+ ^, N3 X    private Object jobId;8 A7 o2 `0 r4 E9 P
    private IStageProgressReporter progress;
& }! [, F3 E, G, N5 f9 S$ X    private int currentChargeLevel;
8 ~8 K/ l+ O: V
" w3 W& A% k6 {}
" H$ f5 \: D) E  F2 Y! b9 c
6 G; o/ ^5 s+ p. m1 f8 x7 a
$ K: i: C0 e0 I: P求编译~~~~~~~~~~~~~~~~~
回复 支持 反对

使用道具 举报

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

本帖子中包含更多资源

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

×
回复 支持 反对

使用道具 举报

发表于 2012-7-13 01:04 | 显示全部楼层
phil_rem 发表于 2012-7-13 00:42
+ I- R) o! t9 ?" L
如果目的是为了不让充电,那么把下面的代码注释掉就可以了。5 d' b& U) i  ^- r# G% j9 ?0 I: |! U
% _% ]- S/ t. G$ J- g
原来是这样:. b& F1 s- ^4 j: @6 g0 B  t
BootieUtilities bootie = new BootieUtilities(this.device);
1 V3 E$ P* A5 O5 B( n    int currentPercentage = bootie.checkPowerStatus().intValue();
! H+ R3 G+ \# H. Q: J    if (REQUIRED_POWER_PERCENTAGE.intValue() > currentPercentage) {
( q+ }* M7 X4 I. X8 F2 I      this.progress.commentOnJob(this.jobId, "Battery at " + currentPercentage + "%");
8 V* z" Q) I# Z0 U2 o" M      int count = 0;  p  V5 p" n/ X7 p5 K
      do {$ V$ w0 _2 D2 a! n
        this.progress.commentOnJob(this.jobId, "Battery Charging Started");
# s- l, o& z/ \4 [1 \2 n0 u) ~& X" T        this.progress.commentOnJob(this.jobId, "Charging to Sufficient Power (" + REQUIRED_POWER_PERCENTAGE + "%), this may take a couple of minutes");
. m4 ?1 k$ s* }* x5 Z5 g        chargeBattery();" U4 ?2 E3 s8 I9 x  N& H
( ], p3 k1 g& Y2 |6 J! q0 k
        count++;! j5 W) r3 Q& Q. B
        if (count > RECHARGE_RETRY_COUNT.intValue())
% G1 D6 m: l* j) r* w5 P          throw new NovacomException(-1, "failed to charge batttery");
  Z/ Q3 e/ p% X6 l; l7 s      }/ m) }8 W: G% ~) b( S
      while (REQUIRED_POWER_PERCENTAGE.intValue() > this.currentChargeLevel);% N; h2 I/ S5 G$ H) g
    }
; z: q" F, j. _1 d( Z  ~0 I$ o# Z* x: ^4 ~1 `" r! S/ R
    this.progress.endJob(this.jobId);5 c$ L% W; |) P

8 O2 ^2 n2 [% g) E注释掉变这样:! H4 O" b& ^- F- r: H
BootieUtilities bootie = new BootieUtilities(this.device);
& T0 d; N* Q8 A' {+ Z" O" }    int currentPercentage = bootie.checkPowerStatus().intValue();2 j% I; f) p6 }/ l8 h) D
    /*if (REQUIRED_POWER_PERCENTAGE.intValue() > currentPercentage) {, S+ t9 w; ^7 j( x8 z6 b; n
      this.progress.commentOnJob(this.jobId, "Battery at " + currentPercentage + "%");
; p1 }% B& B2 A      int count = 0;
  ?1 t+ g" E! m1 O: z      do {. z! J* C4 Y4 m$ T. d' a
        this.progress.commentOnJob(this.jobId, "Battery Charging Started");. z$ G7 [/ q3 Z! ^6 U, f; ~5 a$ C/ Z
        this.progress.commentOnJob(this.jobId, "Charging to Sufficient Power (" + REQUIRED_POWER_PERCENTAGE + "%), this may take a couple of minutes");
4 H# r% s5 Q: }9 j        chargeBattery();2 B! Z( a  [( O. z  @4 W

: B# z0 _9 G+ _- R3 }0 c4 C        count++;
0 w  n) y5 O4 E5 x( s- _. `        if (count > RECHARGE_RETRY_COUNT.intValue())$ n2 A& T7 e# c" u
          throw new NovacomException(-1, "failed to charge batttery");; d: o6 \# c1 C! C- U
      }8 a% k9 \9 y3 Q) Z; M& k
      while (REQUIRED_POWER_PERCENTAGE.intValue() > this.currentChargeLevel);
1 O4 `' \  U( n. S    }*/
, _: _2 ]% x4 X. I! Z8 W9 y) q/ P+ U' ^& j( E! M1 E6 U8 J5 l
    this.progress.endJob(this.jobId);
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-7 16:40 , Processed in 0.311517 second(s), 17 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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