class
MainActivity(metaclass
=
JavaClassDef, jvm_name
=
'com/crackme/bbbbutton/MainActivity'
):
@java_method_def
(name
=
'<init>'
, signature
=
'()V'
)
def
__init__(
self
,
*
args,
*
*
kwargs):
self
.flagRight
=
String(
"flag输入正确"
)
self
.flagWrong
=
String(
"flag输入错误"
)
@staticmethod
@java_method_def
(name
=
'getBytes'
, signature
=
'([B)[B'
, args_list
=
[
'jobject'
])
def
getBytes(mu,
*
args,
*
*
kwargs):
bArr
=
args[
0
]
print
(bArr,
type
(bArr))
bArr2
=
ByteArray(bytearray(b
'\0'
*
(
len
(bArr)
/
/
4
)))
i
=
0
for
i2
in
range
(
len
(bArr)
/
/
4
):
i3
=
i2
*
4
bArr2[i]
=
((bArr[i3] <<
6
)
+
(bArr[i3
+
1
] <<
4
)
+
(bArr[i3
+
2
] <<
2
)
+
bArr[i3
+
3
]) &
0xff
i
+
=
1
return
bArr2
@java_method_def
(name
=
'add'
, signature
=
'(II)I'
, args_list
=
[
'jint'
,
'jint'
])
def
add(
self
, mu,
*
args,
*
*
kwargs):
print
(
len
(args))
return
args[
1
] ^ args[
0
]
@java_method_def
(name
=
'sub'
, signature
=
'(II)I'
, args_list
=
[
'jint'
,
'jint'
])
def
sub(
self
, mu,
*
args,
*
*
kwargs):
return
(args[
1
]
+
args[
0
]) &
0xff
@java_method_def
(name
=
'xor'
, signature
=
'(II)I'
, args_list
=
[
'jint'
,
'jint'
])
def
xor(
self
, mu,
*
args,
*
*
kwargs):
return
(args[
0
]
-
args[
1
]) &
0xff
def
test(
self
):
pass