2015. 3. 15. 07:38

Link : http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html


Dalvik opcodes

Author: Gabor Paller


Vx values in the table denote a Dalvik register. Depending on the instruction, 16, 256 or 64k registers can be accessed. Operations on long and double values use two registers, e.g. a double value addressed in the V0 register occupies the V0 and V1 registers.

Boolean values are stored as 1 for true and 0 for false. Operations on booleans are translated into integer operations.

All the examples are in hig-endian format, e.g. 0F00 0A00 is coded as
 0F, 00, 0A, 00 sequence.

Note there are no explanation/example at some instructions. This means that I have not seen that instruction "in the wild" and its presence/name is only known from Android opcode constant list.

Opcode (hex)
Opcode name
Explanation
Example
00
nop
No operation
0000 - nop 
01
move vx,vy
Moves the content of vy into vx. Both registers must be in the first 256 register range.
0110 - move v0, v1
Moves v1 into v0.
02
move/from16 vx,vy
Moves the content of vy into vx. vy may be in the 64k register range while vx is one of the first 256 registers.
0200 1900 - move/from16 v0, v25
Moves v25 into v0.
03
move/16


04
move-wide 


05
move-wide/from16 vx,vy
Moves a long/double value from vy to vx. vy may be in the 64k register range while wx is one of the first 256 registers.
0516 0000 - move-wide/from16 v22, v0
Moves v0 into v22.
06
move-wide/16


07
move-object vx,vy
Moves the object reference from vy to vx.
0781 - move-object v1, v8
Moves the object reference in v8 to v1.
08
move-object/from16 vx,vy
Moves the object reference from vy to vx, vy can address 64k registers and vx can address 256 registers.
0801 1500 - move-object/from16 v1, v21
Move the object reference in v21 to v1.
09
move-object/16


0A
move-result vx
Move the result value of the previous method invocation into vx.
0A00 - move-result v0
Move the return value of a previous method invocation into v0.
0B
move-result-wide vx
Move the long/double result value of the previous method invocation into vx,vx+1.
0B02 - move-result-wide v2
Move the long/double result value of the previous method invocation into v2,v3.
0C
move-result-object vx
Move the result object reference of the previous method invocation into vx.
0C00 - move-result-object v0
0D
move-exception vx
Move the exception object reference thrown during a method invocation into vx. 
0D19 - move-exception v25
0E
return-void
Return without a return value
0E00 - return-void
0F
return vx
Return with vx return value
0F00 - return v0
Returns with return value in v0.

10
return-wide vx
Return with double/long result in vx,vx+1.
1000 - return-wide v0
Returns with a double/long value in v0,v1.
11
return-object vx
Return with vx object reference value.
1100 - return-object v0
Returns with object reference value in v0
12
const/4 vx,lit4
Puts the 4 bit constant into vx
1221 - const/4 v1, #int2
Moves literal 2 into v1. The destination register is in the lower 4 bit in the second byte, the literal 2 is in the higher 4 bit.
13
const/16 vx,lit16
Puts the 16 bit constant into vx
1300 0A00 - const/16 v0, #int 10
Puts the literal constant of 10 into v0.
14
const vx, lit32
Puts the integer constant into vx
1400 4E61 BC00 - const v0, #12345678 // #00BC614E
Moves literal 12345678 into v0.
15
const/high16 v0, lit16
Puts the 16 bit constant into the topmost bits of the register. Used to initialize float values.
1500 2041 - const/high16 v0, #float 10.0 // #41200000
Moves the floating literal of 10.0 into v0. The 16 bit literal in the instruction carries the top 16 bits of the floating point number.
16
const-wide/16 vx, lit16
Puts the integer constant into vx and vx+1 registers, expanding the integer constant into a long constant..
1600 0A00 - const-wide/16 v0, #long 10
Moves literal 10 into v0 and v1 registers.
17
const-wide/32 vx, lit32
Puts the 32 bit constant into vx and vx+1 registers, expanding the integer constant into a long constant.
1702 4e61 bc00 - const-wide/32 v2, #long 12345678 // #00bc614e
Puts #12345678 into v2 and v3 registers.
18
const-wide vx, lit64
Puts the 64 bit constant into vx and vx+1 registers.
1802 874b 6b5d 54dc 2b00- const-wide v2, #long 12345678901234567 // #002bdc545d6b4b87
Puts #12345678901234567 into v2 and v3 registers.
19
const-wide/high16 vx,lit16
Puts the 16 bit constant into the highest 16 bit of vx and vx+1 registers. Used to initialize double values.
1900 2440 - const-wide/high16 v0, #double 10.0 // #402400000
Puts the double constant of 10.0 into v0 register.
1A
const-string vx,string_id
Puts reference to a string constant identified by string_id into vx.
1A08 0000 - const-string v8, "" // string@0000
Puts reference to string@0000 (entry #0 in the string table) into v8.
1B
const-string-jumbo


1C
const-class vx,type_id
Moves the class object of a class identified by type_id (e.g. Object.class) into vx.
1C00 0100 - const-class v0, Test3 // type@0001
Moves reference to Test3.class (entry#1 in the type id table) into 
1D
monitor-enter vx
Obtains the monitor of the object referenced by vx.
1D03 - monitor-enter v3
Obtains the monitor of the object referenced by v3.
1E
monitor-exit
Releases the monitor of the object referenced by vx.
1E03 - monitor-exit v3
Releases the monitor of the object referenced by v3.
1F
check-cast vx, type_id
Checks whether the object reference in vx can be cast to an instance of a class referenced by type_id. Throws ClassCastException if the cast is not possible, continues execution otherwise.
1F04 0100 - check-cast v4, Test3 // type@0001
Checks whether the object reference in v4 can be cast to type@0001 (entry #1 in the type id table)
20
instance-of vx,vy,type_id
Checks whether vy is instance of a class identified by type_id. Sets vx non-zero if it is, 0 otherwise.
2040 0100 - instance-of v0, v4, Test3 // type@0001
Checks whether the object reference in v4 is an instance of type@0001 (entry #1 in the type id table). Sets v0 to non-zero if v4 is instance of Test3, 0 otherwise.
21
array-length vx,vy
Calculates the number of elements of the array referenced by vy and puts the length value into vx.
2111 - array-length v1, v1
Calculates the number of elements of the array referenced by v1 and puts the result into v1.
22
new-instance vx,type
Instantiates an object type and puts the reference of the newly created instance into vx.
2200 1500 - new-instance v0, java.io.FileInputStream // type@0015
Instantiates type@0015 (entry #15H in the type table) and puts its reference into v0.
23
new-array vx,vy,type_id
Generates a new array of type_id type and vy element size and puts the reference to the array into vx.
2312 2500 - new-array v2, v1, char[] // type@0025
Generates a new array of type@0025 type and v1 size and puts the reference to the new array into v2.
24
filled-new-array {parameters},type_id
Generates a new array of type_id and fills it with the parameters5. Reference to the newly generated array can be obtained by a move-result-object instruction, immediately following the filled-new-array instruction.
2420 530D 0000 - filled-new-array {v0,v0},[I // type@0D53
Generates a new array of type@0D53. The array's size will be 2 and both elements will be filled with the contents of v0 register.
25
filled-new-array-range {vx..vy},type_id
Generates a new array of type_id and fills it with a range of parameters. Reference to the newly generated array can be obtained by a move-result-object instruction, immediately following the filled-new-array instruction.2503 0600 1300 - filled-new-array/range {v19..v21}, [B // type@0006
Generates a new array of type@0D53. The array's size will be 3 and the elements will be filled using the v19,v20 and v21 registers4.
26
fill-array-data vx,array_data_offset
Fills the array referenced by vx with the static data. The location of the static data is the sum of  the position of the current instruction and the offset
2606 2500 0000 - fill-array-data v6, 00e6 // +0025
Fills the array referenced by v0 with the static data at current instruction+25H words location. The offset is expressed as a 32-bit number. The static data is stored in the following format:
0003 // Table type: static array data
0400 // Byte per array element (in this case, 4 byte integers)
0300 0000 // Number of elements in the table
0100 0000  // Element #0: integer 1
0200 0000 // Element #1: integer 2
0300 0000 // Element #2: integer3
27
throw vx
Throws an exception object. The reference of the exception object is in vx.
2700 - throw v0
Throws an exception. The exception object reference is in v0.
28
goto target
Unconditional jump by short offset2
28F0 - goto 0005 // -0010
Jumps to current position-16 words (hex 10). 0005 is the label of the target instruction.
29
goto/16 target
Unconditional jump by 16 bit offset2.
2900 0FFE - goto/16 002f // -01f1
Jumps to the current position-1F1H words. 002F is the label of the target instruction.
2A
goto/32 target


2B
packed-switch vx,table
Implements a switch statement where the case constants are close to each other. The instruction uses an index table. vx indexes into this table to find the offset of the instruction for a particular case. If vx falls out of the index table, the execution continues on the next instruction (default case).
2B02 0C00 0000 - packed-switch v2, 000c // +000c
Execute a packed switch according to the switch argument in v2. The position of the index table is at current instruction+0CH words. The table looks like the following:
0001 // Table type: packed switch table
0300 // number of elements
0000 0000 // element base
0500 0000  0: 00000005 // case 0: +00000005
0700 0000  1: 00000007 // case 1: +00000007
0900 0000  2: 00000009 // case 2: +00000009
2C
sparse-switch vx,table
Implements a switch statement with sparse case table. The instruction uses a lookup table with case constants and offsets for each case constant. If there is no match in the table, execution continues on the next instruction (default case).
2C02 0c00 0000 - sparse-switch v2, 000c // +000c
Execute a sparse switch according to the switch argument in v2. The position of the lookup table is at current instruction+0CH words. The table looks like the following.
0002 // Table type: sparse switch table
0300 // number of elements
9cff ffff // first case: -100
fa00 0000 // second case constant: 250
e803 0000 // third case constant: 1000
0500 0000 // offset for the first case constant: +5
0700 0000 // offset for the second case constant: +7
0900 0000 // offset for the third case constant: +9
2D
cmpl-float
Compares the float values in vy and vz and sets the integer value in vx accordingly32D00 0607 - cmpl-float v0, v6, v7
Compares the float values in v6 and v7 then sets v0 accordingly. NaN bias is less-than, the instruction will return -1 if any of the parameters is NaN.
2E
cmpg-float vx, vy, vz
Compares the float values in vy and vz and sets the integer value in vx accordingly3.2E00 0607 - cmpg-float v0, v6, v7
Compares the float values in v6 and v7 then sets v0 accordingly. NaN bias is greater-than, the instruction will return 1 if any of the parameters is NaN.
2F
cmpl-double vx,vy,vz
Compares the double values in vy and vz2 and sets the integer value in vx accordingly3.2F19 0608 - cmpl-double v25, v6, v8
Compares the double values in v6,v7 and v8,v9 and sets v25 accordingly. NaN bias is less-than, the instruction will return -1 if any of the parameters is NaN.
30
cmpg-double vx, vy, vz
Compares the double values in vy and vz2 and sets the integer value in vx accordingly3.3000 080A - cmpg-double v0, v8, v10
Compares the double values in v8,v9 and v10,v11 then sets v0 accordingly. NaN bias is greater-than, the instruction will return 1 if any of the parameters is NaN.
31
cmp-long vx, vy, vz
Compares the long values in vy and vz and sets the integer value in vx accordingly3.
3100 0204 - cmp-long v0, v2, v4
Compares the long values in v2 and v4 then sets v0 accordingly.
32
if-eq vx,vy,target
Jumps to target if vx==vy2. vx and vy are integer values.
32b3 6600 - if-eq v3, v11, 0080 // +0066
Jumps to the current position+66H words if v3==v11. 0080 is the label of the target instruction.
33
if-ne vx,vy,target
Jumps to target if vx!=vy2. vx and vy are integer values.33A3 1000 - if-ne v3, v10, 002c // +0010
Jumps to the current position+10H words if v3!=v10. 002c is the label of the target instruction.
34
if-lt vx,vy,target
Jumps to target is vx<vy2. vx and vy are integer values.
3432 CBFF - if-lt v2, v3, 0023 // -0035
Jumps to the current position-35H words if v2<v3. 0023 is the label of the target instruction.
35
if-ge vx, vy,target
Jumps to target if vx>=vy2. vx and vy are integer values.
3510 1B00 - if-ge v0, v1, 002b // +001b
Jumps to the current position+1BH words if v0>=v1. 002b is the label of the target instruction.
36
if-gt vx,vy,target
Jumps to target if vx>vy2. vx and vy are integer values.3610 1B00 - if-ge v0, v1, 002b // +001b
Jumps to the current position+1BH words if v0>v1. 002b is the label of the target instruction.
37
if-le vx,vy,target
Jumps to target if vx<=vy2. vx and vy are integer values.3756 0B00 - if-le v6, v5, 0144 // +000b
Jumps to the current position+0BH words if v6<=v5. 0144 is the label of the target instruction.
38
if-eqz vx,target
Jumps to target if vx==02. vx is an integer value.
3802 1900 - if-eqz v2, 0038 // +0019
Jumps to the current position+19H words if v2==0. 0038 is the label of the target instruction.
39
if-nez vx,target
Checks vx and jumps if vx is nonzero2
3902 1200 - if-nez v2, 0014 // +0012
Jumps to current position+18 words (hex 12) if v2 is nonzero. 0014 is the label of the target instruction.
3A
if-ltz vx,target
Checks vx and jumps if vx<02.3A00 1600 - if-ltz v0, 002d // +0016
Jumps to the current position+16H words if v0<0. 002d is the label of the target instruction.
3B
if-gez vx,target
Checks vx and jumps if vx>=02.
3B00 1600 - if-gez v0, 002d // +0016
Jumps to the current position+16H words if v0 >=0. 002d is the label of the target instruction.
3C
if-gtz vx,target
Checks vx and jumps if vx>02.3C00 1D00 - if-gtz v0, 004a // +001d
Jumps to the current position+1DH words if v0>0. 004A is the label of the target instruction.
3D
if-lez vx,target
Checks vx and jumps if vx<=02.3D00 1D00 - if-lez v0, 004a // +001d
Jumps to the current position+1DH words if v0<=0. 004A is the label of the target instruction.
3E
unused_3E


3F
unused_3F


40
unused_40


41
unused_41


42
unused_42


43
unused_43


44
aget vx,vy,vz
Gets an integer value of an object reference array into vx. The array is referenced by vy and is indexed by vz.4407 0306 - aget v7, v3, v6
Gets an integer array element. The array is referenced by v3 and the element is indexed by v6. The element will be put into v7.
45
aget-wide vx,vy,vz
Gets a long/double value of long/double array into vx,vx+1. The array is referenced by vy and is indexed by vz.4505 0104 - aget-wide v5, v1, v4
Gets a long/double array element. The array is referenced by v1 and the element is indexed by v4. The element will be put into v5,v6.
46
aget-object vx,vy,vz
Gets an object reference value of an object reference array into vx. The array is referenced by vy and is indexed by vz.
4602 0200 - aget-object v2, v2, v0
Gets an object reference array element. The array is referenced by v2 and the element is indexed by v0. The element will be put into v2.
47
aget-boolean vx,vy,vz
Gets a boolean value of a boolean array into vx. The array is referenced by vy and is indexed by vz.4700 0001 - aget-boolean v0, v0, v1 
Gets a boolean array element. The array is referenced by v0 and the element is indexed by v1. The element will be put into v0.
48
aget-byte vx,vy,vz
Gets a byte value of a byte array into vx. The array is referenced by vy and is indexed by vz.4800 0001 - aget-byte v0, v0, v1
Gets a byte array element. The array is referenced by v0 and the element is indexed by v1. The element will be put into v0.
49
aget-char vx, vy,vz
Gets a char value  of a character array into vx. The element is indexed by vz, the array object is referenced by vy4905 0003 - aget-char v5, v0, v3
Gets a character array element. The array is referenced by v0 and the element is indexed by v3. The element will be put into v5.
4A
aget-short vx,vy,vz
Gets a short value  of a short array into vx. The element is indexed by vz, the array object is referenced by vy.4A00 0001 - aget-short v0, v0, v1
Gets a short array element. The array is referenced by v0 and the element is indexed by v1. The element will be put into v0.
4B
aput vx,vy,vz
Puts the integer value in vx into an element of an integer array. The element is indexed by vz, the array object is referenced by vy.4B00 0305 - aput v0, v3, v5
Puts the integer value in v2 into an integer array referenced by v0. The target array element is indexed by v1.
4C
aput-wide vx,vy,vz
Puts the double/long value in vx,vx+1 into a double/long array. The array is referenced by vy, the element is indexed by vz.
4C05 0104 - aput-wide v5, v1, v4
Puts the double/long value in v5,v6 into a double/long array referenced by v1. The target array element is indexed by v4.
4D
aput-object vx,vy,vz
Puts the object reference value in vx into an element of an object reference array. The element is indexed by vz, the array object is referenced by vy.4D02 0100 - aput-object v2, v1, v0
Puts the object reference value in v2 into an object reference array referenced by v0. The target array element is indexed by v1.
4E
aput-boolean vx,vy,vz
Puts the boolean value in vx into an element of a boolean array. The element is indexed by vz, the array object is referenced by vy.4E01 0002 - aput-boolean v1, v0, v2
Puts the boolean value in v1 into an object reference array referenced by v0. The target array element is indexed by v2.
4F
aput-byte vx,vy,vz
Puts the byte value in vx into an element of a byte array. The element is indexed by vz, the array object is referenced by vy.4F02 0001 - aput-byte v2, v0, v1
Puts the boolean value in v2 into a byte array referenced by v0. The target array element is indexed by v1.
50
aput-char vx,vy,vz
Puts the char value in vx into an element of a character array. The element is indexed by vz, the array object is referenced by vy.5003 0001 - aput-char v3, v0, v1
Puts the character value in v3 into a character array referenced by v0. The target array element is indexed by v1.
51
aput-short vx,vy,vz
Puts the short value in vx into an element of a short array. The element is indexed by vz, the array object is referenced by vy.5102 0001 - aput-short v2, v0, v1
Puts the short value in v2 into a character array referenced by v0. The target array element is indexed by v1.
52
iget vx, vy, field_id
Reads an instance field into vx. The instance is referenced by vy.
5210 0300 - iget v0, v1, Test2.i6:I // field@0003
Reads field@0003 into v0 (entry #3 in the field id table). The instance is referenced by v1.
53
iget-wide vx,vy,field_id
Reads an instance field into vx1. The instance is referenced by vy.
5320 0400 - iget-wide v0, v2, Test2.l0:J // field@0004
Reads field@0004 into v0 and v1 registers (entry #4 in the field id table). The instance is referenced by v2.
54
iget-object vx,vy,field_id
Reads an object reference instance field into vx. The instance is referenced by vy.
iget-object v1, v2, LineReader.fis:Ljava/io/FileInputStream; // field@0002
Reads field@0002 into v1  (entry #2 in the field id table). The instance is referenced by v2.
55
iget-boolean vx,vy,field_id
Reads a boolean instance field into vx. The instance is referenced by vy.
55FC 0000 - iget-boolean v12, v15, Test2.b0:Z // field@0000
Reads the boolean field@0000 into v12 register (entry #0 in the field id table). The instance is referenced by v15.
56
iget-byte vx,vy,field_id
Reads a byte instance field into vx. The instance is referenced by vy.5632 0100 - iget-byte v2, v3, Test3.bi1:B // field@0001
Reads the char field@0001 into v2 register (entry #1 in the field id table). The instance is referenced by v3.
57
iget-char vx,vy,field_id
Reads a char instance field into vx. The instance is referenced by vy.5720 0300 - iget-char v0, v2, Test3.ci1:C // field@0003
Reads the char field@0003 into v0 register (entry #3 in the field id table). The instance is referenced by v2.
58
iget-short vx,vy,field_id
Reads a short instance field into vx. The instance is referenced by vy.5830 0800 - iget-short v0, v3, Test3.si1:S // field@0008
Reads the short field@0008 into v0 register (entry #8 in the field id table). The instance is referenced by v3.
59
iput vx,vy, field_id
Puts vx into an instance field. The instance is referenced by vy.
5920 0200 - iput v0,v2, Test2.i6:I // field@0002
Stores v0 into field@0002 (entry #2 in the field id table). The instance is referenced by v2.
5A
iput-wide vx,vy, field_id
Puts the wide value located in vx and vx+1 registers into an instance field. The instance is referenced by vy.
5A20 0000 - iput-wide v0,v2, Test2.d0:D // field@0000 
Stores the wide value in v0, v1 registers into field@0000 (entry #0 in the field id table). The instance is referenced by v2.
5B
iput-object vx,vy,field_id
Puts the object reference in vx into an instance field. The instance is referenced by vy.
5B20 0000 - iput-object v0, v2, LineReader.bis:Ljava/io/BufferedInputStream; // field@0000
Stores the object reference in v0 into field@0000 (entry #0 in the field table). The instance is referenced by v2.
5C
iput-boolean vx,vy, field_id
Puts the boolean value located in vx into an instance field. The instance is referenced by vy.
5C30 0000 - iput-boolean v0, v3, Test2.b0:Z // field@0000
Puts the boolean value in v0 into field@0000 (entry #0 in the field id table). The instance is referenced by v3.
5D
iput-byte vx,vy,field_id
Puts the byte value located in vx into an instance field. The instance is referenced by vy.5D20 0100 - iput-byte v0, v2, Test3.bi1:B // field@0001
Puts the boolean value in v0 into field@0001 (entry #1 in the field id table). The instance is referenced by v2.
5E
iput-char vx,vy,field_id
Puts the char value located in vx into an instance field. The instance is referenced by vy.5E20 0300 - iput-char v0, v2, Test3.ci1:C // field@0003
Puts the char value in v0 into field@0003 (entry #3 in the field id table). The instance is referenced by v2.
5F
iput-short vx,vy,field_id
Puts the short value located in vx into an instance field. The instance is referenced by vy.5F21 0800 - iput-short v1, v2, Test3.si1:S // field@0008
Puts the short value in v1 into field@0008 (entry #8 in the field id table). The instance is referenced by v2.
60
sget vx,field_id
Reads the integer field identified by the field_id into vx.6000 0700 - sget v0, Test3.is1:I // field@0007
Reads field@0007 (entry #7 in the field id table) into v0.
61
sget-wide vx, field_id
Reads the static field identified by the field_id into vx and vx+1 registers.
6100 0500 - sget-wide v0, Test2.l1:J // field@0005
Reads field@0005 (entry #5 in the field id table) into v0 and v1 registers.
62
sget-object vx,field_id
Reads the object reference field identified by the field_id into vx.6201 0C00 - sget-object v1, Test3.os1:Ljava/lang/Object; // field@000c
Reads field@000c (entry #CH in the field id table) into v1.
63
sget-boolean vx,field_id
Reads the boolean static field identified by the field_id into vx.6300 0C00 - sget-boolean v0, Test2.sb:Z // field@000c
Reads boolean field@000c (entry #12 in the field id table) into v0.
64
sget-byte vx,field_id
Reads the byte static field identified by the field_id into vx.6400 0200 - sget-byte v0, Test3.bs1:B // field@0002
Reads byte field@0002 (entry #2 in the field id table) into v0.
65
sget-char vx,field_id
Reads the char static field identified by the field_id into vx.6500 0700 - sget-char v0, Test3.cs1:C // field@0007
Reads byte field@0007 (entry #7 in the field id table) into v0.
66
sget-short vx,field_id
Reads the short static field identified by the field_id into vx.6600 0B00 - sget-short v0, Test3.ss1:S // field@000b
Reads short field@000b (entry #BH in the field id table) into v0.
67
sput vx, field_id
Puts vx into a static field.
6700 0100 - sput v0, Test2.i5:I // field@0001
Stores v0 into field@0001 (entry #1 in the field id table).
68
sput-wide vx, field_id
Puts vx and vx+1 into a static field.
6800 0500 - sput-wide v0, Test2.l1:J // field@0005
Puts the long value in v0 and v1 into the field@0005 static field (entry #5 in the field id table).
69
sput-object vx,field_id
Puts object reference in vx into a static field.6900 0c00 - sput-object v0, Test3.os1:Ljava/lang/Object; // field@000c
Puts the object reference value in v0 into the field@000c static field (entry #CH in the field id table).
6A
sput-boolean vx,field_id
Puts boolean value in vx into a static field.6A00 0300 - sput-boolean v0, Test3.bls1:Z // field@0003
Puts the byte value in v0 into the field@0003 static field (entry #3 in the field id table).
6B
sput-byte vx,field_id
Puts byte value in vx into a static field.6B00 0200 - sput-byte v0, Test3.bs1:B // field@0002
Puts the byte value in v0 into the field@0002 static field (entry #2 in the field id table).
6C
sput-char vx,field_id
Puts char value in vx into a static field.6C01 0700 - sput-char v1, Test3.cs1:C // field@0007
Puts the char value in v1 into the field@0007 static field (entry #7 in the field id table).
6D
sput-short vx,field_id
Puts short value in vx into a static field.6D00 0B00 - sput-short v0, Test3.ss1:S // field@000b
Puts the short value in v0 into the field@000b static field (entry #BH in the field id table).
6E
invoke-virtual { parameters }, methodtocall
Invokes a virtual method with parameters.
6E53 0600 0421 - invoke-virtual { v4, v0, v1, v2, v3}, Test2.method5:(IIII)V // method@0006
Invokes the 6th method in the method table with the following arguments: v4 is the "this" instance, v0, v1, v2, and v3 are the method parameters. The method has 5 arguments (4 MSB bits of the second byte)5.
6F
invoke-super {parameter},methodtocall
Invokes the virtual method of the immediate parent class.6F10 A601 0100 invoke-super {v1},java.io.FilterOutputStream.close:()V // method@01a6
Invokes method@01a6 with one parameter, v1.
70
invoke-direct { parameters }, methodtocall
Invokes a method with parameters without the virtual method resolution.
7010 0800 0100 - invoke-direct {v1}, java.lang.Object.<init>:()V // method@0008
Invokes the 8th method in the method table with just one parameter, v1 is the "this" instance5.
71
invoke-static {parameters}, methodtocall
Invokes a static method with parameters.
7110 3400 0400 - invoke-static {v4}, java.lang.Integer.parseInt:( Ljava/lang/String;)I // method@0034
Invokes method@34 static method. The method is called with one parameter, v45.
72
invoke-interface {parameters},methodtocall
Invokes an interface method.
7240 2102 3154 invoke-interface {v1, v3, v4, v5}, mwfw.IReceivingProtocolAdapter.receivePackage:(
ILjava/lang/String;Ljava/io/InputStream;)Z // method@0221
Invokes method@221 interface method using parameters in v1,v3,v4 and v55.
73
unused_73


74
invoke-virtual/range {vx..vy},methodtocall
Invokes virtual method with a range of registers. The instruction specifies the first register and the number of registers to be passed to the method.7403 0600 1300 - invoke-virtual {v19..v21}, Test2.method5:(IIII)V // method@0006
Invokes the 6th method in the method table with the following arguments: v19 is the "this" instance, v20 and v21 are the method parameters. 
75
invoke-super/range
Invokes  the virtual method of the immediate parent class. The instruction specifies the first register and the number of registers to be passed to the method.7501 A601 0100 invoke-super {v1},java.io.FilterOutputStream.close:()V // method@01a6
Invokes method@01a6 with one parameter, v1.
76
invoke-direct/range {vx..vy},methodtocall
Invokes direct method with a range of registers. The instruction specifies the first register and the number of registers to be passed to the method.
7603 3A00 1300 - invoke-direct/range {v19..21},java.lang.Object.<init>:()V // method@003a
Invokes method@3A with 1 parameters (second byte of the instruction=03). The parameter is stored in v19 (5th,6th bytes of the instruction).
77
invoke-static/range {vx..vy},methodtocall
Invokes static method with a range of registers. The instruction specifies the first register and the number of registers to be passed to the method.7703 3A00 1300 - invoke-static/range {v19..21},java.lang.Integer.parseInt:( Ljava/lang/String;)I // method@0034
Invokes method@3A with 1 parameters (second byte of the instruction=03). The parameter is stored in v19 (5th,6th bytes of the instruction).
78
invoke-interface-range
Invokes an interface method with a range of registers. The instruction specifies the first register and the number of registers to be passed to the method.7840 2102 0100 invoke-interface {v1..v4}, mwfw.IReceivingProtocolAdapter.receivePackage:(
ILjava/lang/String;Ljava/io/InputStream;)Z // method@0221
Invokes method@221 interface method using parameters in v1..v4.
79
unused_79


7A
unused_7A


7B
neg-int vx,vy
Calculates vx=-vy.
7B01 - neg-int v1,v0
Calculates -v0 and stores the result in v1.
7C
not-int vx,vy


7D
neg-long vx,vy
Calculates vx,vx+1=-(vy,vy+1) 
7D02 - neg-long v2,v0
Calculates -(v0,v1) and stores the result into (v2,v3)
7E
not-long vx,vy


7F
neg-float vx,vy
Calculates vx=-vy
7F01 - neg-float v1,v0
Calculates -v0 and stores the result into v1.
80
neg-double vx,vy
Calculates vx,vx+1=-(vy,vy+1)8002 - neg-double v2,v0
Calculates -(v0,v1) and stores the result into (v2,v3)
81
int-to-long vx, vy
Converts the integer in vy into a long in vx,vx+1.
8106 - int-to-long v6, v0
Converts an integer in v0 into a long in v6,v7.
82
int-to-float vx, vy
Converts the integer in vx into a float in vx.
8206 - int-to-float v6, v0
Converts the integer in v0 into a float in v6.
83
int-to-double vx, vy
Converts the integer in vy into the double in vx,vx+1.
8306 - int-to-double v6, v0
Converts the integer in v0 into a double in v6,v7
84
long-to-int vx,vy
Converts the long value in vy,vy+1 into an integer in vx.
8424 - long-to-int v4, v2
Converts the long value in v2,v3 into an integer value in v4.
85
long-to-float vx, vy
Converts the long value in vy,vy+1 into a float in vx.
8510 - long-to-float v0, v1
Convcerts the long value in v1,v2 into a float value in v0.
86
long-to-double vx, vy
Converts the long value in vy,vy+1 into a double value in vx,vx+1.
8610 - long-to-double v0, v1
Converts the long value in v1,v2 into a double value in v0,v1.
87
float-to-int vx, vy
Converts the float value in vy into an integer value in vx.
8730 - float-to-int v0, v3
Converts the float value in v3 into an integer value in v0.
88
float-to-long vx,vy
Converts the float value in vy into a long value in vx.
8830 - float-to-long v0, v3
Converts the float value in v3 into a long value in v0,v1.
89
float-to-double vx, vy
Converts the float value in vy into a double value in vx,vx+1.
8930 - float-to-double v0, v3
Converts the float value in v3 into a double value in v0,v1.
8A
double-to-int vx, vy
Converts the double value in vy,vy+1 into an integer value in vx.
8A40  - double-to-int v0, v4
Converts the double value in v4,v5 into an integer value in v0.
8B
double-to-long vx, vy
Converts the double value in vy,vy+1 into a long value in vx,vx+1.
8B40 - double-to-long v0, v4
Converts the double value in v4,v5 into a long value in v0,v1.
8C
double-to-float vx, vy
Converts the double value in vy,vy+1 into a float value in vx.
8C40 - double-to-float v0, v4
Converts the double value in v4,v5 into a float value in v0,v1.
8D
int-to-byte vx,vy
Converts the int value in vy to a byte value and stores it in vx.
8D00 - int-to-byte v0, v0
Converts the integer in v0 into a byte and puts the byte value into v0.
8E
int-to-char vx,vy
Converts the int value in vy to a char value and stores it in vx.
8E33  - int-to-char v3, v3
Converts the integer in v3 into a char and puts the char value into v3.
8F
int-to-short vx,vy
Converts the int value in vy to a short value and stores it in vx.8F00 - int-to-short v0, v0
Converts the integer in v0 into a short and puts the short value into v3.
90
add-int vx,vy,vzCalculates vy+vz and puts the result into vx.9000 0203 - add-int v0, v2, v3
Adds v3 to v2 and puts the result into v04.
91
sub-int vx,vy,vz
Calculates vy-vz and puts the result into vx.
9100 0203 - sub-int v0, v2, v3
Subtracts v3 from v2 and puts the result into v0.
92
mul-int vx, vy, vz
Multiplies vz with wy and puts the result int vx.
9200 0203 - mul-int v0,v2,v3
Multiplies v2 with w3 and puts the result into v0
93
div-int vx,vy,vz
Divides vy with vz and puts the result into vx.
9303 0001 - div-int v3, v0, v1
Divides v0 with v1 and puts the result into v3.
94
rem-int vx,vy,vz
Calculates vy % vz and puts the result into vx.9400 0203 - rem-int v0, v2, v3
Calculates v3 % v2 and puts the result into v0.
95
and-int vx, vy, vz
Calculates vy AND vz and puts the result into vx.
9503 0001 - and-int v3, v0, v1
Calculates v0 AND v1 and puts the result into v3.
96
or-int vx, vy, vz
Calculates vy OR vz and puts the result into vx.
9603 0001 - or-int v3, v0, v1
Calculates v0 OR v1 and puts the result into v3.
97
xor-int vx, vy, vz
Calculates vy XOR vz and puts the result into vx.9703 0001 - xor-int v3, v0, v1
Calculates v0 XOR v1 and puts the result into v3.
98
shl-int vx, vy, vz
Shift vy left by the positions specified by vz and store the result into vx.9802 0001 - shl-int v2, v0, v1
Shift v0 left by the positions specified by v1 and store the result in v2.
99
shr-int vx, vy, vz
Shift vy right by the positions specified by vz and store the result into vx.
9902 0001 - shr-int v2, v0, v1
Shift v0 right by the positions specified by v1 and store the result in v2.
9A
ushr-int vx, vy, vz
Unsigned shift right (>>>) vy by the positions specified by vz and store the result into vx.
9A02 0001 - ushr-int v2, v0, v1
Unsigned shift v0 right by the positions specified by v1 and store the result in v2.
9B
add-long vx, vy, vz
Adds vy to vz and puts the result into vx1.
9B00 0305 - add-long v0, v3, v5
The long value in v3,v4 is added to the value in v5,v6 and the result is stored in v0,v1.
9C
sub-long vx,vy,vz
Calculates vy-vz and puts the result into vx1.
9C00 0305 - sub-long v0, v3, v5
Subtracts the long value in v5,v6 from the long value in v3,v4 and puts the result into v0,v1.
9D
mul-long vx,vy,vz
Calculates vy*vz and puts the result into vx1.9D00 0305 - mul-long v0, v3, v5
Multiplies the long value in v5,v6 with the long value in v3,v4 and puts the result into v0,v1.
9E
div-long vx, vy, vz
Calculates vy/vz and puts the result into vx1.
9E06 0002 - div-long v6, v0, v2
Divides the long value in v0,v1 with the long value in v2,v3 and pust the result into v6,v7.
9F
rem-long vx,vy,vz
Calculates vy % vz and puts the result into vx1.9F06 0002 - rem-long v6, v0, v2
Calculates v0,v1 %  v2,v3 and puts the result into v6,v7.
A0
and-long vx, vy, vz
Calculates the vy AND vz and puts the result into vx1.A006 0002 - and-long v6, v0, v2
Calculates v0,v1 AND v2,v3 and puts the result into v6,v7.
A1
or-long vx, vy, vz
Calculates the vy OR vz and puts the result into vx1.
A106 0002 - or-long v6, v0, v2
Calculates v0,v1 OR v2,v3 and puts the result into v6,v7.
A2
xor-long vx, vy, vz
Calculates the vy XOR vz and puts the result into vx1.A206 0002 - xor-long v6, v0, v2
Calculates v0,v1 XOR v2,v3 and puts the result into v6,v7.
A3
shl-long vx, vy, vz
Shifts left vy by vz positions and stores the result in vx1.A302 0004 - shl-long v2, v0, v4
Shift v0,v1 by postions specified by v4 and puts the result into v2,v3.
A4
shr-long vx,vy,vz
Shifts right vy by vz positions and stores the result in vx1.
A402 0004 - shr-long v2, v0, v4
Shift v0,v1 by postions specified by v4 and puts the result into v2,v3.
A5
ushr-long vx, vy, vz
Unsigned shifts right vy by vz positions and stores the result in vx1.A502 0004 - ushr-long v2, v0, v4
Unsigned shift v0,v1 by postions specified by v4 and puts the result into v2,v3.
A6
add-float vx,vy,vz
Adds vy to vz and puts the result into vx.
A600 0203 - add-float v0, v2, v3
Adds the floating point numbers in v2 and v3 and puts the result into v0.
A7
sub-float vx,vy,vz
Calculates vy-vz and puts the result into vx.A700 0203 - sub-float v0, v2, v3
Calculates v2-v3 and puts the result into v0.
A8
mul-float vx, vy, vz
Multiplies vy with vz and puts the result into vx.
A803 0001 - mul-float v3, v0, v1
Multiplies v0 with v1 and puts the result into v3.
A9
div-float vx, vy, vz
Calculates vy/vz and puts the result into vx.
A903 0001 - div-float v3, v0, v1
Divides v0 with v1 and puts the result into v3.
AA
rem-float vx,vy,vz
Calculates vy % vz and puts the result into vx.AA03 0001 - rem-float v3, v0, v1
Calculates v0 %  v1 and puts the result into v3.
AB
add-double vx,vy,vz
Adds vy to vz and puts the result into vx1
AB00 0305 - add-double v0, v3, v5
Adds the double value in v5,v6 registers to the double value in v3,v4 registers and places the result  in v0,v1 registers.
AC
sub-double vx,vy,vz
Calculates vy-vz and puts the result into vx1.
AC00 0305 - sub-double v0, v3, v5
Subtracts the value in v5,v6 from the value in v3,v4 and puts the result into v0,v1.
AD
mul-double vx, vy, vz
Multiplies vy with vz and puts the result into vx1.
AD06 0002 - mul-double v6, v0, v2
Multiplies the double value in v0,v1 with the double value in v2,v3 and puts the result into v6,v7.
AE
div-double vx, vy, vz
Calculates vy/vz and puts the result into vx1.
AE06 0002 - div-double v6, v0, v2
Divides the double value in v0,v1 with the double value in v2,v3 and puts the result into v6,v7.
AF
rem-double vx,vy,vz
Calculates vy % vz and puts the result into vx1.AF06 0002 - rem-double v6, v0, v2
Calculates v0,v1 % v2,v3 and puts the result into v6,v7.
B0
add-int/2addr vx,vy
Adds vy to vx.
B010 - add-int/2addr v0,v1
Adds v1 to v0.
B1
sub-int/2addr vx,vy
Calculates vx-vy and puts the result into vx.
B140 - sub-int/2addr v0, v4
Subtracts v4 from v0 and puts the result into v0.
B2
mul-int/2addr vx,vy
Multiplies vx with vy.
B210 - mul-int/2addr v0, v1
Multiples v0 with v1 and puts the result into v0.
B3
div-int/2addr vx,vy
Divides vx with vy and puts the result into vx.
B310 - div-int/2addr v0, v1
Divides v0 with v1 and puts the result into v0.
B4
rem-int/2addr vx,vy
Calculates vx % vy and puts the result into vxB410 - rem-int/2addr v0, v1
 Calculates v0 % v1 and puts the result into v0.
B5
and-int/2addr vx, vy
Calculates vx AND vy and puts the result into vx.
B510 - and-int/2addr v0, v1
Calculates v0 AND v1 and puts the result into v0.
B6
or-int/2addr vx, vy
Calculates vx OR vy and puts the result into vx.
B610 - or-int/2addr v0, v1
Calculates v0 OR v1 and puts the result into v0.
B7
xor-int/2addr vx, vy
Calculates vx XOR vy and puts the result into vx.B710  - xor-int/2addr v0, v1
Calculates v0 XOR v1 and puts the result into v0.
B8
shl-int/2addr vx, vy
Shifts vx left by vy positions.
B810 - shl-int/2addr v0, v1
Shift v0 left by v1 positions.
B9
shr-int/2addr vx, vy
Shifts vx right by vy positions.
B910 - shr-int/2addr v0, v1
Shift v0 right by v1 positions.
BA
ushr-int/2addr vx, vy
Unsigned shift right (>>>) vx by the positions specified by vy.
BA10 - ushr-int/2addr v0, v1
Unsigned shift v0 by the positions specified by v1.
BB
add-long/2addr vx,vy
Adds vy to vx1.
BB20 - add-long/2addr v0, v2
Adds the long value in v2,v3 registers to the long value in v0,v1 registers.
BC
sub-long/2addr vx,vy
Calculates vx-vy and puts the result into vx1.
BC70 - sub-long/2addr v0, v7
Subtracts the long value in v7,v8 from the long value in v0,v1 and puts the result into v0,v1.
BD
mul-long/2addr vx,vy
Calculates vx*vy and puts the result into vx1.BD70 - mul-long/2addr v0, v7
Multiplies the long value in v7,v8 with the long value in v0,v1 and puts the result into v0,v1.
BE
div-long/2addr vx, vy
Calculates vx/vy and puts the result into vx1.
BE20 - div-long/2addr v0, v2
Divides the long value in v0,v1 with the long value in v2,v3 and puts the result into v0,v1
BF
rem-long/2addr vx,vy
Calculates vx % vy and puts the result into vx1.BF20 - rem-long/2addr v0, v2
Calculates v0,v1 % v2,v3 and puts the result into v0,v1
C0
and-long/2addr vx, vy
Calculates vx AND vy and puts the result into vx1.C020 - and-long/2addr v0, v2
Calculates v0,v1 OR v2,v3 and puts the result into v0,v1.
C1
or-long/2addr vx, vy
Calculates vx OR vy and puts the result into vx1.
C120  - or-long/2addr v0, v2
Calculates v0,v1 OR v2,v3 and puts the result into v0,v1.
C2
xor-long/2addr vx, vy
Calculates vx XOR vy and puts the result into vx1.C220 - xor-long/2addr v0, v2
Calculates v0,v1 XOR v2,v3 and puts the result into v0,v1.
C3
shl-long/2addr vx, vy
Shifts left the value in vx,vx+1 by the positions specified by vy and stores the result in vx,vx+1.
C320 - shl-long/2addr v0, v2
Shifts left v0,v1 by the positions specified by v2.
C4
shr-long/2addr vx, vy
Shifts right the value in vx,vx+1 by the positions specified by vy and stores the result in vx,vx+1.C420 - shr-long/2addr v0, v2
Shifts right v0,v1 by the positions specified by v2.
C5
ushr-long/2addr vx, vy
Unsigned shifts right the value in vx,vx+1 by the positions specified by vy and stores the result in vx,vx+1.C520 - ushr-long/2addr v0, v2
Unsigned shifts right v0,v1 by the positions specified by v2.
C6
add-float/2addr vx,vy
Adds vy to vx. 
C640 - add-float/2addr v0,v4
Adds v4 to v0.
C7
sub-float/2addr vx,vy
Calculates vx-vy and stores the result in vx.C740 - sub-float/2addr v0,v4
Adds v4 to v0.
C8
mul-float/2addr vx, vy
Multiplies vx with vy.
C810 - mul-float/2addr v0, v1
Multiplies v0 with v1.
C9
div-float/2addr vx, vy
Calculates vx/vy and puts the result into vx.
C910 - div-float/2addr v0, v1
Divides v0 with v1 and puts the result into v0.
CA
rem-float/2addr vx,vy
Calculates vx/vy and puts the result into vx.CA10 - rem-float/2addr v0, v1
 Calculates v0 % v1 and puts the result into v0.
CB
add-double/2addr vx, vy
Adds vy to vx1.
CB70 - add-double/2addr v0, v7
Adds v7 to v0.
CC
sub-double/2addr vx, vy
Calculates vx-vy and puts the result into vx1.
CC70 - sub-double/2addr v0, v7
Subtracts the value in v7,v8 from the value in v0,v1 and puts the result into v0,v1.
CD
mul-double/2addr vx, vy
Multiplies vx with vy1.
CD20 - mul-double/2addr v0, v2
Multiplies the double value in v0,v1 with the double value in v2,v3 and puts the result into v0,v1.
CE
div-double/2addr vx, vy
Calculates vx/vy and puts the result into vx1.
CE20 - div-double/2addr v0, v2
Divides the double value in v0,v1 with the double value in v2,v3 and puts the value into v0,v1.
CF
rem-double/2addr vx,vy
Calculates vx % vy and puts the result into vx1.CF20 - rem-double/2addr v0, v2
 Calculates  v0,v1 %  v2,v3 and puts the value into v0,v1.
D0
add-int/lit16 vx,vy,lit16
Adds vy to lit16 and stores the result into vx.
D001 D204 - add-int/lit16 v1, v0, #int 1234 // #04d2
Adds v0 to literal 1234 and stores the result into v1.
D1
sub-int/lit16 vx,vy,lit16
Calculates vy - lit16 and stores the result into vx.
D101 D204 - sub-int/lit16 v1, v0, #int 1234 // #04d2
Calculates v0 - literal 1234 and stores the result into v1.
D2
mul-int/lit16 vx,vy,lit16
Calculates vy * lit16 and stores the result into vx.D201 D204 - mul-int/lit16 v1, v0, #int 1234 // #04d2
Calculates v0 * literal 1234 and stores the result into v1.
D3
div-int/lit16 vx,vy,lit16
Calculates vy / lit16 and stores the result into vx.D301 D204 - div-int/lit16 v1, v0, #int 1234 // #04d2
Calculates v0 / literal 1234 and stores the result into v1.
D4
rem-int/lit16 vx,vy,lit16
Calculates vy % lit16 and stores the result into vx.D401 D204 - rem-int/lit16 v1, v0, #int 1234 // #04d2
Calculates v0 % literal 1234 and stores the result into v1.
D5
and-int/lit16 vx,vy,lit16
Calculates vy AND lit16 and stores the result into vx.D501 D204 - and-int/lit16 v1, v0, #int 1234 // #04d2
Calculates v0 AND literal 1234 and stores the result into v1.
D6
or-int/lit16 vx,vy,lit16
Calculates vy OR lit16 and stores the result into vx.D601 D204 - or-int/lit16 v1, v0, #int 1234 // #04d2
Calculates v0 OR literal 1234 and stores the result into v1.
D7
xor-int/lit16 vx,vy,lit16
Calculates vy XOR lit16 and stores the result into vx.D701 D204 - xor-int/lit16 v1, v0, #int 1234 // #04d2
Calculates v0 XOR literal 1234 and stores the result into v1.
D8
add-int/lit8 vx,vy,lit8
Adds vy to lit8 and stores the result into vx.
D800 0201 - add-int/lit8 v0,v2, #int1
Adds literal 1 to v2 and stores the result into v0.
D9
sub-int/lit8 vx,vy,lit8
Calculates vy-lit8 and stores the result into vx.D900 0201 - sub-int/lit8 v0,v2, #int1
Calculates v2-1 and stores the result into v0.
DA
mul-int/lit8 vx,vy,lit8
Multiplies vy with lit8 8-bit literal constant and puts the result into vx.
DA00 0002 - mul-int/lit8 v0,v0, #int2
Multiplies v0 with literal 2 and puts the result into v0.
DB
div-int/lit8 vx,vy,lit8
Calculates vy/lit8 and stores the result into vx.DB00 0203 - mul-int/lit8 v0,v2, #int3
Calculates v2/3 and stores the result into v0.
DC
rem-int/lit8 vx,vy,lit8
Calculates vy % lit8 and stores the result into vx.DC00 0203 - rem-int/lit8 v0,v2, #int3
Calculates v2 % 3 and stores the result into v0.
DD
and-int/lit8 vx,vy,lit8
Calculates vy AND lit8 and stores the result into vx.DD00 0203 - and-int/lit8 v0,v2, #int3
Calculates v2 AND 3 and stores the result into v0.
DE
or-int/lit8 vx, vy, lit8
Calculates vy OR lit8 and puts the result into vx.
DE00 0203 - or-int/lit8 v0, v2, #int 3
Calculates v2 OR literal 3 and puts the result into v0.
DF
xor-int/lit8 vx, vy, lit8
Calculates vy XOR lit8 and puts the result into vx.DF00 0203     |  0008: xor-int/lit8 v0, v2, #int 3
Calculates v2 XOR literal 3 and puts the result into v0.
E0
shl-int/lit8 vx, vy, lit8
Shift v0 left by the bit positions specified by the literal constant and put the result into vx.E001 0001 - shl-int/lit8 v1, v0, #int 1
Shift v0 left by 1 position and put the result into v1.
E1
shr-int/lit8 vx, vy, lit8
Shift v0 right by the bit positions specified by the literal constant and put the result into vx.
E101 0001 - shr-int/lit8 v1, v0, #int 1
Shift v0 right by 1 position and put the result into v1.
E2
ushr-int/lit8 vx, vy, lit8
Unsigned right shift of v0 (>>>) by the bit positions specified by the literal constant and put the result into vx.E201 0001 - ushr-int/lit8 v1, v0, #int 1
Unsigned shift v0 right by 1 position and put the result into v1.
E3
unused_E3


E4
unused_E4


E5
unused_E5


E6
unused_E6


E7
unused_E7


E8
unused_E8


E9
unused_E9


EA
unused_EA


EB
unused_EB


EC
unused_EC


ED
unused_ED


EE
execute-inline {parameters},inline ID
Executes the inline method identified by inline ID6.
EE20 0300 0100 - execute-inline {v1, v0}, inline #0003
Executes inline method #3 using v1 as "this" and passing one parameter in v0.
EF
unused_EF


F0
invoke-direct-empty
Stands as a placeholder for pruned empty methods like Object.<init>. This acts as nop during normal execution6.
F010 F608 0000 - invoke-direct-empty {v0}, Ljava/lang/Object;.<init>:()V // method@08f6
Replacement for the empty method java/lang/Object;<init>.
F1
unused_F1


F2
iget-quick vx,vy,offset
Gets the value stored at offset in vy instance's data area to vx6.F221 1000 - iget-quick v1, v2, [obj+0010]
Gets the value at offset 0CH of the instance pointed by v2 and stores the object reference in v1.
F3
iget-wide-quick vx,vy,offset
Gets the object reference value stored at offset in vy instance's data area to vx,vx+16.F364 3001 - iget-wide-quick v4, v6, [obj+0130]
Gets the value at offset 130H of the instance pointed by v6 and stores the object reference in v4,v5.
F4
iget-object-quick vx,vy,offset
Gets the object reference value stored at offset in vy instance's data area to vx6.
F431 0C00 - iget-object-quick v1, v3, [obj+000c]
Gets the object reference value at offset 0CH of the instance pointed by v3 and stores the object reference in v1.
F5
iput-quick vx,vy,offset
Puts the value stored in vx to offset in vy instance's data area6.F521 1000  - iput-quick v1, v2, [obj+0010]
Puts the object reference value in v1 to offset 10H of the instance pointed by v2.
F6
iput-wide-quick vx,vy,offset
Puts the value stored in vx,vx+1 to offset in vy instance's data area6.F652 7001 - iput-wide-quick v2, v5, [obj+0170]
Puts the value in v2,v3 to offset 170H of the instance pointed by v5.
F7
iput-object-quick vx,vy,offset
Puts the object reference value stored in vx to offset in vy instance's data area to vx6.F701 4C00 - iput-object-quick v1, v0, [obj+004c]
Puts the object reference value in v1 to offset 0CH of the instance pointed by v3.
F8
invoke-virtual-quick {parameters},vtable offset
Invokes a virtual method using the vtable of the target object6.
F820 B800 CF00 - invoke-virtual-quick {v15, v12}, vtable #00b8
Invokes a virtual method. The target object instance is pointed by v15 and vtable entry #B8 points to the method to be called. v12 is a parameter to the method call.
F9
invoke-virtual-quick/range {parameter range},vtable offset
Invokes a virtual method using the vtable of the target object6F906 1800 0000 - invoke-virtual-quick/range {v0..v5},vtable #0018
Invokes a method using the vtable of the instance pointed by v0. v1..v5 registers are parameters to the method call.
FA
invoke-super-quick {parameters},vtable offset
Invokes a virtual method in the target object's immediate parent class using the vtable of that parent class6.FA40 8100 3254  - invoke-super-quick {v2, v3, v4, v5}, vtable #0081
Invokes a method using the vtable of the immediate parent class of instance pointed by v2. v3, v4 and v5 registers are parameters to the method call.
FB
invoke-super-quick/range {register range},vtable offset
Invokes a virtual method in the target object's immediate parent class using the vtable of that parent class6.
F906 1B00 0000 - invoke-super-quick/range {v0..v5}, vtable #001b
Invokes a method using the vtable of the immediate parent class of instance pointed by v0. v1..v5 registers are parameters to the method call.
FC
unused_FC


FD
unused_FD


FE
unused_FE


FF
unused_FF




  1. Note that double and long values occupy two registers (e.g. the value addressed by vy is located in vy and vy+1 registers)
  2. The offset can be positive or negative and it is calculated from the offset of the starting byte of the instruction. The offset is always interpreted in words (2 bytes per 1 offset value increment/decrement). Negative offset is stored in two's complement format. The current position is the offset of the starting byte of the instruction.
  3. Compare operations returrn positive value if the first operand is greater than the second operand, 0 if they are equal and negative value if the first operand is smaller than the second operand.
  4. Not seen in the wild, interpolated from Dalvik bytecode list.
  5. The invocation parameter list encoding is somewhat weird. Starting if parameter number > 4 and parameter number % 4 == 1, the 5th (9th, etc.) parameter is encoded on the 4 lowest bit of the byte immediately following the instruction. Curiously, this encoding is not used in case of 1 parameter, in this case an entire 16 bit word is added after the method index of which only 4 bit is used to encode the single parameter while the lowest 4 bit of the byte following the instruction byte is left unused.
  6. This is an unsafe instruction and occurs only in ODEX files.


'Study > mobile' 카테고리의 다른 글

음.. 뽀꼬빵  (0) 2013.12.22
[연습]포코팡 오토(?) POKOPANG AUTO~  (3) 2013.12.17
[android]change system date & time  (0) 2013.11.19
[Android]Monkeyrunner  (0) 2013.11.05
[펌]USB 드라이버가 없는 안드로이드 기기의 설치  (0) 2013.09.12
Posted by 땡보
2013. 12. 22. 00:05

빨간색 1 
노란색 2 
파란색 3 
초록색 4 
보라색 5 
파란색 블록( 주위 블록 끌어당김 ) 8 

Posted by 땡보
2013. 12. 17. 00:35

UI automation 연습겸 장난삼아 작성해본 포코팡 오토(?)라고 하기엔 너무 멍청함.. ㅋㅋ

구현기능

1. 무한반복 플레이

2. 클로버 자동충전

역시 손은 눈보다 빠름.. ㅎㅎ


'Study > mobile' 카테고리의 다른 글

[android]Dalvik opcodes  (0) 2015.03.15
음.. 뽀꼬빵  (0) 2013.12.22
[android]change system date & time  (0) 2013.11.19
[Android]Monkeyrunner  (0) 2013.11.05
[펌]USB 드라이버가 없는 안드로이드 기기의 설치  (0) 2013.09.12
Posted by 땡보
2013. 11. 19. 09:56
date -s YYYYMMDD.HHmmss

adb shell setprop persist.sys.timezone "America/Chicago"
from datetime import datetime

date_object = datetime.strptime('Jun 1 2005  1:33PM', '%b %d %Y %I:%M%p')

Link to the Python documentation for strptime

and a link for the strftime format mask

8.1.7. strftime() and strptime() Behavior

datedatetime, and time objects all support a strftime(format) method, to create a string representing the time under the control of an explicit format string. Broadly speaking, d.strftime(fmt) acts like the time module’s time.strftime(fmt, d.timetuple()) although not all objects support a timetuple() method.

Conversely, the datetime.strptime() class method creates a datetime object from a string representing a date and time and a corresponding format string. datetime.strptime(date_string, format) is equivalent to datetime(*(time.strptime(date_string, format)[0:6])).

For time objects, the format codes for year, month, and day should not be used, as time objects have no such values. If they’re used anyway, 1900 is substituted for the year, and 1 for the month and day.

For date objects, the format codes for hours, minutes, seconds, and microseconds should not be used, as date objects have no such values. If they’re used anyway, 0 is substituted for them.

The full set of format codes supported varies across platforms, because Python calls the platform C library’s strftime() function, and platform variations are common. To see the full set of format codes supported on your platform, consult the strftime(3)documentation.

The following is a list of all the format codes that the C standard (1989 version) requires, and these work on all platforms with a standard C implementation. Note that the 1999 version of the C standard added additional format codes.

The exact range of years for which strftime() works also varies across platforms. Regardless of platform, years before 1900 cannot be used.

DirectiveMeaningExampleNotes
%aWeekday as locale’s abbreviated name.
Sun, Mon, ..., Sat (en_US);
So, Mo, ..., Sa (de_DE)
(1)
%AWeekday as locale’s full name.
Sunday, Monday, ..., Saturday (en_US);
Sonntag, Montag, ..., Samstag (de_DE)
(1)
%wWeekday as a decimal number, where 0 is Sunday and 6 is Saturday.0, 1, ..., 6 
%dDay of the month as a zero-padded decimal number.01, 02, ..., 31 
%bMonth as locale’s abbreviated name.
Jan, Feb, ..., Dec (en_US);
Jan, Feb, ..., Dez (de_DE)
(1)
%BMonth as locale’s full name.
January, February, ..., December (en_US);
Januar, Februar, ..., Dezember (de_DE)
(1)
%mMonth as a zero-padded decimal number.01, 02, ..., 12 
%yYear without century as a zero-padded decimal number.00, 01, ..., 99 
%YYear with century as a decimal number.1970, 1988, 2001, 2013 
%HHour (24-hour clock) as a zero-padded decimal number.00, 01, ..., 23 
%IHour (12-hour clock) as a zero-padded decimal number.01, 02, ..., 12 
%pLocale’s equivalent of either AM or PM.
AM, PM (en_US);
am, pm (de_DE)
(1), (2)
%MMinute as a zero-padded decimal number.00, 01, ..., 59 
%SSecond as a zero-padded decimal number.00, 01, ..., 59(3)
%fMicrosecond as a decimal number, zero-padded on the left.000000, 000001, ..., 999999(4)
%zUTC offset in the form +HHMM or -HHMM (empty string if the the object is naive).(empty), +0000, -0400, +1030(5)
%ZTime zone name (empty string if the object is naive).(empty), UTC, EST, CST 
%jDay of the year as a zero-padded decimal number.001, 002, ..., 366 
%UWeek number of the year (Sunday as the first day of the week) as a zero padded decimal number. All days in a new year preceding the first Sunday are considered to be in week 0.00, 01, ..., 53(6)
%WWeek number of the year (Monday as the first day of the week) as a decimal number. All days in a new year preceding the first Monday are considered to be in week 0.00, 01, ..., 53(6)
%cLocale’s appropriate date and time representation.
Tue Aug 16 21:30:00 1988 (en_US);
Di 16 Aug 21:30:00 1988 (de_DE)
(1)
%xLocale’s appropriate date representation.
08/16/88 (None);
08/16/1988 (en_US);
16.08.1988 (de_DE)
(1)
%XLocale’s appropriate time representation.
21:30:00 (en_US);
21:30:00 (de_DE)
(1)
%%A literal '%' character.% 

Notes:

  1. Because the format depends on the current locale, care should be taken when making assumptions about the output value. Field orderings will vary (for example, “month/day/year” versus “day/month/year”), and the output may contain Unicode characters encoded using the locale’s default encoding (for example, if the current locale is ja_JP, the default encoding could be any one of eucJPSJIS, or utf-8; use locale.getlocale() to determine the current locale’s encoding).

  2. When used with the strptime() method, the %p directive only affects the output hour field if the %I directive is used to parse the hour.

  3. Unlike the time module, the datetime module does not support leap seconds.

  4. %f is an extension to the set of format characters in the C standard (but implemented separately in datetime objects, and therefore always available). When used with the strptime() method, the %f directive accepts from one to six digits and zero pads on the right.

    New in version 2.6.

  5. For a naive object, the %z and %Z format codes are replaced by empty strings.

    For an aware object:

    %z

    utcoffset() is transformed into a 5-character string of the form +HHMM or -HHMM, where HH is a 2-digit string giving the number of UTC offset hours, and MM is a 2-digit string giving the number of UTC offset minutes. For example, ifutcoffset() returns timedelta(hours=-3, minutes=-30)%z is replaced with the string '-0330'.

    %Z

    If tzname() returns None%Z is replaced by an empty string. Otherwise %Z is replaced by the returned value, which must be a string.

  6. When used with the strptime() method, %U and %W are only used in calculations when the day of the week and the year are specified.

Footnotes

[1]

If, that is, we ignore the effects of Relativity

View Full Version : HOW-TO: Set system time clock with rdate


Mr. Gadget
02-08-2011, 08:29 PM
Set your system time with RDATE or NTPD

You can set your PBO system time clock to the current time using the command 'rdate'. You will need to download and add the latest Busybox commands (do not overlay on existing commands, unless you know what you are doing). 

1) Perform the addition of the latest Busybox commands to your system. You can run them from your HD or USB, not sure about using internal memory. The Busybox file is only 1.6Mb, but I would not want to deny the OS from using available space. If you want to test this feature before making it permanent, insert a USB drive on the PBO, browse to the USB drive from your PC, map it to a drive letter like V:, then download busybox-mipsel.asc file to the mapped/USB drive (save target, and add the file extension .asc).

Snappy has this file information listed here: http://www.patriotmem.com/forums/showthread.php?t=3737

A quick test to see if the new BBox commands work (I placed my file in the root of the front USB, which is /tmp/usbmounts/sda1). 

Create an alias to your new commands on Venus:

Venus> alias bb="/tmp/usbmounts/sda1/busybox-mipsel.asc"

Test it with 'whoami', it should return root, if you get "-sh: whoami: not found" you are not linked to the proper file.

Venus> bb whoami
root


2) Next you should modify your /etc/profile to match your proper TZ (timezone). Example: TZ=MST7MDT
This will allow you to see your time in your local format (assuming the timezone file is current for your location, too detailed for this mod).

You can display the 'current' set date/time for your timezone, but if you did not set the date manually already, it will be wrong. Just enter the command 'date'. Don't worry about any of the fields other than your timezone, ie MST, PST...

3) Now your system is armed to get access and display the proper time. So, first we will update the System clock from the network. We need to use an older time server since most do not accept the rdate protocol command. If we can get NTP loaded on the PBO, then we can use any Stratum NTP server available (pool.ntp.org). 

Enter the command:

Venus> bb rdate -sp time-nw.nist.gov
Tue Feb 8 12:53:33 2011

So now your system has the correct time. But the hardware clock is still out of sync with the system time. We can view this using the 'hwclock' command.

Venus> hwclock
Thu Dec 31 17:12:33 2009 0000000000.000000 seconds

Let's fix the hardware clock and sync it with the system clock.

Venus> hwclock -w

Now verify the System clock and Hardware clock are in sync. Just enter the 'date' command, then compare with the 'hwclock' command results.

Your system is now set to the current time, and your display should be set to your local timezone.

Update: Use NTP to set clock. Can ignore hwclock settings at this point in time, the RTC does not advance after setting anyway.

(Verbose mode)
Venus> bb ntpd -dnq -p pool.ntp.org

(Quiet mode)
Venus> bb ntpd -nq -p pool.ntp.org


TODO:
Decide which clock is more important: System (telnet) time, or PBO (GUI) time.
(GUI Time displays UTC time, telnet system clock shows TZ time).

Make it permanent (every system boot).

DONE:
Install NTP for greater accuracy and more system support. Part of the new busybox command set.

WOW -- The hwclock clock NEVER advances automatically - something I hadn't noticed at first. I thought it was slow.
aasoror
02-08-2011, 11:35 PM
Excellent write up,
Thanks,
IanC
02-09-2011, 06:48 AM
I suspect the "drift" is why some of the firmwares have dropped the ability to set the time.
grill
03-20-2011, 06:04 PM
The NTPD work fine, but how did that NTPD refresh automatically every time when I turn on the PBO? :rolleyes:
aasoror
03-20-2011, 09:09 PM
The NTPD work fine, but how did that NTPD refresh automatically every time when I turn on the PBO? :rolleyes:

You can add whatever commands that starts the service to your /usr/local/etc/rcS (startup script).
grill
03-21-2011, 07:01 PM
Thank you! :)
jamaroney
05-21-2012, 11:31 AM
I installed busybox 1.18.1 on my PBO successfully. When I run "ntpd -nq -p pool.ntp.org" via telnet after startup, it works fine, but it doesn't work when I put it in rcS. Am I doing anything wrong, or will it simply not work in the startup script?
snappy46
05-21-2012, 03:11 PM
I installed busybox 1.18.1 on my PBO successfully. When I run "ntpd -nq -p pool.ntp.org" via telnet after startup, it works fine, but it doesn't work when I put it in rcS. Am I doing anything wrong, or will it simply not work in the startup script?

My guess would be that your network connection is not active yet when running from the rcS file. I personnally only have one extra entry in my rcS file to another script which make all the magic happen. The first thing that happen in my script is a loop to make sure my network (wireless/ethernet) is up an running before anything happen. After that loop is completed I then mount my NAS, setup the time, launch lighttpd etc......

Hope this helps!

Cheers!!!
Mr. Gadget
05-21-2012, 05:54 PM
I have a few dirty programs I use to boot my system. 
First, I added a call in the rcS1 file to myStartup.sh (see imbedded comment)

Then, myStartup.sh calls all of my utilities to do my system setup:
1) Run setMGWY.sh to determine what the default gateway should be
2) Run chknet.sh to see if the network is operational yet
3) Run getTime.sh to set the time using NTPD
4) Run myMount.sh to mount my SMB shares (not included here)

You may name the programs with our without the .sh, if you add, then be sure to edit the files to include the correct name. 
(By default, the only file with .sh is myStartup.sh)

File: myStartup.sh


File: myStartup.sh

#!/bin/sh
# myStartup.sh
# Date: 20110804 V1.21
# Date: 20120103 V1.21b Change from HDD to USB (Mars), Removed SYSLOG and looger (too much memory used)
# Date: 20120521 V1.21c Cleanup
# This program will check the status of the network, if up 
# it will set time, mount shares, and whatever else is needed if network up.
# If network down, you can do something else.
# If used in rcS1, be sure to make verbose 0 (no output)
# Expects busybox to be in ???

# Add/Edit your /etc/init.d/rcS1 - (remove comments ##!# below) 120103 (mount -o remount,rw /)
### file rcS1
### Added 120103 - If usb attached. wait till ready, run myStartup commands, else bypass
##!#sleep 20
##!#if [ -e /tmp/usbmounts/sdb1/bin/scripts/myStartup.sh ]; then
### echo "File exists"
##!# /tmp/usbmounts/sdb1/bin/scripts/myStartup.sh&
##!#fi

# Usually, the IP is for the router/gateway
# Programs used: 
# Syntax: 
# chknet [-i IP|MGWY] [-c count] [-q] [-h]
# getTime [-q]
# setMGWY [-q]
# myMount [-q]
# Start USER DEFINED Programs:
CKNET="/tmp/usbmounts/sdb1/bin/scripts/chknet"
STMGY="/tmp/usbmounts/sdb1/bin/scripts/setMGWY"
GTIM="/tmp/usbmounts/sdb1/bin/scripts/getTime"
MYMNT="/tmp/usbmounts/sdb1/bin/scripts/myMount"
# End USER DEFINED Programs

# Start SYSLOG (too much memory used)
##/etc/init.d/syslog.rcS -p /tmp/hdd/volumes/HDD1/logs/syslog&
#logger " $(date) - Syslog started at boot"

# Locate the Default gateway router, set MGWY variable (this may have trouble - redo to file?)
. $STMGY

# TEMP What is set?
##set

# See if network is operational
$CKNET -q
# Save the exit status of last command
status=$?
if [ $status == 0 ];
then
# Do something if network is UP
##echo "GOOD Status is (0 or 0)" $? " chknet status is " $status
# Set the Time of day from NTP
$GTIM -q
# Mount my SMB shares
$MYMNT -q
#logger " $(date) - MyStartup completed succesfully"
else
# Do something if network is DOWN
##echo "BAD Status is (1 or 100)" $? " chknet status is " $status
logger " $(date) - MyStartup did not complete succesfully, Status: $status"
fi 
# and finis

# end myStartup


Next post included files (too long for original post)

Good Luck, hope these help.
Mr. Gadget
05-21-2012, 05:56 PM
Part 2, Utility Files

File: setMGWY


File: setMGWY.sh

#!/bin/sh
# Date: 20110628 v1.1
tver="v1.1"
# By: Mr. Gadget
# Script: setMGWY
# Purpose: Create a Global variable MGWY used other programs, such as:
# chknet, getTime, myMount ...
# Use netstat to locate Gateway, save to temp file, and make global variable MGWY.
# (Others may find faster methods to accomplish same).
# Note: To make variable global (parent shell) use ". path/setMGWY"
#
# Input: None
# Output: Environment variable MGWY
#####################################
# Identify our current gateway. Not sure what it looks like if no network.
netstat -r -n | grep ^0.0.0.0 | awk '{print $2}' >/tmp/mynet.tmp
read MGWY </tmp/mynet.tmp
# Debug echo (uncomment #.#)
#.#echo "MGWY is $MGWY"
export MGWY
# Debug export (uncomment #.#)
#.#export
# end setMGWY


File: chknet


File: chknet.sh

#!/bin/sh
# Date: 20110628 v5.4
# Date: 20110928 v5.4a Modify from HDD to USB - Use Direct link to awk (gawk)
# Date: 20120112 v5.4b awk fixed with MegaPack Update
tver="v5.4b"
# By: Mr. Gadget
# Script: chknet [-i IP] [-c count] [-q] [-h]
# where -i IP = xxx.xxx.xxx.xxx (or $MGWY)
# -c count = 1-n (1=22seconds, 2=33seconds, 3=44...) delay (or $PLOOP)
# -q (quiet, otherwise verbose) (or $VERBOSE=0 or 1)
# Status Returns: 0 if network up, 1 invalid input, 2 invalid BusyBox, 100 if network down
# Purpose:
# This script will loop on checking the network status Up or Down, 
# and then return status code 0 for UP and 100 for DOWN.
# The loop count is user selectable to avoid endless loop.
# DO NOT RUN IN VERBOSE MODE within your rcS
# This program REQUIRES the updated BusyBox (V1.16+) command parser
# with the extra PING features. 
# Get the advanced Busybox here (save with extension .asc)
# http://busybox.net/downloads/binaries/1.16.1/busybox-mipsel
# also
# http://playon.unixstorm.org/download/tools/busybox1.18.3
# Tip: Make an alias in /etc/profile, 
# alias bb="/tmp/hdd/volumes/HDD1/bin/busyboxxxxx.asc"
# for ongoing use of the advanced busybox commands for interactive use.

##### USER-SPECIFICS
# Choices for file locations of your Busybox binaries:
# Internal HDD Small partition /tmp/hdd/root (part3 = 512MB, type ext3)
# Internal HDD Large partition /tmp/hdd/volumes/HDD1 (part1 = 500GB, type ufsd)
# Removable USB /tmp/usbmounts/sdb1 (host3 part1 = 8GB, type vfat)
# Removable USB /tmp/usbmounts/sda1 (UNUSED)
# Define where your updated BusyBox image is located (not Flash)
# I use the bin folder on the USB drive for this PBO (in case I need to remove it to bypass my startups)
#MBB="/tmp/hdd/volumes/HDD1/bin/busybox-mipsel.asc"
#MBB="/tmp/hdd/volumes/HDD1/bin/busybox1.18.3.asc"
MBB="/tmp/usbmounts/sdb1/bin/busybox1.18.3.asc"
# Bug in previous BB. If needed, Use awk file /usr/local/bin/package/awk" (FIXED with MegaPack update)


### Define your default gateway if you want
tmgwy="192.168.1.253"
### Define Default loop count 1=22sec, 2=33sec, 3=44sec ...
tploop=5
### Define Default Verbose (not quiet).
tverbose=1
#### END USER-SPECIFICS

### oh, check to see if we have access to a good BusyBox image, exit error 2 if not found
if [ ! -s "$MBB" ]; 
then
echo "No path to extended Busybox file"
exit 2
fi

### OK to proceed if updated Busybox available

### Test if input options specified, or use Global vars ($MGWY, $PLOOP, $VERBOSE)
args=`getopt i:c:qh $*`
if test $? != 0
then
echo 'Version: '$tver;\
echo 'Usage: '$0' [OPTIONS]'; echo '';\
echo 'Options:'; echo ' -i IP Check if Host IP is Up/Down'; \
echo ' Global Variable $MGWY may be used.'; \
echo ' -c CNT Loop delay count, [5] = 66 seconds'; \
echo ' Global Variable $PLOOP may be used.'; \
echo ' -q Quiet mode. No output.'; \
echo 'Status:'; echo ' 0 = Host up, 1 = invalid input, 2 = invalid Busybox file, 100 = Host down' 
exit 1
fi

### We may or may not have input, set the arguments
#.#echo "Args are: " $args
set -- $args

### Parse out the arguments, and shift as required.
for i
do
case "$i" in
-i) opt_i=$2;shift;shift;;
-c) opt_c=$2;shift;shift;;
-q) opt_q=$1;shift;;
-h) echo ''; \
echo 'chknet Version: '$tver;\
echo 'Usage: '$0' [OPTIONS]'; echo '';\
echo 'Options:'; echo ' -i IP Check if Host IP is Up/Down'; \
echo ' Global Variable $MGWY may be used.'; \
echo ' -c CNT Loop delay count, [5] = 66 seconds'; \
echo ' Global Variable $PLOOP may be used.'; \
echo ' -q Quiet mode. No output.'; \
echo 'Status:'; echo ' 0 = Host up, 1 = invalid input, 2 = invalid Busybox file, 100 = Host down'
exit 1
esac
done

### If we did not pass any (-i) IP options, use either the global exported MGWY or assign a gateway.
if [ -n "$opt_i" ];
then
### Do something if TRUE, like save the -i input
###echo "Valid var opt_i=$opt_i, use it"
MGWY=$opt_i
else
### Do something if FALSE, like assign the Global var or a temp IP
###echo "Try if global MGWY=$MGWY, else set to temp gateway"
[ "$MGWY" ] || MGWY="$tmgwy"
fi

### If we did not pass any (-c) COUNT options, use either the global exported PLOOP or assign a value
if [ -n "$opt_c" ];
then
### Do something if TRUE, like save the -c input
###echo "Valid var opt_c=$opt_c, use it"
PLOOP=$opt_c
else
### Do something if FALSE, like assign the Global var or a temp CNT
###echo "Try if global PLOOP=$PLOOP, else set to temp count"
[ "$PLOOP" ] || PLOOP=$tploop
fi

### If we did not pass any (-q) QUIET options then go verbose
if [ -n "$opt_q" ];
then
### Do something if TRUE, like save the -q input
###echo "Valid var opt_q=$opt_q, use it"
VERBOSE=0
else
### Do something if FALSE, like assign the Global var or a temp Verbose
###echo "Try if global VERBOSE=$VERBOSE, else set to VERBOSE"
[ "$VERBOSE" ] || VERBOSE=$tverbose
fi

### debug ###
#.#echo "mgwy " $MGWY
#.#echo "ploop " $PLOOP
#.#echo "verbose " $VERBOSE
### debug ###

### OK, we have all our inputs, lets go to work.
### Setup if Quiet or Verbose. Output logic: NON-VERBOSE = 0 , VERBOSE = 1 (default)
########### WARNING ###########
# DO NOT run this in the /usr/local/etc/rcS with output enabled
# If using as a local script may use -q or not, in rcS, wse -q
########### WARNING ###########

### Make a redirect command for output (if verbose or not)
redir_cmd() { 
### Are we verbose(1) or quiet(0)
if [ "$VERBOSE" -eq 0 ];
then 
"$@" > /dev/null 
else 
"$@" 
fi 
}

### Lets get started - Define a pinger function and then test if target host IP up
# If network up, exit with status 0, otherwise exit with status 100 (failed)
#redir_cmd echo "Target IP = "$MGWY
# Create awk function to use extended busybox ping with cnt feature
## If your version of native awk is broken, use the version in the package directory
##/usr/local/bin/package/awk ' function pinger(count,ip) {
awk ' function pinger(count,ip) {
command = "'$MBB' ping -c "count " " ip
while (( command | getline res )> 0 ) {
if ( res ~ /0 received|100% packet loss/ ) {
close(command)
return 100
} # IF packet loss
} # WHILE ping
close(command)
return 0
} # FUNCTION pinger
BEGIN { 
IP="'$MGWY'" # Identify the target host
VERB="'$VERBOSE'" # Verbose?
looper='$PLOOP' # how many iterations to test
if ( VERB == 1 ) { print "Checking host " IP " for " looper " iterations, or unless up" }
if ( pinger(2,IP) == 100 ) {
if ( VERB == 1 ) { printf IP " Not up.." }
c = 0
while ( c < looper ) { # we were not up on first pass, keep trying
if ( pinger(2,IP) == 100 ) {
c=c+1
#if ( VERB == 1 ) { print IP " Not up yet." }
if ( VERB == 1 ) { printf " Not up.." }
} else 
{ if ( VERB == 1 ) { print IP " up." }
c=looper
exit 0} # We are up now, so stop while and set exit status
} # While
exit 100 # We are still down
} else { 
if ( VERB == 1 ) { print IP " up." } 
exit 0 } # If the first pass is good, then we are up
} # BEGIN function pinger begin
END {
if ( VERB == 1 ) { print "Exiting. " $0 }
} # END function pinger end
' # awk end
# Were done here -- How did we do - If 0, then network UP, if 100, then network DOWN
##End chknet



Continued in next post.
Mr. Gadget
05-21-2012, 05:57 PM
Part 3, Utility Files

File: getTime


File: getTime.sh

#!/bin/sh
# Date: 20110627 V1.0
# Date: 20110804 V3.1
# Date: 20110804 V3.1b - Change loation for NO HDD - USB only
tver="3.1b"
# By: Mr. Gadget
# Script: getTime [-q]
# Option:
# -q quietmode, no output reported
# Status: 0 = success, 1 = invalid input, 2 = missing Busybox, 100 = network down
#
# This script will set the PBO clock using the updated BusyBox (V1.18) command parser
# with the NTPD feature. Use options for verbose on or off.
# Get the advanced Busybox here (save with extension .asc)
# http://busybox.net/downloads/binaries/1.16.1/busybox-mipsel
# Tip: Make an alias in /etc/profile, 
# alias bb="/tmp/hdd/volumes/HDD1/bin/busybox-mipsel.asc"
# for ongoing use of the advanced busybox commands for interactive use.
# Be sure to modify /etc/profile with your proper TZ (timezone) too.
# Example: TZ='MST7MDT6,J72,J310'

# USER-SPECIFICS
### use either the global exported MGWY or this temp gateway assignment.
# Define your Gateway-Router IP address
tmgwy="192.168.1.253"

# Use can also use prog setMGWY to define variable for your Default Gateway
#echo "Try if global MGWY=$MGWY, else set to temp gateway"
# Which gateway assignment, check if global variable available, else use local
[ "$MGWY" ] || MGWY="$tmgwy"
### echo "MGWY is " $MGWY

# Choices for file locations of your binaries:
# Internal HDD Small partition /tmp/hdd/root (part3 = 512MB, type ext3)
# Internal HDD Large partition /tmp/hdd/volumes/HDD1 (part1 = 500GB, type ufsd)
# Removable USB Rear /tmp/usbmounts/sdb1 (host3 part1 = 8GB, type vfat)
# Removable USB Front /tmp/usbmounts/sda1 (UNUSED)
# Define where your updated BusyBox image is located (not Flash)
# I use the bin folder on the USB (for quick removal/bypass capbility)
#MBB="/tmp/hdd/volumes/HDD1/bin/busybox-mipsel.asc"
#MBB="/tmp/hdd/volumes/HDD1/bin/busybox1.18.3.asc"
MBB="/tmp/usbmounts/sdb1/bin/busybox1.18.3.asc"
CKNET="/tmp/usbmounts/sdb1/bin/scripts/chknet"
# END USER-SPECIFICS

### Test if input options specified
args=`getopt qh $*`
if test $? != 0
then
echo 'Version: '$tver;\
echo 'Usage: '$0' [OPTIONS]'; echo '';\
echo 'Options:'; echo ' -q Quiet mode.'
exit 1
fi

### We may or may not have input, set the arguments
#.#echo "Args are: " $args
set -- $args

### Parse out the arguments, and shift as required.
for i
do
case "$i" in
-q) opt_q=$1;shift;;
-h) echo ''; \
echo 'getTime Version: '$tver;\
echo 'Usage: '$0' [OPTIONS]'; echo '';\
echo 'Options:'; echo ' -q Quiet mode.'
exit 1
esac
done

### If we did not pass any (-q) quite options, make it verbose.
if [ -n "$opt_q" ];
then
### Do something if TRUE, like save the -q input
###echo "Valid var opt_q=$opt_q, use it"
## Be real quiet
VERBOSE=0
##echo "I need to be quiet"
else
### Do something if FALSE
VERBOSE=1
##echo "I can be verbose"
fi

# Make a redirect command for output
redir_cmd() { 
# Are we verbose or not (set busybox ntpd verbose -d option too)
if [ "$VERBOSE" -eq 0 ];
then 
NTPV="-nq"
"$@" > /dev/null 
else 
NTPV="-dnq"
"$@" 
fi 
}

# Start:
# First verify the network is up before we try to get the time.
# Validate acccess to your Router-Gateway MGWY.
redir_cmd echo "Setting the clock from NTP"
# Wait for the network to come up before we access the network

$CKNET -i $MGWY -c 3 -q

# Save the exit status of last command
status=$?
if [ $status -eq 0 ];
then
# Do something if network is UP
# Network is up, how about setting the clock, 
# oh, check to see if we have access to a good BusyBox image
#
if [ -s $MBB ]; then
# File is good, Get time from NTP.ORG
$MBB ntpd $NTPV -p pool.ntp.org
redir_cmd date
exit 0
else
# File not found - better get it right!
redir_cmd echo "File $MBB not found"
exit 2
fi
redir_cmd echo "Done"
else
# Do something if network is DOWN
redir_cmd echo "Network not running. Time not set."
exit 100
fi 

# end getTime


If you want to see myMount.sh, let me know (it also uses chknet to see if network is up, then mount shares).
jamaroney
05-21-2012, 06:27 PM
I'll check this all out - thanks!!
jamaroney
05-22-2012, 12:45 PM
I tried the simple approach: I placed the "ntpd -nq -p pool.ntp.org" command at the very end of the rcS script, immediately preceded by "sleep 30".

For now, that seems to be working well for my setup.
Mr. Gadget
05-22-2012, 03:24 PM
Good to hear it works for you. 
Just a word of caution, if the network is not operational for any reason (using PBO in hotel, on the road...), some commands may not allow your PBO to boot completely (if you are waiting for the network). Be sure to test your commands in various situations if you plan to take it on the road.



list of timezone

원문 : http://en.wikipedia.org/wiki/List_of_tz_database_time_zones

List of tz database time zones

From Wikipedia, the free encyclopedia
World map showing time zones from the tz database version 2009r

This is a list of time zones in the tz database release 2012c. The list is derived from the zones, links, and rules specified in zone.tab and the 7 "continent files" – africaantarcticaasiaaustralasia,europenorthamerica, and southamerica.

The four columns in zone.tab are mapped into columns 1–4 (marked with *) in the table below. The file contains the following comments:

# This file contains a table with the following columns:
# 1.  ISO 3166 2-character country code.  See the file `iso3166.tab'.
# 2.  Latitude and longitude of the zone's principal location
#     in ISO 6709 sign-degrees-minutes-seconds format,
#     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
#     first latitude (+ is north), then longitude (+ is east).
# 3.  Zone name used in value of TZ environment variable.
# 4.  Comments; present if and only if the country has multiple rows.

The UTC offsets (columns 5 and 6) are parsed from the "continent files" and are in the format {+|-}hh:mm where the sign is + for east of UTC or - for west of UTC, and hh and mm are hours and minutes, respectively. The UTC DST offset is different from the UTC offset for zones where daylight saving time is observed (see individual time zone pages for details).

The table is sorted by TZ by default.

List[edit]

CC*Coordinates*TZ*Comments*UTC offsetUTC DST offsetNotes
CI+0519-00402Africa/Abidjan+00:00+00:00
GH+0533-00013Africa/Accra+00:00+00:00
ET+0902+03842Africa/Addis_Ababa+03:00+03:00
DZ+3647+00303Africa/Algiers+01:00+01:00
ER+1520+03853Africa/Asmara+03:00+03:00
Africa/Asmera+03:00+03:00Link to Africa/Asmara
ML+1239-00800Africa/Bamako+00:00+00:00
CF+0422+01835Africa/Bangui+01:00+01:00
GM+1328-01639Africa/Banjul+00:00+00:00
GW+1151-01535Africa/Bissau+00:00+00:00
MW-1547+03500Africa/Blantyre+02:00+02:00
CG-0416+01517Africa/Brazzaville+01:00+01:00
BI-0323+02922Africa/Bujumbura+02:00+02:00
EG+3003+03115Africa/Cairo+02:00+02:00DST has been canceled since 2011
MA+3339-00735Africa/Casablanca+00:00+01:00
ES+3553-00519Africa/CeutaCeuta & Melilla+01:00+02:00
GN+0931-01343Africa/Conakry+00:00+00:00
SN+1440-01726Africa/Dakar+00:00+00:00
TZ-0648+03917Africa/Dar_es_Salaam+03:00+03:00
DJ+1136+04309Africa/Djibouti+03:00+03:00
CM+0403+00942Africa/Douala+01:00+01:00
EH+2709-01312Africa/El_Aaiun+00:00+00:00
SL+0830-01315Africa/Freetown+00:00+00:00
BW-2439+02555Africa/Gaborone+02:00+02:00
ZW-1750+03103Africa/Harare+02:00+02:00
ZA-2615+02800Africa/Johannesburg+02:00+02:00
SS+0451+03136Africa/Juba+03:00+03:00
UG+0019+03225Africa/Kampala+03:00+03:00
SD+1536+03232Africa/Khartoum+03:00+03:00
RW-0157+03004Africa/Kigali+02:00+02:00
CD-0418+01518Africa/Kinshasawest Dem. Rep. of Congo+01:00+01:00
NG+0627+00324Africa/Lagos+01:00+01:00
GA+0023+00927Africa/Libreville+01:00+01:00
TG+0608+00113Africa/Lome+00:00+00:00
AO-0848+01314Africa/Luanda+01:00+01:00
CD-1140+02728Africa/Lubumbashieast Dem. Rep. of Congo+02:00+02:00
ZM-1525+02817Africa/Lusaka+02:00+02:00
GQ+0345+00847Africa/Malabo+01:00+01:00
MZ-2558+03235Africa/Maputo+02:00+02:00
LS-2928+02730Africa/Maseru+02:00+02:00
SZ-2618+03106Africa/Mbabane+02:00+02:00
SO+0204+04522Africa/Mogadishu+03:00+03:00
LR+0618-01047Africa/Monrovia+00:00+00:00
KE-0117+03649Africa/Nairobi+03:00+03:00
TD+1207+01503Africa/Ndjamena+01:00+01:00
NE+1331+00207Africa/Niamey+01:00+01:00
MR+1806-01557Africa/Nouakchott+00:00+00:00
BF+1222-00131Africa/Ouagadougou+00:00+00:00
BJ+0629+00237Africa/Porto-Novo+01:00+01:00
ST+0020+00644Africa/Sao_Tome+00:00+00:00
Africa/Timbuktu+00:00+00:00Link to Africa/Bamako
LY+3254+01311Africa/Tripoli+02:00+02:00
TN+3648+01011Africa/Tunis+01:00+01:00
NA-2234+01706Africa/Windhoek+01:00+02:00
AKST9AKDT−09:00−08:00Link to America/Anchorage
US+515248-1763929America/AdakAleutian Islands−10:00−09:00
US+611305-1495401America/AnchorageAlaska Time−09:00−08:00
AI+1812-06304America/Anguilla−04:00−04:00
AG+1703-06148America/Antigua−04:00−04:00
BR-0712-04812America/AraguainaTocantins−03:00−03:00
AR-3436-05827America/Argentina/Buenos_AiresBuenos Aires (BA, CF)−03:00−03:00
AR-2828-06547America/Argentina/CatamarcaCatamarca (CT), Chubut (CH)−03:00−03:00
America/Argentina/ComodRivadavia−03:00−03:00Link toAmerica/Argentina/Catamarca
AR-3124-06411America/Argentina/Cordobamost locations (CB, CC, CN, ER, FM, MN, SE, SF)−03:00−03:00
AR-2411-06518America/Argentina/JujuyJujuy (JY)−03:00−03:00
AR-2926-06651America/Argentina/La_RiojaLa Rioja (LR)−03:00−03:00
AR-3253-06849America/Argentina/MendozaMendoza (MZ)−03:00−03:00
AR-5138-06913America/Argentina/Rio_GallegosSanta Cruz (SC)−03:00−03:00
AR-2447-06525America/Argentina/Salta(SA, LP, NQ, RN)−03:00−03:00
AR-3132-06831America/Argentina/San_JuanSan Juan (SJ)−03:00−03:00
AR-3319-06621America/Argentina/San_LuisSan Luis (SL)−03:00−03:00
AR-2649-06513America/Argentina/TucumanTucuman (TM)−03:00−03:00
AR-5448-06818America/Argentina/UshuaiaTierra del Fuego (TF)−03:00−03:00
AW+1230-06958America/Aruba−04:00−04:00
PY-2516-05740America/Asuncion−04:00−03:00
CA+484531-0913718America/AtikokanEastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut−05:00−05:00
America/Atka−10:00−09:00Link to America/Adak
BR-1259-03831America/BahiaBahia−03:00−02:00
MX+2048-10515America/Bahia_BanderasMexican Central Time - Bahia de Banderas−06:00−05:00
BB+1306-05937America/Barbados−04:00−04:00
BR-0127-04829America/BelemAmapa, E Para−03:00−03:00
BZ+1730-08812America/Belize−06:00−06:00
CA+5125-05707America/Blanc-SablonAtlantic Standard Time - Quebec - Lower North Shore−04:00−04:00
BR+0249-06040America/Boa_VistaRoraima−04:00−04:00
CO+0436-07405America/Bogota−05:00−05:00
US+433649-1161209America/BoiseMountain Time - south Idaho & east Oregon−07:00−06:00
America/Buenos_Aires−03:00−03:00Link toAmerica/Argentina/Buenos_Aires
CA+690650-1050310America/Cambridge_BayMountain Time - west Nunavut−07:00−06:00
BR-2027-05437America/Campo_GrandeMato Grosso do Sul−04:00−03:00
MX+2105-08646America/CancunCentral Time - Quintana Roo−06:00−05:00
VE+1030-06656America/Caracas−04:30−04:30
America/Catamarca−03:00−03:00Link toAmerica/Argentina/Catamarca
GF+0456-05220America/Cayenne−03:00−03:00
KY+1918-08123America/Cayman−05:00−05:00
US+415100-0873900America/ChicagoCentral Time−06:00−05:00
MX+2838-10605America/ChihuahuaMexican Mountain Time - Chihuahua away from US border−07:00−06:00
America/Coral_Harbour−05:00−05:00Link to America/Atikokan
America/Cordoba−03:00−03:00Link toAmerica/Argentina/Cordoba
CR+0956-08405America/Costa_Rica−06:00−06:00
CA+4906-11631America/CrestonMountain Standard Time - Creston, British Columbia−07:00−07:00
BR-1535-05605America/CuiabaMato Grosso−04:00−03:00
CW+1211-06900America/Curacao−04:00−04:00
GL+7646-01840America/Danmarkshavneast coast, north of Scoresbysund+00:00+00:00
CA+6404-13925America/DawsonPacific Time - north Yukon−08:00−07:00
CA+5946-12014America/Dawson_CreekMountain Standard Time - Dawson Creek & Fort Saint John, British Columbia−07:00−07:00
US+394421-1045903America/DenverMountain Time−07:00−06:00
US+421953-0830245America/DetroitEastern Time - Michigan - most locations−05:00−04:00
DM+1518-06124America/Dominica−04:00−04:00
CA+5333-11328America/EdmontonMountain Time - Alberta, east British Columbia & west Saskatchewan−07:00−06:00
BR-0640-06952America/EirunepeW Amazonas−04:00−04:00
SV+1342-08912America/El_Salvador−06:00−06:00
America/Ensenada−08:00−07:00Link to America/Tijuana
America/Fort_Wayne−05:00−04:00Link toAmerica/Indiana/Indianapolis
BR-0343-03830America/FortalezaNE Brazil (MA, PI, CE, RN, PB)−03:00−03:00
CA+4612-05957America/Glace_BayAtlantic Time - Nova Scotia - places that did not observe DST 1966-1971−04:00−03:00
GL+6411-05144America/Godthabmost locations−03:00−02:00
CA+5320-06025America/Goose_BayAtlantic Time - Labrador - most locations−04:00−03:00
TC+2128-07108America/Grand_Turk−05:00−04:00
GD+1203-06145America/Grenada−04:00−04:00
GP+1614-06132America/Guadeloupe−04:00−04:00
GT+1438-09031America/Guatemala−06:00−06:00
EC-0210-07950America/Guayaquilmainland−05:00−05:00
GY+0648-05810America/Guyana−04:00−04:00
CA+4439-06336America/HalifaxAtlantic Time - Nova Scotia (most places), PEI−04:00−03:00
CU+2308-08222America/Havana−05:00−04:00
MX+2904-11058America/HermosilloMountain Standard Time - Sonora−07:00−07:00
US+394606-0860929America/Indiana/IndianapolisEastern Time - Indiana - most locations−05:00−04:00
US+411745-0863730America/Indiana/KnoxCentral Time - Indiana - Starke County−06:00−05:00
US+382232-0862041America/Indiana/MarengoEastern Time - Indiana - Crawford County−05:00−04:00
US+382931-0871643America/Indiana/PetersburgEastern Time - Indiana - Pike County−05:00−04:00
US+375711-0864541America/Indiana/Tell_CityCentral Time - Indiana - Perry County−06:00−05:00
US+384452-0850402America/Indiana/VevayEastern Time - Indiana - Switzerland County−05:00−04:00
US+384038-0873143America/Indiana/VincennesEastern Time - Indiana - Daviess, Dubois, Knox & Martin Counties−05:00−04:00
US+410305-0863611America/Indiana/WinamacEastern Time - Indiana - Pulaski County−05:00−04:00
America/Indianapolis−05:00−04:00Link toAmerica/Indiana/Indianapolis
CA+682059-1334300America/InuvikMountain Time - west Northwest Territories−07:00−06:00
CA+6344-06828America/IqaluitEastern Time - east Nunavut - most locations−05:00−04:00
JM+1800-07648America/Jamaica−05:00−05:00
America/Jujuy−03:00−03:00Link to America/Argentina/Jujuy
US+581807-1342511America/JuneauAlaska Time - Alaska panhandle−09:00−08:00
US+381515-0854534America/Kentucky/LouisvilleEastern Time - Kentucky - Louisville area−05:00−04:00
US+364947-0845057America/Kentucky/MonticelloEastern Time - Kentucky - Wayne County−05:00−04:00
America/Knox_IN−06:00−05:00Link to America/Indiana/Knox
BQ+120903-0681636America/Kralendijk−04:00−04:00Link to America/Curacao
BO-1630-06809America/La_Paz−04:00−04:00
PE-1203-07703America/Lima−05:00−05:00
US+340308-1181434America/Los_AngelesPacific Time−08:00−07:00
America/Louisville−05:00−04:00Link toAmerica/Kentucky/Louisville
SX+180305-0630250America/Lower_Princes−04:00−04:00Link to America/Curacao
BR-0940-03543America/MaceioAlagoas, Sergipe−03:00−03:00
NI+1209-08617America/Managua−06:00−06:00
BR-0308-06001America/ManausE Amazonas−04:00−04:00
MF+1804-06305America/Marigot−04:00−04:00Link to America/Guadeloupe
MQ+1436-06105America/Martinique−04:00−04:00
MX+2550-09730America/MatamorosUS Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border−06:00−05:00
MX+2313-10625America/MazatlanMountain Time - S Baja, Nayarit, Sinaloa−07:00−06:00
America/Mendoza−03:00−03:00Link toAmerica/Argentina/Mendoza
US+450628-0873651America/MenomineeCentral Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties−06:00−05:00
MX+2058-08937America/MeridaCentral Time - Campeche, Yucatan−06:00−05:00
US+550737-1313435America/MetlakatlaMetlakatla Time - Annette Island−08:00−08:00
MX+1924-09909America/Mexico_CityCentral Time - most locations−06:00−05:00
PM+4703-05620America/Miquelon−03:00−02:00
CA+4606-06447America/MonctonAtlantic Time - New Brunswick−04:00−03:00
MX+2540-10019America/MonterreyMexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border−06:00−05:00
UY-3453-05611America/Montevideo−03:00−02:00
CA+4531-07334America/MontrealEastern Time - Quebec - most locations−05:00−04:00
MS+1643-06213America/Montserrat−04:00−04:00
BS+2505-07721America/Nassau−05:00−04:00
US+404251-0740023America/New_YorkEastern Time−05:00−04:00
CA+4901-08816America/NipigonEastern Time - Ontario & Quebec - places that did not observe DST 1967-1973−05:00−04:00
US+643004-1652423America/NomeAlaska Time - west Alaska−09:00−08:00
BR-0351-03225America/NoronhaAtlantic islands−02:00−02:00
US+471551-1014640America/North_Dakota/BeulahCentral Time - North Dakota - Mercer County−06:00−05:00
US+470659-1011757America/North_Dakota/CenterCentral Time - North Dakota - Oliver County−06:00−05:00
US+465042-1012439America/North_Dakota/New_SalemCentral Time - North Dakota - Morton County (except Mandan area)−06:00−05:00
MX+2934-10425America/OjinagaUS Mountain Time - Chihuahua near US border−07:00−06:00
PA+0858-07932America/Panama−05:00−05:00
CA+6608-06544America/PangnirtungEastern Time - Pangnirtung, Nunavut−05:00−04:00
SR+0550-05510America/Paramaribo−03:00−03:00
US+332654-1120424America/PhoenixMountain Standard Time - Arizona−07:00−07:00
TT+1039-06131America/Port_of_Spain−04:00−04:00
HT+1832-07220America/Port-au-Prince−05:00−04:00
America/Porto_Acre−04:00−04:00Link to America/Rio_Branco
BR-0846-06354America/Porto_VelhoRondonia−04:00−04:00
PR+182806-0660622America/Puerto_Rico−04:00−04:00
CA+4843-09434America/Rainy_RiverCentral Time - Rainy River & Fort Frances, Ontario−06:00−05:00
CA+624900-0920459America/Rankin_InletCentral Time - central Nunavut−06:00−05:00
BR-0803-03454America/RecifePernambuco−03:00−03:00
CA+5024-10439America/ReginaCentral Standard Time - Saskatchewan - most locations−06:00−06:00
CA+744144-0944945America/ResoluteCentral Standard Time - Resolute, Nunavut−06:00−05:00
BR-0958-06748America/Rio_BrancoAcre−04:00−04:00
America/Rosario−03:00−03:00Link toAmerica/Argentina/Cordoba
MX+3018-11452America/Santa_IsabelMexican Pacific Time - Baja California away from US border−08:00−07:00
BR-0226-05452America/SantaremW Para−03:00−03:00
CL-3327-07040America/Santiagomost locations−04:00−03:00
DO+1828-06954America/Santo_Domingo−04:00−04:00
BR-2332-04637America/Sao_PauloS & SE Brazil (GO, DF, MG, ES, RJ, SP, PR, SC, RS)−03:00−02:00
GL+7029-02158America/ScoresbysundScoresbysund / Ittoqqortoormiit−01:00+00:00
US+364708-1084111America/ShiprockMountain Time - Navajo−07:00−06:00Link to America/Denver
US+571035-1351807America/SitkaAlaska Time - southeast Alaska panhandle−09:00−08:00
BL+1753-06251America/St_Barthelemy−04:00−04:00Link to America/Guadeloupe
CA+4734-05243America/St_JohnsNewfoundland Time, including SE Labrador−03:30−02:30
KN+1718-06243America/St_Kitts−04:00−04:00
LC+1401-06100America/St_Lucia−04:00−04:00
VI+1821-06456America/St_Thomas−04:00−04:00
VC+1309-06114America/St_Vincent−04:00−04:00
CA+5017-10750America/Swift_CurrentCentral Standard Time - Saskatchewan - midwest−06:00−06:00
HN+1406-08713America/Tegucigalpa−06:00−06:00
GL+7634-06847America/ThuleThule / Pituffik−04:00−03:00
CA+4823-08915America/Thunder_BayEastern Time - Thunder Bay, Ontario−05:00−04:00
MX+3232-11701America/TijuanaUS Pacific Time - Baja California near US border−08:00−07:00
CA+4339-07923America/TorontoEastern Time - Ontario - most locations−05:00−04:00
VG+1827-06437America/Tortola−04:00−04:00
CA+4916-12307America/VancouverPacific Time - west British Columbia−08:00−07:00
America/Virgin−04:00−04:00Link to America/St_Thomas
CA+6043-13503America/WhitehorsePacific Time - south Yukon−08:00−07:00
CA+4953-09709America/WinnipegCentral Time - Manitoba & west Ontario−06:00−05:00
US+593249-1394338America/YakutatAlaska Time - Alaska panhandle neck−09:00−08:00
CA+6227-11421America/YellowknifeMountain Time - central Northwest Territories−07:00−06:00
AQ-6617+11031Antarctica/CaseyCasey Station, Bailey Peninsula+11:00+08:00
AQ-6835+07758Antarctica/DavisDavis Station, Vestfold Hills+05:00+07:00
AQ-6640+14001Antarctica/DumontDUrvilleDumont-d'Urville Station, Terre Adelie+10:00+10:00
AQ-5430+15857Antarctica/MacquarieMacquarie Island Station, Macquarie Island+11:00+11:00
AQ-6736+06253Antarctica/MawsonMawson Station, Holme Bay+05:00+05:00
AQ-7750+16636Antarctica/McMurdoMcMurdo Station, Ross Island+12:00+13:00
AQ-6448-06406Antarctica/PalmerPalmer Station, Anvers Island−04:00−03:00
AQ-6734-06808Antarctica/RotheraRothera Station, Adelaide Island−03:00−03:00
AQ-9000+00000Antarctica/South_PoleAmundsen-Scott Station, South Pole+12:00+13:00Link to Antarctica/McMurdo
AQ-690022+0393524Antarctica/SyowaSyowa Station, E Ongul I+03:00+03:00
AQ-7824+10654Antarctica/VostokVostok Station, Lake Vostok+06:00+06:00
SJ+7800+01600Arctic/Longyearbyen+01:00+02:00Link to Europe/Oslo
YE+1245+04512Asia/Aden+03:00+03:00
KZ+4315+07657Asia/Almatymost locations+06:00+06:00
JO+3157+03556Asia/Amman+02:00+03:00
RU+6445+17729Asia/AnadyrMoscow+08 - Bering Sea+12:00+12:00
KZ+4431+05016Asia/AqtauAtyrau (Atirau, Gur'yev), Mangghystau (Mankistau)+05:00+05:00
KZ+5017+05710Asia/AqtobeAqtobe (Aktobe)+05:00+05:00
TM+3757+05823Asia/Ashgabat+05:00+05:00
Asia/Ashkhabad+05:00+05:00Link to Asia/Ashgabat
IQ+3321+04425Asia/Baghdad+03:00+03:00
BH+2623+05035Asia/Bahrain+03:00+03:00
AZ+4023+04951Asia/Baku+04:00+05:00
TH+1345+10031Asia/Bangkok+07:00+07:00
LB+3353+03530Asia/Beirut+02:00+03:00
KG+4254+07436Asia/Bishkek+06:00+06:00
BN+0456+11455Asia/Brunei+08:00+08:00
Asia/Calcutta+05:30+05:30Link to Asia/Kolkata
MN+4804+11430Asia/ChoibalsanDornod, Sukhbaatar+08:00+08:00
CN+2934+10635Asia/Chongqingcentral China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.+08:00+08:00Covering historic Kansu-Szechuan time zone.
Asia/Chungking+08:00+08:00Link to Asia/Chongqing
LK+0656+07951Asia/Colombo+05:30+05:30
Asia/Dacca+06:00+06:00Link to Asia/Dhaka
SY+3330+03618Asia/Damascus+02:00+03:00
BD+2343+09025Asia/Dhaka+06:00+06:00
TL-0833+12535Asia/Dili+09:00+09:00
AE+2518+05518Asia/Dubai+04:00+04:00
TJ+3835+06848Asia/Dushanbe+05:00+05:00
PS+3130+03428Asia/GazaGaza Strip+02:00+03:00
CN+4545+12641Asia/HarbinHeilongjiang (except Mohe), Jilin+08:00+08:00Covering historic Changpai time zone.
PS+313200+0350542Asia/HebronWest Bank+02:00+03:00
VN+1045+10640Asia/Ho_Chi_Minh+07:00+07:00
HK+2217+11409Asia/Hong_Kong+08:00+08:00
MN+4801+09139Asia/HovdBayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan+07:00+07:00
RU+5216+10420Asia/IrkutskMoscow+05 - Lake Baikal+09:00+09:00
Asia/Istanbul+02:00+03:00Link to Europe/Istanbul
ID-0610+10648Asia/JakartaJava & Sumatra+07:00+07:00
ID-0232+14042Asia/Jayapurawest New Guinea (Irian Jaya) & Malukus (Moluccas)+09:00+09:00
IL+3146+03514Asia/Jerusalem+02:00+03:00
AF+3431+06912Asia/Kabul+04:30+04:30
RU+5301+15839Asia/KamchatkaMoscow+08 - Kamchatka+12:00+12:00
PK+2452+06703Asia/Karachi+05:00+05:00
CN+3929+07559Asia/Kashgarwest Tibet & Xinjiang+08:00+08:00Covering historic Kunlun time zone.
NP+2743+08519Asia/Kathmandu+05:45+05:45
Asia/Katmandu+05:45+05:45Link to Asia/Kathmandu
IN+2232+08822Asia/Kolkata+05:30+05:30Note: Different zones in history, see Time in India.
RU+5601+09250Asia/KrasnoyarskMoscow+04 - Yenisei River+08:00+08:00
MY+0310+10142Asia/Kuala_Lumpurpeninsular Malaysia+08:00+08:00
MY+0133+11020Asia/KuchingSabah & Sarawak+08:00+08:00
KW+2920+04759Asia/Kuwait+03:00+03:00
Asia/Macao+08:00+08:00Link to Asia/Macau
MO+2214+11335Asia/Macau+08:00+08:00
RU+5934+15048Asia/MagadanMoscow+08 - Magadan+12:00+12:00
ID-0507+11924Asia/Makassareast & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor+08:00+08:00
PH+1435+12100Asia/Manila+08:00+08:00
OM+2336+05835Asia/Muscat+04:00+04:00
CY+3510+03322Asia/Nicosia+02:00+03:00
RU+5345+08707Asia/NovokuznetskMoscow+03 - Novokuznetsk+07:00+07:00
RU+5502+08255Asia/NovosibirskMoscow+03 - Novosibirsk+07:00+07:00
RU+5500+07324Asia/OmskMoscow+03 - west Siberia+07:00+07:00
KZ+5113+05121Asia/OralWest Kazakhstan+05:00+05:00
KH+1133+10455Asia/Phnom_Penh+07:00+07:00
ID-0002+10920Asia/Pontianakwest & central Borneo+07:00+07:00
KP+3901+12545Asia/Pyongyang+09:00+09:00
QA+2517+05132Asia/Qatar+03:00+03:00
KZ+4448+06528Asia/QyzylordaQyzylorda (Kyzylorda, Kzyl-Orda)+06:00+06:00
MM+1647+09610Asia/Rangoon+06:30+06:30
SA+2438+04643Asia/Riyadh+03:00+03:00
Asia/Saigon+07:00+07:00Link to Asia/Ho_Chi_Minh
RU+4658+14242Asia/SakhalinMoscow+07 - Sakhalin Island+11:00+11:00
UZ+3940+06648Asia/Samarkandwest Uzbekistan+05:00+05:00
KR+3733+12658Asia/Seoul+09:00+09:00
CN+3114+12128Asia/Shanghaieast China - Beijing, Guangdong, Shanghai, etc.+08:00+08:00Covering historic Chungyuan time zone.
SG+0117+10351Asia/Singapore+08:00+08:00
TW+2503+12130Asia/Taipei+08:00+08:00
UZ+4120+06918Asia/Tashkenteast Uzbekistan+05:00+05:00
GE+4143+04449Asia/Tbilisi+04:00+04:00
IR+3540+05126Asia/Tehran+03:30+04:30
Asia/Tel_Aviv+02:00+03:00Link to Asia/Jerusalem
Asia/Thimbu+06:00+06:00Link to Asia/Thimphu
BT+2728+08939Asia/Thimphu+06:00+06:00
JP+353916+1394441Asia/Tokyo+09:00+09:00
Asia/Ujung_Pandang+08:00+08:00Link to Asia/Makassar
MN+4755+10653Asia/Ulaanbaatarmost locations+08:00+08:00
Asia/Ulan_Bator+08:00+08:00Link to Asia/Ulaanbaatar
CN+4348+08735Asia/Urumqimost of Tibet & Xinjiang+08:00+08:00Covering historic Sinkiang-Tibettime zone.
LA+1758+10236Asia/Vientiane+07:00+07:00
RU+4310+13156Asia/VladivostokMoscow+07 - Amur River+11:00+11:00
RU+6200+12940Asia/YakutskMoscow+06 - Lena River+10:00+10:00
RU+5651+06036Asia/YekaterinburgMoscow+02 - Urals+06:00+06:00
AM+4011+04430Asia/Yerevan+04:00+04:00
PT+3744-02540Atlantic/AzoresAzores−01:00+00:00
BM+3217-06446Atlantic/Bermuda−04:00−03:00
ES+2806-01524Atlantic/CanaryCanary Islands+00:00+01:00
CV+1455-02331Atlantic/Cape_Verde−01:00−01:00
Atlantic/Faeroe+00:00+01:00Link to Atlantic/Faroe
FO+6201-00646Atlantic/Faroe+00:00+01:00
Atlantic/Jan_Mayen+01:00+02:00Link to Europe/Oslo
PT+3238-01654Atlantic/MadeiraMadeira Islands+00:00+01:00
IS+6409-02151Atlantic/Reykjavik+00:00+00:00
GS-5416-03632Atlantic/South_Georgia−02:00−02:00
SH-1555-00542Atlantic/St_Helena+00:00+00:00
FK-5142-05751Atlantic/Stanley−03:00−03:00
Australia/ACT+10:00+11:00Link to Australia/Sydney
AU-3455+13835Australia/AdelaideSouth Australia+09:30+10:30
AU-2728+15302Australia/BrisbaneQueensland - most locations+10:00+10:00
AU-3157+14127Australia/Broken_HillNew South Wales - Yancowinna+09:30+10:30
Australia/Canberra+10:00+11:00Link to Australia/Sydney
AU-3956+14352Australia/CurrieTasmania - King Island+10:00+11:00
AU-1228+13050Australia/DarwinNorthern Territory+09:30+09:30
AU-3143+12852Australia/EuclaWestern Australia - Eucla area+08:45+08:45
AU-4253+14719Australia/HobartTasmania - most locations+10:00+11:00
Australia/LHI+10:30+11:00Link to Australia/Lord_Howe
AU-2016+14900Australia/LindemanQueensland - Holiday Islands+10:00+10:00
AU-3133+15905Australia/Lord_HoweLord Howe Island+10:30+11:00
AU-3749+14458Australia/MelbourneVictoria+10:00+11:00
Australia/North+09:30+09:30Link to Australia/Darwin
Australia/NSW+10:00+11:00Link to Australia/Sydney
AU-3157+11551Australia/PerthWestern Australia - most locations+08:00+08:00
Australia/Queensland+10:00+10:00Link to Australia/Brisbane
Australia/South+09:30+10:30Link to Australia/Adelaide
AU-3352+15113Australia/SydneyNew South Wales - most locations+10:00+11:00
Australia/Tasmania+10:00+11:00Link to Australia/Hobart
Australia/Victoria+10:00+11:00Link to Australia/Melbourne
Australia/West+08:00+08:00Link to Australia/Perth
Australia/Yancowinna+09:30+10:30Link to Australia/Broken_Hill
Brazil/Acre−04:00−04:00Link to America/Rio_Branco
Brazil/DeNoronha−02:00−02:00Link to America/Noronha
Brazil/East−03:00−02:00Link to America/Sao_Paulo
Brazil/West−04:00−04:00Link to America/Manaus
Canada/Atlantic−04:00−03:00Link to America/Halifax
Canada/Central−06:00−05:00Link to America/Winnipeg
Canada/Eastern−05:00−04:00Link to America/Toronto
Canada/East-Saskatchewan−06:00−06:00Link to America/Regina
Canada/Mountain−07:00−06:00Link to America/Edmonton
Canada/Newfoundland−03:30−02:30Link to America/St_Johns
Canada/Pacific−08:00−07:00Link to America/Vancouver
Canada/Saskatchewan−06:00−06:00Link to America/Regina
Canada/Yukon−08:00−07:00Link to America/Whitehorse
CET+01:00+02:00
Chile/Continental−04:00−03:00Link to America/Santiago
Chile/EasterIsland−06:00−05:00Link to Pacific/Easter
CST6CDT−06:00−05:00
Cuba−05:00−04:00Link to America/Havana
EET+02:00+03:00
Egypt+02:00+02:00Link to Africa/Cairo
Eire+00:00+01:00Link to Europe/Dublin
EST−05:00−05:00
EST5EDT−05:00−04:00
Etc/GMT+00:00+00:00Link to UTC
Etc/GMT+0+00:00+00:00Link to UTC
Etc/UCT+00:00+00:00Link to UTC
Etc/Universal+00:00+00:00Link to UTC
Etc/UTC+00:00+00:00Link to UTC
Etc/Zulu+00:00+00:00Link to UTC
NL+5222+00454Europe/Amsterdam+01:00+02:00
AD+4230+00131Europe/Andorra+01:00+02:00
GR+3758+02343Europe/Athens+02:00+03:00
Europe/Belfast+00:00+01:00Link to Europe/London
RS+4450+02030Europe/Belgrade+01:00+02:00
DE+5230+01322Europe/Berlin+01:00+02:00In 1945, the Trizone did not follow Berlin's switch to DST, see Time in Germany
SK+4809+01707Europe/Bratislava+01:00+02:00Link to Europe/Prague
BE+5050+00420Europe/Brussels+01:00+02:00
RO+4426+02606Europe/Bucharest+02:00+03:00
HU+4730+01905Europe/Budapest+01:00+02:00
MD+4700+02850Europe/Chisinau+02:00+03:00
DK+5540+01235Europe/Copenhagen+01:00+02:00
IE+5320-00615Europe/Dublin+00:00+01:00
GI+3608-00521Europe/Gibraltar+01:00+02:00
GG+4927-00232Europe/Guernsey+00:00+01:00Link to Europe/London
FI+6010+02458Europe/Helsinki+02:00+03:00
IM+5409-00428Europe/Isle_of_Man+00:00+01:00Link to Europe/London
TR+4101+02858Europe/Istanbul+02:00+03:00
JE+4912-00207Europe/Jersey+00:00+01:00Link to Europe/London
RU+5443+02030Europe/KaliningradMoscow-01 - Kaliningrad+03:00+03:00
UA+5026+03031Europe/Kievmost locations+02:00+03:00
PT+3843-00908Europe/Lisbonmainland+00:00+01:00
SI+4603+01431Europe/Ljubljana+01:00+02:00Link to Europe/Belgrade
GB+513030-0000731Europe/London+00:00+01:00
LU+4936+00609Europe/Luxembourg+01:00+02:00
ES+4024-00341Europe/Madridmainland+01:00+02:00
MT+3554+01431Europe/Malta+01:00+02:00
AX+6006+01957Europe/Mariehamn+02:00+03:00Link to Europe/Helsinki
BY+5354+02734Europe/Minsk+03:00+03:00
MC+4342+00723Europe/Monaco+01:00+02:00
RU+5545+03735Europe/MoscowMoscow+00 - west Russia+04:00+04:00
Europe/Nicosia+02:00+03:00Link to Asia/Nicosia
NO+5955+01045Europe/Oslo+01:00+02:00
FR+4852+00220Europe/Paris+01:00+02:00
ME+4226+01916Europe/Podgorica+01:00+02:00Link to Europe/Belgrade
CZ+5005+01426Europe/Prague+01:00+02:00
LV+5657+02406Europe/Riga+02:00+03:00
IT+4154+01229Europe/Rome+01:00+02:00
RU+5312+05009Europe/SamaraMoscow+00 - Samara, Udmurtia+04:00+04:00
SM+4355+01228Europe/San_Marino+01:00+02:00Link to Europe/Rome
BA+4352+01825Europe/Sarajevo+01:00+02:00Link to Europe/Belgrade
UA+4457+03406Europe/Simferopolcentral Crimea+02:00+03:00
MK+4159+02126Europe/Skopje+01:00+02:00Link to Europe/Belgrade
BG+4241+02319Europe/Sofia+02:00+03:00
SE+5920+01803Europe/Stockholm+01:00+02:00
EE+5925+02445Europe/Tallinn+02:00+03:00
AL+4120+01950Europe/Tirane+01:00+02:00
Europe/Tiraspol+02:00+03:00Link to Europe/Chisinau
UA+4837+02218Europe/UzhgorodRuthenia+02:00+03:00
LI+4709+00931Europe/Vaduz+01:00+02:00
VA+415408+0122711Europe/Vatican+01:00+02:00Link to Europe/Rome
AT+4813+01620Europe/Vienna+01:00+02:00
LT+5441+02519Europe/Vilnius+02:00+03:00
RU+4844+04425Europe/VolgogradMoscow+00 - Caspian Sea+04:00+04:00
PL+5215+02100Europe/Warsaw+01:00+02:00
HR+4548+01558Europe/Zagreb+01:00+02:00Link to Europe/Belgrade
UA+4750+03510Europe/ZaporozhyeZaporozh'ye, E Lugansk / Zaporizhia, E Luhansk+02:00+03:00
CH+4723+00832Europe/Zurich+01:00+02:00
GB+00:00+01:00Link to Europe/London
GB-Eire+00:00+01:00Link to Europe/London
GMT+00:00+00:00Link to UTC
GMT+0+00:00+00:00Link to UTC
GMT0+00:00+00:00Link to UTC
GMT-0+00:00+00:00Link to UTC
Greenwich+00:00+00:00Link to UTC
Hongkong+08:00+08:00Link to Asia/Hong_Kong
HST−10:00−10:00
Iceland+00:00+00:00Link to Atlantic/Reykjavik
MG-1855+04731Indian/Antananarivo+03:00+03:00
IO-0720+07225Indian/Chagos+06:00+06:00
CX-1025+10543Indian/Christmas+07:00+07:00
CC-1210+09655Indian/Cocos+06:30+06:30
KM-1141+04316Indian/Comoro+03:00+03:00
TF-492110+0701303Indian/Kerguelen+05:00+05:00
SC-0440+05528Indian/Mahe+04:00+04:00
MV+0410+07330Indian/Maldives+05:00+05:00
MU-2010+05730Indian/Mauritius+04:00+04:00
YT-1247+04514Indian/Mayotte+03:00+03:00
RE-2052+05528Indian/Reunion+04:00+04:00
Iran+03:30+04:30Link to Asia/Tehran
Israel+02:00+03:00Link to Asia/Jerusalem
Jamaica−05:00−05:00Link to America/Jamaica
Japan+09:00+09:00Link to Asia/Tokyo
JST-9+09:00+09:00Link to Asia/Tokyo
Kwajalein+12:00+12:00Link to Pacific/Kwajalein
Libya+02:00+02:00Link to Africa/Tripoli
MET+01:00+02:00
Mexico/BajaNorte−08:00−07:00Link to America/Tijuana
Mexico/BajaSur−07:00−06:00Link to America/Mazatlan
Mexico/General−06:00−05:00Link to America/Mexico_City
MST−07:00−07:00
MST7MDT−07:00−06:00
Navajo−07:00−06:00Link to America/Denver
NZ+12:00+13:00Link to Pacific/Auckland
NZ-CHAT+12:45+13:45Link to Pacific/Chatham
WS-1350-17144Pacific/Apia+13:00+14:00
NZ-3652+17446Pacific/Aucklandmost locations+12:00+13:00
NZ-4357-17633Pacific/ChathamChatham Islands+12:45+13:45
FM+0725+15147Pacific/ChuukChuuk (Truk) and Yap+10:00+10:00
CL-2709-10926Pacific/EasterEaster Island & Sala y Gomez−06:00−05:00
VU-1740+16825Pacific/Efate+11:00+11:00
KI-0308-17105Pacific/EnderburyPhoenix Islands+13:00+13:00
TK-0922-17114Pacific/Fakaofo+13:00+13:00
FJ-1808+17825Pacific/Fiji+12:00+13:00
TV-0831+17913Pacific/Funafuti+12:00+12:00
EC-0054-08936Pacific/GalapagosGalapagos Islands−06:00−06:00
PF-2308-13457Pacific/GambierGambier Islands−09:00−09:00
SB-0932+16012Pacific/Guadalcanal+11:00+11:00
GU+1328+14445Pacific/Guam+10:00+10:00
US+211825-1575130Pacific/HonoluluHawaii−10:00−10:00
UM+1645-16931Pacific/JohnstonJohnston Atoll−10:00−10:00
KI+0152-15720Pacific/KiritimatiLine Islands+14:00+14:00
FM+0519+16259Pacific/KosraeKosrae+11:00+11:00
MH+0905+16720Pacific/KwajaleinKwajalein+12:00+12:00
MH+0709+17112Pacific/Majuromost locations+12:00+12:00
PF-0900-13930Pacific/MarquesasMarquesas Islands−09:30−09:30
UM+2813-17722Pacific/MidwayMidway Islands−11:00−11:00
NR-0031+16655Pacific/Nauru+12:00+12:00
NU-1901-16955Pacific/Niue−11:00−11:00
NF-2903+16758Pacific/Norfolk+11:30+11:30
NC-2216+16627Pacific/Noumea+11:00+11:00
AS-1416-17042Pacific/Pago_Pago−11:00−11:00
PW+0720+13429Pacific/Palau+09:00+09:00
PN-2504-13005Pacific/Pitcairn−08:00−08:00
FM+0658+15813Pacific/PohnpeiPohnpei (Ponape)+11:00+11:00
Pacific/Ponape+11:00+11:00Link to Pacific/Pohnpei
PG-0930+14710Pacific/Port_Moresby+10:00+10:00
CK-2114-15946Pacific/Rarotonga−10:00−10:00
MP+1512+14545Pacific/Saipan+10:00+10:00
Pacific/Samoa−11:00−11:00Link to Pacific/Pago_Pago
PF-1732-14934Pacific/TahitiSociety Islands−10:00−10:00
KI+0125+17300Pacific/TarawaGilbert Islands+12:00+12:00
TO-2110-17510Pacific/Tongatapu+13:00+13:00
Pacific/Truk+10:00+10:00Link to Pacific/Chuuk
UM+1917+16637Pacific/WakeWake Island+12:00+12:00
WF-1318-17610Pacific/Wallis+12:00+12:00
Pacific/Yap+10:00+10:00Link to Pacific/Chuuk
Poland+01:00+02:00Link to Europe/Warsaw
Portugal+00:00+01:00Link to Europe/Lisbon
PRC+08:00+08:00Link to Asia/Shanghai
PST8PDT−08:00−07:00
ROC+08:00+08:00Link to Asia/Taipei
ROK+09:00+09:00Link to Asia/Seoul
Singapore+08:00+08:00Link to Asia/Singapore
Turkey+02:00+03:00Link to Europe/Istanbul
UCT+00:00+00:00Link to UTC
Universal+00:00+00:00Link to UTC
US/Alaska−09:00−08:00Link to America/Anchorage
US/Aleutian−10:00−09:00Link to America/Adak
US/Arizona−07:00−07:00Link to America/Phoenix
US/Central−06:00−05:00Link to America/Chicago
US/Eastern−05:00−04:00Link to America/New_York
US/East-Indiana−05:00−04:00Link toAmerica/Indiana/Indianapolis
US/Hawaii−10:00−10:00Link to Pacific/Honolulu
US/Indiana-Starke−06:00−05:00Link to America/Indiana/Knox
US/Michigan−05:00−04:00Link to America/Detroit
US/Mountain−07:00−06:00Link to America/Denver
US/Pacific−08:00−07:00Link to America/Los_Angeles
US/Pacific-New−08:00−07:00Link to America/Los_Angeles
US/Samoa−11:00−11:00Link to Pacific/Pago_Pago
UTC+00:00+00:00
WET+00:00+01:00
W-SU+04:00+04:00Link to Europe/Moscow
Zulu+00:00+00:00Link to UTC



Number of zones/links by region
RegionZonesLinksTotal
Africa52254
America14321164
Antarctica10111
Arctic011
Asia771289
Atlantic10212
Australia121123
Europe431558
Indian11011
Pacific38442
Misc127183
Total408140548


Posted by 땡보
2013. 11. 5. 09:15
Posted by 땡보
2013. 9. 12. 04:52

원문출처 : http://blog.daum.net/maleny/89


최근에 인터넷을 배회하다가 저가의 타블렛 PC 하나를 발견하고 앱 개발 테스트용으로 사용하고
다니면서 E-BOOK 이나 읽을 용도로 구입했다.

자체 데이터 통신 기능도 없고 전화기능도 없고 당연히 DMB도 안되고 GPS 도 안되지만 
KT 의 Egg 를 들고 다니니까 Wi-Fi 를 이용한 웹 서핑 등 여러가지 필요는 충족 시킬 수 있을 것이라 판단했다.

일단 인터넷 연결을 통한 여러가지 필요한 작업은 만족 스러웠고
AlphaBiz 의 Mobile Client 역활도 잘 수행한다.
다만 스마트폰의 사이즈에 맞게 앱을 만들엇기에 큰 기기에서는 화면이 영 개판 오분..

하긴 이 타블렛을 산 이유도 이 개판 오분전을 잡기 위해서 이었지만.

문제는 이 타블렛 PC 가 컴퓨터에 설치가 안된다는 것이다.
물론 USB 케이블로 연결해 외장메모리로 사용은 된다.
그러나 앱을 개발해서 탑재하고 돌릴려면 기기가 컴퓨터에 설치가 되어야 하는데..
판매처에서 드라이버를 제공하지 않는다.

아니 제공은 커녕 게시판에 문의를 해도 도통 무슨 말을 하는지 이해 조차 하지 못하니..

여태까지는 뭐 삼숑, 엘디, 쓰까이 등등 유명 브랜드들이 만든 고가의 고급 제품들이 주류를 이루고 있고
당연히 필요한 모든 드라이버나 유용한 앱들을 기본적으로 제공되고 있고 사용자 모임 같은 카페도
활성화 되어있고 개발자들도 유명 브랜드 기기를 위주로 정보를 제공하고 있으니 문제가 없겠지만

앞으로 이처럼 저가의 보급형 기기가 쏟아져 나오게 되면
이와 같은 문제가 많이 발생할 것으로 여겨진다.

개발자들이 프로그램 개발에 대해서는 빠삭하지만 하드웨어 쪽으로 들어가면 버벅거리는 경우가 다수이고
또 초보자들이 야심차게 구입해서 앱 개발을 하려고 하는데 가장 기본적인 문제가 해결이 안되면
의욕도 상실하게 되고 성질 뻗치게 되고 마음 상하고 몸 상하는 비극이 초래할 수도 있다.

사실 나도 이 문제를 해결하기 전까지는 18 이 분당 수십번 입에서 발사되고
웹사이트를 헤메고 다니다 그냥 성질 뻗쳐서 확 컴퓨터를 꺼 버리고.
판매자 사이트에 성질도 부리고.. 

결국 약간씩의 정보를 모으고 모으고 검색하고 접근해 들어가다가
영문 사이트 (게시물이 딱 하나 있드만)를 찾아냈고 해석하고 분석하고 해보고 결국에 성공했다.
성공하자 마자 그냥 컴퓨터를 확 꺼버리고 퇴근했다.

아 친절한 알파비즈는 이렇게 발견한 정보를 친절하게 강좌한다. 것도 아주 디테일 하게..

일단 안드로이드 기기에서 개발자옵션 에서 USB 가 연결되었을 경우 디버그 모드로 연결 될 수 있도록 해준다. (기본상식)
다음 컴퓨터와 USB 를 연결하면 드라이버를 설치하라고 나온다.
아무리 찾아 봐도 맞는 드라이버를 찾을 수 없다.
설치하지 않고 끝내 버린다.

그리고 제어판의 시스템 -> 하드웨어 -> 장치관리자를 보면

 

 

 이렇게 기타 장치에 Android 라고 드라이버가 설치되지 않은 상태이거나


 

 


이렇게 Android Phone 아래에 Android 라고 드라이버가 설치되지 않은 상태로 표시가 되어있다.


자 위의 어떤 경우가 되었가나 암튼 Android 기기를 선택하고 마우스 오른쪽 버튼을 눌러서 속성을 선택한다.

 

 


위와 같이 Android 등록정보 창이 뜨면 '자세히'라는 탭을 선택하고 밑의 셀렉션에서 하드웨어 ID 를 선택한다.
그러면 위와 같이 두 줄의 뭔가가 나타나게 된다.
그냥 위 상태로 열어놓고.

다음엔 워드패드나 사용하는 텍스트에디터를 실행시킨 후 안드로이드 팩키지가 설치된 폴더 밑에
Android\android-sdk\extras\google\usb-driver\android_winusb.inf 파일을 연다.

자 이 파일은 android-sdk 의 SDK Manager.exe 를 실행했을 때
Installed package 에 Google USB Driver Package, revision 3 이상이 설치되어 있어야 한다.
없으면 구글이나 여러 사이트에서 쉽게 설치할 수 있다.

자 에디터로 연 android_winusb.inf 파일을 보자

 


 위의 붉은 글씨가 중요하다.
 일단 [Goolgle.NTx86] 라는 카테고리가 있고 [Google.NTamd64] 라는 카테고리가 있다.
 앞의 것은 32비트 OS (Window 98, XP, Vista) 용 카테고리이고
 뒤의 것은 64비트 OS (Windows NT Server, Windows 7) 용 카테고리이다.
 
 그 카테고리 명 바로 밑에 위의 붉은 부분 같이 네줄을 기록하는데.

;NOTE K   : 주석으로 기기명을 넣든지 맘대로 넣으면 된다.
%SingleAdbInterface%        = USB_Install, USB\VID_18d1&PID_0003&MI_01
%CompositeAdbInterface%     = USB_Install,
 USB\VID_18d1&PID_0003&REV_9999&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0FFF

%SingleAdbInterface% 항목에는 USB_Install, 뒤에 아까 제어판에서 확인했던 Android 등록정보의 
하드웨어 ID 값의 두번째 줄의 값을 기록하고
%CompositeAdbInterface% 항목에는 하드웨어 ID 값의 첫번째 줄의 값을 기록한다.
%SingleBootLoaderInterface% 는 위와 같이 기록하면 된다.

복잡하니까 원래 있었던 
;HTC Dream 밑의 세줄을 복사해서 위에 붙혀놓고 붉은색 부분만 편집해도 된다.

자 편집한 이 네줄을 또 복사해서 아래에 있는 [Google.NTamd64] 에도 붙혀놓는다.
OS 가 32이건 64이건 그냥 그렇게 한다.

그리고 저장하고 편집기를 닫고
다시 아까 제어판의 장치관리자로가서 Android 등록정보 창에 가서 일반탭을 선택하고 '드라이버 다시 설치'를 선택한다.

-> 아니오, 지금 연결 안함 -> 다음
-> 목록 또는 특정 위치에서 설치(고급) -> 다음
-> 이 위치에서 가장 적합한 드라이버 검색을 선택하고 검색할 때 다음 위치 포함에 체크한 후 찾아보기 

아까 편집한 android_iwnusb.inf 파일이 있는
Android\android-sdk\extras\google\usb-driver 폴더를 선택한다. 아래 처럼.

 


 다음을 누르면 Android Composite ADB Interface 라는 기기로 설치가 시작된다. 

 

 


 성공적으로 설치를 완료한 상태이다.
 때에 따라 이 상황에서 재 부팅을 요구하고 다시 드라이버를 설치하라고 할 수 있다.
 그러면 재부팅하고 다시 위에서 처럼 드라이버를 재 설치하면 된다.

 다시 장치관리자를 보면

 

 위와 같이 Android Phone 아래 Android Composite ADB Interface 의 기기가 설치되어 있다.

 이클립스를 열어 개발된 앱하나를 수행해 보면
 앱이 컴파일 되고 기기에 설치되면서 작동되는 것을 볼 수 있다.

 짝짝짝..   성공!!

'Study > mobile' 카테고리의 다른 글

음.. 뽀꼬빵  (0) 2013.12.22
[연습]포코팡 오토(?) POKOPANG AUTO~  (3) 2013.12.17
[android]change system date & time  (0) 2013.11.19
[Android]Monkeyrunner  (0) 2013.11.05
[펌]Synthesizing a touch event on the iPhone  (0) 2012.08.10
Posted by 땡보
2012. 8. 10. 14:20


[원문] : http://cocoawithlove.com/2008/10/synthesizing-touch-event-on-iphone.html

Synthesizing a touch event on the iPhone

The iPhone lacks specific methods to create UIEvent and UITouch objects. I'll show you how to add this functionality so you can write programmatically driven user-interfaces.

Update #1: Added a "Device SDK" version that will link correctly outside of the "Simulator SDK".
Update #2: Two bugs have been fixed since the code was originally posted... the objects in the UIEvent member _keyedTouches are now NSSets and the _view and _window in UITouchare now retained.
Update #3: changes to the UITouch and UIEvent categories as well asperformTouchInView: to support SDK 2.2 changes.
Update #4: Support for SDK 3.0.

A warning before we begin...

The content of this post is for debugging and testing only. Do not submit this code in an application to the App Store. Doing so will likely result in:

  • A bad UI experience for your users.
  • An app that breaks on every OS update.
  • Rejection of your application.

Synthesized touches are never the right way to trigger actions in a real application. The only useful use for this post is in automated user testing (see my later post Automated User Interface Testing on the iPhone).

User-interface testing

When running application tests, it is helpful to be able to generate user events to test your user-interface. That way, you can run user-interface tests automatically instead of manually.

On Cocoa Senior (also known as "the Mac") we have methods like the gargantuan:

    mouseEventWithType:location:modifierFlags:timestamp:
      windowNumber:context:eventNumber:clickCount:pressure:

to generate events.

Cocoa Junior on the iPhone doesn't have any methods like this, so we must work out how to achieve it ourselves.

UITouch category

A basic touch event normally consists of three objects:

  • The UITouch object — which will be used for the touch down and touch up
  • A first UIEvent to wrap the touch down
  • A second UIEvent to wrap the touch up

Lets look first at creating the UITouch object. Since most of the fields in this object are private, we can't sublcass it or set them directly — everything must be done on a category. My category goes something like this:

@implementation UITouch (Synthesize)
 
- (id)initInView:(UIView *)view
{
    self = [super init];
    if (self != nil)
    {
        CGRect frameInWindow;
        if ([view isKindOfClass:[UIWindow class]])
        {
            frameInWindow = view.frame;
        }
        else
        {
            frameInWindow =
                [view.window convertRect:view.frame fromView:view.superview];
        }
          
        _tapCount = 1;
        _locationInWindow =
            CGPointMake(
                frameInWindow.origin.x + 0.5 * frameInWindow.size.width,
                frameInWindow.origin.y + 0.5 * frameInWindow.size.height);
        _previousLocationInWindow = _locationInWindow;
 
        UIView *target = [view.window hitTest:_locationInWindow withEvent:nil];
        _view = [target retain];
        _window = [view.window retain];
        _phase = UITouchPhaseBegan;
        _touchFlags._firstTouchForView = 1;
        _touchFlags._isTap = 1;
        _timestamp = [NSDate timeIntervalSinceReferenceDate];
    }
    return self;
}
 
- (void)changeToPhase:(UITouchPhase)phase
{
    _phase = phase;
    _timestamp = [NSDate timeIntervalSinceReferenceDate];
}
 
@end

This method builds a touch in the center of the specified UIView (window coordinates must be used).

You should note that this category includes the changeToPhase: method. This phase (set toUITouchPhaseBegan in the initInView: method) refers to the begin/drag/ended state of the touch operation. We need a method to change the state because the same UITouch object must be used for touch began and touch ended events (otherwise the whole windowing system crashes).

UIEvent category

The UIEvent object is mostly handled through an existing private method (_initWithEvent:touches:). There are two difficulties with this method though:

  • We must provide it a GSEvent object (or something very close to it)
  • We must allocate the object as a UITouchesEvent on SDK 3.0 and later but as a UIEvent on earlier versions.

Here's how all that will look:

@interface UIEvent (Creation)
- (id)_initWithEvent:(GSEventProxy *)fp8 touches:(id)fp12;
@end
 
@implementation UIEvent (Synthesize)
 
- (id)initWithTouch:(UITouch *)touch
{
    CGPoint location = [touch locationInView:touch.window];
    GSEventProxy *gsEventProxy = [[GSEventProxy alloc] init];
    gsEventProxy->x1 = location.x;
    gsEventProxy->y1 = location.y;
    gsEventProxy->x2 = location.x;
    gsEventProxy->y2 = location.y;
    gsEventProxy->x3 = location.x;
    gsEventProxy->y3 = location.y;
    gsEventProxy->sizeX = 1.0;
    gsEventProxy->sizeY = 1.0;
    gsEventProxy->flags = ([touch phase] == UITouchPhaseEnded) ? 0x1010180 : 0x3010180;
    gsEventProxy->type = 3001;   
     
    //
    // On SDK versions 3.0 and greater, we need to reallocate as a
    // UITouchesEvent.
    //
    Class touchesEventClass = objc_getClass("UITouchesEvent");
    if (touchesEventClass && ![[self class] isEqual:touchesEventClass])
    {
        [self release];
        self = [touchesEventClass alloc];
    }
     
    self = [self _initWithEvent:gsEventProxy touches:[NSSet setWithObject:touch]];
    if (self != nil)
    {
    }
    return self;
}
 
@end

You can see that most of the setup is simply concerned with filling in the fields of the GSEventProxyobject which is the pretend object that we substitute in place of the actual GSEvent object (which can't be easily allocated).

The fields and values used are determined simply by staring at real GSEvent structures in the debugger until the values for fields could be determined.

The definition of this object follows. You'll need to place it before the previous UIEvent category implemention.

@interface GSEventProxy : NSObject
{
@public
    unsigned int flags;
    unsigned int type;
    unsigned int ignored1;
    float x1;
    float y1;
    float x2;
    float y2;
    unsigned int ignored2[10];
    unsigned int ignored3[7];
    float sizeX;
    float sizeY;
    float x3;
    float y3;
    unsigned int ignored4[3];
}
@end
@implementation GSEventProxy
@end

Sending the event

There is no API to route the events to the appropriate view — so we will just invoke the methods directly on the view ourselves.

Using the above categories to create the UITouch and UIEvent objects, dispatching a touch event to a UIView looks like this:

- (void)performTouchInView:(UIView *)view
{
    UITouch *touch = [[UITouch alloc] initInView:view];
    UIEvent *eventDown = [[UIEvent alloc] initWithTouch:touch];
     
    [touch.view touchesBegan:[eventDown allTouches] withEvent:eventDown];
     
    [touch setPhase:UITouchPhaseEnded];
    UIEvent *eventUp = [[UIEvent alloc] initWithTouch:touch];
     
    [touch.view touchesEnded:[eventUp allTouches] withEvent:eventUp];
     
    [eventDown release];
    [eventUp release];
    [touch release];
}

Legality of use and risks

The approach used in this post constitutes using an undisclosed API — it is therefore illegal to submit applications to the App Store that use this approach, according to the iPhone SDK Agreement.

In terms of risks, this type of undisclosed API use has a high probability of breaking on every update to the iPhone OS — yet another reason why this code is for in-house developer use only.

If you use this code, only use it in a separate target for testing purposes only. Do not submit this code to the App Store.

Conclusion

You can download a copy of TouchSynthesis.m as part of the SelfTesting project (from my later post Automated User Interface Testing on the iPhone).

I have only tested this for performing touch events in UITableViewCells in aUINavigationController — navigating a hierarchy to verify that the hierarchy works. Of course, once you've programmatically navigated, you must also read back from the hierarchy to ensure that required features are present — but that's a post for a different time.

Working directly with the fields of a class is always a little risky. I'm sure there are UIViews that won't work well with this type of synthetic touch. Apple is also free to change the meaning of any fields at any time so this code is prone to break frequently.

Finally, remember to keep this type of testing code in a separate target so it isn't included in the application you submit to the App Store. I don't want to see your projects break or be rejected because you're trying to invoke use undisclosed APIs in your final application.

Share this post: reddit:Synthesizing a touch event on the iPhone stumbleupon:Synthesizing a touch event on the iPhone del.icio.us:Synthesizing a touch event on the iPhone digg:Synthesizing a touch event on the iPhone
Dr Nic 
Very cool seeing some "how to poke my app" testing tips.
Saturday, October 18, 2008, 22:02:25
– Like – Reply
Brad 
I have found that this technique works well for simulating clicks to an embedded web view.
Sunday, October 19, 2008, 11:16:40
– Like – Reply
Ross 
I've had difficulty making this work with embedded webviews -- it seems to expect there to be a real GSEventRef, how have you pulled this off Brad?
Thursday, October 30, 2008, 08:51:19
– Like – Reply
Cormac 
Hi, I'm currently trying to implement some automated UI test cases for an iPhone app I have recently written and as far as I can tell, you are the only person to have tried this (UITouch synthesis) and gotten it to work. 
 
I have tried your code and failed and I would be extremely grateful if you could suggest a cause, or better yet, supply me with a working example. I'm hoping you have a simple project you used when writing the article. :-) If I can synthesize a touch event, then it dramatically increased my testing code coverage. 
 
Here is where it all goes wrong for me: 
 
- (void)performTouchInView:(UIView *)view 

UITouch *touch = [[UITouch alloc] initInView:view phase:UITouchPhaseBegan]; 
UIEvent *eventDown = [[UIEvent alloc] initWithTouch:touch]; 
>>> [view touchesBegan:[NSSet setWithObject:touch] withEvent:eventDown]; 
 
When I call touchesBegan: on my view I get the following exception: 
 
*** -[UITouch countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x100cc50 
 
For whatever reason, countByEnumeratingWithState:objects:count: (which belongs to NSFastEnumeration protocol, which is in turn adopted by NSSet) is being called on the UITouch. 
 
Once again, any help you can provide will be gratefully received. 
 
Kind regards, 
Cormac.
Tuesday, November 18, 2008, 02:37:03
– Like – Reply
 Matt Gallagher 
Hi Cormac, 
 
Revisiting this topic to provide an API for proper UI tests has been on my plate for a while. With luck, it'll be this week -- we'll see if I get there. Stay tuned.
Tuesday, November 18, 2008, 09:58:58
– Like – Reply
Cormac 
Matt, 
 
That's great news. I'll look forward to it. Thanks.
Tuesday, November 18, 2008, 17:43:48
– Like – Reply
Lars Bergstrom 
The issue is that the values added via CFDictionaryAddValue for the touch objects need to be the NSSet of the touch, not the touch object itself.
Wednesday, November 19, 2008, 01:37:33
– Like – Reply
 Matt Gallagher 
Thanks for pointing that out, Lars. 
 
Weird that it never caused a bug for me -- I guess it depends on the view upon which you invoke touchesBegan:withEvent:
Wednesday, November 19, 2008, 06:50:46
– Like – Reply
Cormac 
Lars, thanks for that. I tried your fix and it worked perfectly. Thanks for you both.
Thursday, November 20, 2008, 01:50:03
– Like – Reply
Phlix 
Are you sure of update #2? 
In UIEvent.h  we have _keyedTouches defined as a CFMutableDictionaryRef
Sunday, December 21, 2008, 04:20:43
– Like – Reply
 Matt Gallagher 
Hi Phlix. The variable _keyedTouches remains a dictionary. It is only the objects that it contains which have changed to an NSSet.
Sunday, December 21, 2008, 07:15:43
– Like – Reply
Alex 
Hi Matt:  Did you post the updated code anywhere?  My double click code is crashing randomly -- I copied and pasted what you have here and I think it is out of date.
Wednesday, March 18, 2009, 20:11:51
– Like – Reply
 Matt Gallagher 
Alex, the code here is only tested to work with single clicks. Multiple touches, double touches and drag operations all have some quirks that would need to be tested and debug to synthesize properly. I'm afraid this is work I haven't done so you'd have to address these problems yourself.
Sunday, March 22, 2009, 10:29:57
– Like – Reply
Alex 
Hi Matt.  thanks for the response.  I got this technique all working for me, i just had to read the posting very carefully.  double clicks, etc. all working. 
Sunday, March 22, 2009, 11:42:04
– Like – Reply
Andy 
Hi Alex, 
I've been trying to get drags working but am stumped, any source code would be much appreciated...
Wednesday, January 13, 2010, 20:22:05
– Like – Reply


'Study > mobile' 카테고리의 다른 글

음.. 뽀꼬빵  (0) 2013.12.22
[연습]포코팡 오토(?) POKOPANG AUTO~  (3) 2013.12.17
[android]change system date & time  (0) 2013.11.19
[Android]Monkeyrunner  (0) 2013.11.05
[펌]USB 드라이버가 없는 안드로이드 기기의 설치  (0) 2013.09.12
Posted by 땡보