harlber / moose Goto Github PK
View Code? Open in Web Editor NEWAndroid app
Home Page: http://www.acfun.tv/v/list110/index.htm
Android app
Home Page: http://www.acfun.tv/v/list110/index.htm
比如说:
我现在进入一个评论列表,当前只有4条记录(有些记录的文本行数较多),滑动屏幕特别灵敏,无论是往上滑动的,下拉刷新,还是往下滑动的加载更多。感觉触发的太频繁了。
需要讨论下
ps: 目前的评论页面的加载更多的逻辑我改动了。可以看看
Comments list abnormal while click comments
in article list.Shows no comments.Caused by wrong article id.
As the title said.
Add request cache
see square/okhttp
See dagger 2
Documents [here](http://google.github.io/dagger/)
After closing #26
Add quick reply
Current version is 23.1.1
E/AndroidRuntime: FATAL EXCEPTION: main
Process: ac.moose.com.moose, PID: 31564
java.lang.ClassCastException: moose.com.ac.HistoryActivity cannot be cast to moose.com.ac.MainActivity
at moose.com.ac.ui.ArticleListAdapter.lambda$onItemClick$24(ArticleListAdapter.java:130)
at moose.com.ac.ui.ArticleListAdapter.access$lambda$0(ArticleListAdapter.java)
at moose.com.ac.ui.ArticleListAdapter$$Lambda$1.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5310)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
Crashed in ArticleListAdapter
line 129
to 132
API变更,从2016年7月份开始变更为现在的,当前调整时间为2016年10月
http://api.acfun.tv/apiserver/content/channel?orderBy=0&channelId=75&pageSize=20&pageNo=1
~~更新为http://api.aixifan.com/searches/channel?channelIds=74&pageNo=1&pageSize=20&sort=5
http://api.acfun.tv/articles/3123106
~~变更为http://api.aixifan.com/articles/3123106
http://www.acfun.tv/comment_list_json.aspx?contentId=3181117¤tPage=2
~~变更为http://mobile.app.acfun.cn/comment/content/list?version=4&contentId=3181117&pageSize=50&pageNo=2
http://www.acfun.tv/comment.aspx?name=xxx"eId=0&text=text&cooldown=5000&contentId=3181117"eName=
~~变更为http://mobile.app.acfun.cn/comment.aspx?text=text&source=mobile"eId=0&contentId=3181117&userId=67095
具体字段参数,请参考app以及app内部的实体类部分注释
Enable in setting.
actionProvider.setOnShareTargetSelectedListener(this);
see https://code.google.com/p/android/issues/detail?id=172659
or JakeWharton/ActionBarSherlock#913
UncaughtHandler
in BaseActivity
对官方app进行登录拦截分析,分析http请求过程
1 http://mobile.app.acfun.cn/oauth2/authorize2.aspx(post)
parameter:
password ***
username 18207*****3
response_type token
client_id ELSH6ruK0qva88DD
(client_id ELSH6ruK0qva88DD ) 这个client_id 的值是怎么得到的,这个需要好好讨论下
return data:
{
"data": {
"access_token": "***",
"userImg": "http://cdn.aixifan.com/dotnet/20120923/style/image/avatar.jpg",
"expires": 1478702196000,
"userGroupLevel": 1,
"mobileCheck": 1,
"userId": 6*****5,
"username": "x*******x"
},
"success": true,
"status": 200
}
我觉得我们很有必要添加这一步,这样就可以保存到access_token了(也就是说,登陆接口调整下,换成这个试试)
2 http://api.app.acfun.cn/apiserver/profile?userId=6*****5(get)
return data:
{
"success": true,
"msg": "ok",
"status": 200,
"data": {
"fullUser": {
"currExp": 50,
"nextLevelNeed": 100,
"banana": 10,
"bananaGold": 0,
"level": 1,
"gender": 0,
"exp": 55,
"mobile": "1*********3",
"mobileCheck": 1,
"qq": null,
"followed": 0,
"following": 0,
"lastLoginDate": 0,
"contributes": 0,
"signature": null,
"username": "x*******x",
"userId": 6*****5,
"userImg": "http://cdn.aixifan.com/dotnet/20120923/style/image/avatar.jpg"
}
}
}
这一步同样,进一步获取用户的信息
而原来的登陆api请求是:
http://www.acfun.tv/login.aspx(post)
parameter:
username 1*********3
password ******
return data:
{
"img": "http://cdn.aixifan.com/dotnet/20120923/style/image/avatar.jpg",
"success": true,
"username": "x*******x"
}
Controls id should be in
ids.xml
ArticleViewActivity里面的菜单选项 选择图文模式,却换到无图模式并不会生效,图片还是会加载出来。
点击收藏,或者是取消收藏,不是会弹snackbar吗,对于有FloatingActionButton的,会进行级联往上浮动,这个是没有问题的。
对于人为点击了snack的onClick事件的操作的,FloatingActionButton没有办法回到原来的位置。
解决办法应该是将
Snackbar snackBar = Snackbar.make(mWeb, msg, Snackbar.LENGTH_SHORT);
mWeb改成 CoordinatorLayout对应的控件名称
see AbstractAccountAuthenticator
之声
Http 500 Internal server error ?
acfun 服务器不再提供接口呢?
Caused by: java.lang.NullPointerException
at com.squareup.leakcanary.internal.LeakCanaryInternals.isInServiceProcess(LeakCanaryInternals.java:130)
at com.squareup.leakcanary.LeakCanary.isInAnalyzerProcess(LeakCanary.java:146)
at com.squareup.leakcanary.LeakCanary.install(LeakCanary.java:48)
at com.squareup.leakcanary.LeakCanary.install(LeakCanary.java:37)
at moose.com.ac.AppApplication.onCreate(AppApplication.java:49)
at org.robolectric.internal.ParallelUniverse.setUpApplicationState(ParallelUniverse.java:140)
at org.robolectric.RobolectricTestRunner.setUpApplicationState(RobolectricTestRunner.java:433)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:240)
... 26 more
Performing stop of activity that is not resumed: {ac.moose.com.moose/moose.com.ac.MainActivity}
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: java.lang.RuntimeException: Performing stop of activity that is not resumed: {ac.moose.com.moose/moose.com.ac.MainActivity}
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3394)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3475)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at android.app.ActivityThread.access$1100(ActivityThread.java:148)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at android.os.Handler.dispatchMessage(Handler.java:102)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at android.os.Looper.loop(Looper.java:135)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at android.app.ActivityThread.main(ActivityThread.java:5310)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at java.lang.reflect.Method.invoke(Native Method)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at java.lang.reflect.Method.invoke(Method.java:372)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
10-18 12:16:32.561 21470-21470/ac.moose.com.moose E/ActivityThread: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
See details in method onSaveInstanceState(Bundle outState)
method java dealBody(HtmlBody); addHead();filterImg(HtmlBody);
called in mainThread.
As title said.
查看一篇文章下的评论
http://mobile.app.acfun.cn/comment/content/list?version=4&contentId=3181117&pageSize=50&pageNo=2
Process: ac.moose.com.moose, PID: 20219
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.smoothScrollToPosition(int)' on a null object reference
at moose.com.ac.MainActivity.lambda$initData$33(MainActivity.java:105)
at moose.com.ac.MainActivity.access$lambda$0(MainActivity.java)
at moose.com.ac.MainActivity$$Lambda$1.onClick(Unknown Source)
at android.view.View.performClick(View.java:4761)
at android.view.View$PerformClick.run(View.java:19767)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5310)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
--------- beginning of system
以漫画小说为例进行分析
http://api.aixifan.com/searches/channel?channelIds=74&pageNo=1&pageSize=20&sort=5 这个是新的接口信息
原来的接口如下
http://api.acfun.tv/apiserver/content/channel?orderBy=0&channelId=75&pageSize=20&pageNo=1
变动了Host,以及请求的searches/channel 同样还包括对应的参数channelId --> channelIds , orderBy --> sort
接口修改为新的之后,同样还是抓取不到数据,结果显示的
{"code":422003,"message":"deviceType缺失"}
通过对charles记录的url进行分析,发现了一个请求url,觉得问题出在这个地方,这个地方的请求数据是携带有请求头的,而这些请求头数据跟其他的api不一样,应该属于AcFun自己添加的header,用来防止用户恶意抓取数据的
下面列出来这个特殊url的请求形式:
完整url为 http://api.aixifan.com/open/phone/source
GET /open/phone/source HTTP/1.1
uid 0
If-Modified-Since Wed, 21 Sep 2016 13:04:13 GMT+00:00
market xiaomi
appVersion 4.3.0
deviceType 1
If-None-Match "95f56023-742e-485c-9fdd-e4209d8d1fdd"
User-agent acvideo core
udid 1bfbeabd-bc43-32fa-ba2a-db535c1a7542
resolution 720x1280
productId 2000
Host api.aixifan.com
Connection Keep-Alive
Accept-Encoding gzip
由此我可以推测,这些特殊的参数是必须使用的,不然服务器端验证的时候,不会给你返回正确的数据,经过测试也的确如此(主要是这方面的经验比较多,哈哈,一般情况下,是很难让我破解不了的)
另外还有一个接口也有类似的数据可以参考
url为 http://api.aixifan.com/offlines/checkOffline
GET /offlines/checkOffline HTTP/1.1
uid 0
If-Modified-Since Wed, 21 Sep 2016 13:04:13 GMT+00:00
market xiaomi
appVersion 4.3.0
deviceType 1
If-None-Match "707ccc56-5b47-4836-b81b-e30ca20754eb"
User-agent acvideo core
udid 1bfbeabd-bc43-32fa-ba2a-db535c1a7542
resolution 720x1280
productId 2000
Host api.aixifan.com
Connection Keep-Alive
Accept-Encoding gzip
之后在postman上面测试分析,进一步确定需要那几个特定的header数据
market xiaomi
appVersion 4.3.0
deviceType 1
我们只需要在每次的请求头上面加入上面的三个参数,就可以解决数据获取不到的问题,从而避免被AcFun的服务器给干掉
当然了,毕竟接口还有很多,这个issue长期维护,还是有必要进一步优化调整的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.