阿里云 安卓push无法收到消息

官方给的demo代码如下:

    request = PushMessageToAndroidRequest.PushMessageToAndroidRequest()
    request.set_AppKey(appKey)
    request.set_Target('ALL')
    request.set_TargetValue('ALL')
    request.set_Title("PushMessageToAndroid title")
    request.set_Body("Message from ali push Open Api2.0 : PushMessageToAndroid")

    request.add_query_param('AndroidNotificationChannel', '1')

    result = clt.do_action(request)
    print result

这个代码有两个问题,如果和另外一份demo代码中的:

clt = client.AcsClient(properties.accessKeyId,properties.accessKeySecret,properties.regionId)

request = PushMessageToAndroidRequest.PushMessageToAndroidRequest()
request.set_AppKey(properties.appKey)
request.set_Target('ALL')
request.set_TargetValue('ALL')
request.set_Title("PushMessageToAndroid title")
request.set_Body("Message from ali push Open Api2.0 : PushMessageToAndroid")
result = clt.do_action(request)

很可能会出现下面的错误信息:



    EABF26DA-89EA-44BA-B16E-117FE03D29C7
    cloudpush.aliyuncs.com
    Throttling.User
    Request was denied due to user flow control.

这个错误信息按照官方的解释是限流了,但是实际并不是,可以尝试分开调用,不要连续进行push message和push notice。

另外一个问题是: 这份代码在对于最新的安卓8.0以上系统的消息无法正常弹出,按照文档解释需要设置NotificationChannel(文档链接:https://help.aliyun.com/knowledge_detail/67398.html)。

Continue Reading

Android Studio动态调试smali

3.3.2版本的android studio支持直接分析或者调试apk,新建项目直接选择调试apk即可。如果实用的是旧版本地android studio可以参考这篇文章:

前面介绍了使用IDA动态调试smali,这种方法设置简单,不用重打包,用起来方便,但是如果变量类型设置错误则会马上退出调试,这是让人不爽的地方,而使用Android studio则不会。
0x01    工具
①Android Studio最新版。
②apktool尽量使用最新版的。
③ideasmali插件。下载地址https://github.com/JesusFreke/smali/wiki/smalidea
0x02     具体步骤
安装ideasmali插件,选择File->Settings->Plugins,安装之前下载的ideasmali插件。
Continue Reading

x86 emulation currently requires hardware acceleration!

很久没有编译安卓的东西,创建了模拟器却发现启动不聊了。网上搜索了一下发现文章真是不少,但是里面说的东西下载地址却不是那个了。并且我安装了sdk之后也没有找到haxm-windows的安装程序。网上搜索了一下发现现在是个开源项目了。https://github.com/intel/haxm

HAXM is a cross-platform hardware-assisted virtualization engine (hypervisor), widely used as an accelerator for Android Emulator and QEMU. It has always supported running on Windows and macOS, and has been ported to other host operating systems as well, such as Linux and NetBSD.

HAXM runs as a kernel-mode driver on the host operating system, and provides a KVM-like interface to user space, thereby enabling applications like QEMU to utilize the hardware virtualization capabilities built into modern Intel CPUs, namely Intel Virtualization Technology.

下载安装就ok了,如果没有开启vt首先要去bios里面开启vt。

 

从com.alibaba.wxlib.exception.WXRuntimeException: should call prepareTargetKey first 说起

对于安卓的开发,我并没有太多的经验,并且很多的东西目前也没有深入的研究。最近在更新Findu的安卓版本的时候,出现了一个意外的错误。错误代码如下:

03-07 15:03:30.046 12215-12290/today.findu.findu.alibaba.openIMUI:watchdog E/AndroidRuntime: FATAL EXCEPTION: initFeedbackThread
  Process: today.findu.findu.alibaba.openIMUI:watchdog, PID: 12215
  com.alibaba.wxlib.exception.WXRuntimeException: should call prepareTargetKey first
      at com.alibaba.mobileim.utility.AccountInfoTools.initTargetAppKeys(AccountInfoTools.java:190)
      at com.alibaba.mobileim.FeedbackAPI.initFeedbackImpl(FeedbackAPI.java:108)
      at com.alibaba.mobileim.FeedbackAPI.access$000(FeedbackAPI.java:38)
      at com.alibaba.mobileim.FeedbackAPI$1.run(FeedbackAPI.java:97)
      at java.lang.Thread.run(Thread.java:761)

并且同时还有大量的其他的错误信息:

03-07 15:03:34.274 12215-12215/today.findu.findu.alibaba.openIMUI:watchdog E/security: [2014@taobao_h5_3.0.0][WLqJSW6PXu8DAOb+xk4MZjLO][] : ***********************************************************
  错误编码 = 10010
  错误消息 = 发生错误,消息为 null sec code 162, 请使用 LogCat 查看更多细节
  解决建议 = 请使用默认的 androiddebugkey 对当前开发应用签名或在应用初始化之前调用 AlibabaSDK.turnOnDebug(), 运行程序查看 logcat 输出以获取更多错误细节,并采取对应操作
  错误堆栈 = ErrorCode = 162
  com.alibaba.wireless.security.open.SecException
      at com.alibaba.wireless.security.open.initialize.c.a(Unknown Source)
      at com.alibaba.wireless.security.open.initialize.a.a(Unknown Source)
      at com.alibaba.wireless.security.open.initialize.b.b(Unknown Source)
      at com.alibaba.wireless.security.open.initialize.b.loadLibrarySync(Unknown Source)
      at com.alibaba.wireless.security.open.initialize.b.initialize(Unknown Source)
      at com.alibaba.sdk.android.security.impl.h.a(SourceFile:23)
      at com.alibaba.sdk.android.security.impl.SecurityGuardWrapper.init(SourceFile:61)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.alibaba.sdk.android.a.a.a.a(SourceFile:91)
      at com.alibaba.sdk.android.task.a.c(SourceFile:186)
      at com.alibaba.sdk.android.task.a.a(SourceFile:144)
      at com.alibaba.sdk.android.AlibabaSDK.a(SourceFile:135)
      at com.alibaba.sdk.android.AlibabaSDK.asyncInit(SourceFile:98)
      at cn.org.findu.finduUI.demo.DemoApplication.onCreate(DemoApplication.java:61)
      at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
      at android.app.ActivityThread.-wrap2(ActivityThread.java)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:154)
      at android.app.ActivityThread.main(ActivityThread.java:6119)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Continue Reading

i9100G 重新分区,扩大系统内存

我曾经不止一次的提到三星的手机设计的是多么的傻逼和蛋疼,并且自从换了苹果之后也基本不怎么使用这个蛋疼的大三星了。但是偶尔想要使用下装个应用的时候就提示存储空间不足,妈蛋,这也太坑底了16g的存储只分给系统2g,请问三星的程序员是脑子有屎么?到网上搜一下,提到这个问题的人数不胜数,并且网上也有很多的教程来说明怎么重新分区,请参考http://forum.xda-developers.com/galaxy-s2/development/mod-pit-files-creating-larger-partition-t2552738  。

这里提供下用到的工具,列表如下:

 驱动器 C 中的卷没有标签。
 卷的序列号是 CA73-C79C

 C:\Users\obaby\Desktop\9100G分区 的目录

2015/05/06  15:44              .
2015/05/06  15:44              ..
2013/03/26  11:30         2,252,888 BOOTLOADER_I9100GZCLSG_973591_REV03_user_low_ship.tar.md5
2015/05/06  15:44                 0 file.txt
2013/03/26  23:09       583,782,476 GT-I9100G_CODE_4.1.2_ZCLSG_xiaodanRip.tar.md5
2013/03/26  16:00        19,589,195 GT-I9100G_CSC_4.1.2_ZCLSG_xiaodanRip.tar.md5
2013/12/04  19:32             2,008 I9100G (16gb Model only!!!!) 1GB.pit
2013/12/02  20:24             2,008 I9100G (16gb Model only!!!!) 3GB.pit
2013/12/03  21:51             2,008 I9100G (16gb Model only!!!!) 4GB.pit
2014/02/25  20:41             2,008 I9100G (16gb Model only!!!!) 6GB.pit
2014/02/25  20:44             2,008 I9100G (16gb Model only!!!!) 8GB.pit
2013/12/03  22:09               144 metalgear XDA thread link.txt
2013/03/26  11:33        12,585,033 MODEM_I9100GZCLSG_REV_00_CL1249517.tar.md5
2015/05/05  15:42              Odin3 v3.06
2013/03/26  11:33             2,264 omap4_all_20120827_CHN_OPEN_emmc.pit
2013/03/26  23:23           137,961 刷机示意图.jpg
2013/03/26  23:31             1,220 刷机说明.txt
              14 个文件    618,361,221 字节
               3 个目录  4,496,023,552 可用字节

Continue Reading