|
Recently, I have been busy with the start of school and it is suitable to toss blindly – in the past two days, Zero has been busy with videos to advertise, and it is said that advertisements are becoming more and more rampant, and some videos have been open for more than 60s. He removed Sohu, but iQiyi's has never been done. Let me help him take a look. The source code was given to me by him, I don't have a swf decompiler. Probably looking at the structure, I haven't learned ActionScript. He said it was similar to Java, so I didn't bother to look at the basic syntax, so I went straight to it. Let's take a look at the head of the main file Player.as to see what citations there are. - import com.iqiyi.components.global.*;
- import com.iqiyi.components.tooltip.*;
- import com.qiyi.player.base.pub.*;
- import com.qiyi.player.base.uuid.*;
- import com.qiyi.player.core.*;
- import com.qiyi.player.core.model.def.*;
- import com.qiyi.player.core.model.utils.*;
- import com.qiyi.player.wonder.*;
- import com.qiyi.player.wonder.body.view.*;
- import com.qiyi.player.wonder.common.config.*;
- import com.qiyi.player.wonder.common.lso.*;
- import com.qiyi.player.wonder.common.pingback.*;
- import com.qiyi.player.wonder.common.sw.*;
- import flash.display.*;
- import flash.events.*;
- import flash.media.*;
- import flash.system.*;
- import flash.utils.*;
Copy codeLook at the name to know the meaning, com.qiyi.player.wonder.common.config.*; Catches my eye – take a look at the configuration information. The two documents FlashVarConfig.as and SystemConfig.as. SystemConfig.as didn't find anything noticeable, but the xml configuration file referenced in the FlashVarConfig.as is worth looking into. - package com.qiyi.player.wonder.common.config
- {
- public class FlashVarConfig extends Object
- {
- public static const OWNER_PAGE:String = "page";
- public static const OWNER_CLIENT:String = "client";
- public static const OS_XP:String = "xp";
- public static const OS_WIN7:String = "win7";
- public static const OS_WIN8:String = "win8";
- public static const PAGE_OPEN_SRC_NONE:String = "0";
- public static const PAGE_OPEN_SRC_DIRECT:String = "1";
- public static const PAGE_OPEN_SRC_OTHER:String = "2";
- private static var _flashVarSource:Object;
- private static var _albumId:String = "";
- private static var _tvid:String = "0";
- private static var _vid:String = "";
- private static var _autoPlay:Boolean = true;
- private static var _isMemberMovie:Boolean = false;
- private static var _cyclePlay:Boolean = false;
- private static var _components:String = "fefff7e6";
- private static var _cupId:String = "";
- private static var _shareStartTime:int = -1;
- private static var _shareEndTime:int = -1;
- private static var _preloaderURL:String = "http://dispatcher.video.qiyi.com/dispn/player/preloader.swf";
- private static var _preloaderVipURL:String = "";
- private static var _exclusivePreloader:String = "";
- private static var _useGPU:Boolean = true;
- private static var _showBrand:Boolean = true;
- private static var _expandState:Boolean = false;
- private static var _tipDataURL:String = "http://static.qiyi.com/ext/tips/tipdata.xml";
- private static var _coop:String = "";
- private static var _owner:String = "page";
- private static var _os:String = "win7";
- private static var _adPlayerURL:String = "";
- private static var _origin:String = "";
- private static var _passportID:String = "";
- private static var _playListID:String = "";
Copy codeIn line 31, this configuration file has this passage. And the advertising address in line 35 also caught my attention, which I will analyze later. Let's look at the configuration file first. - </item>
- <!-- 正在为您播放片中广告, 可选择是否要跳过, 类别是1, 持续时间是8秒 -->
- <!-- 限制条件是: 不是正在登录中的会员 -->
- <!-- 每天每人次只最多显示两次这个tips -->
- <item id="ToSelectWhetherToSkipPlayingMiddleAD" level="1" duration="-1" type="1">
- <conditions>
- <fields>
- <field name="member" operator="eq" value="false"/>
- </fields>
- <frequency count="2">
- <restrain name="day"/>
- <restrain name="user"/>
- </frequency>
- </conditions>
- <list>
- <message>
- <![CDATA[
- 正在为您播放片中广告, <a href="event:ASEvent(skipAD)"><b><u>跳过广告</u></b></a>
- ]]>
- </message>
- </list>
- </item>
- <!-- 提示即将跳过8秒后会显示的剧中广告, 类别是1, 持续时间是8秒 -->
- <!-- 必须是登录的会员 -->
- <item id="ToCancelSkipNextMiddleAD" level="1" duration="8" type="1">
- <conditions>
- <fields>
- <field name="member" operator="eq" value="true"/>
- </fields>
- <frequency count="1">
- <restrain name="day"/>
- <restrain name="user"/>
- </frequency>
- </conditions>
- <list>
- <message>
- <![CDATA[
- 即将为您跳过片中广告,<a href="event:ASEvent(cancelSkipAD)"><u>不再跳过</u></a>
- ]]>
- </message>
- </list>
- </item>
- <!--
- 提示版权下线, 如果还有小于7天的时间下线, 每天一个专辑一台电脑提醒一次, 类别是1, 从起始60秒开始显示, 持续时间是10秒
- -->
- <!-- 因为优先级很高, 前面的最高优先级是10, 所以这里把level设为11. -->
- <!-- 这个tip是由signal发起的. Shawn.X -->
- <!--
- 《<span>#keyword#</span>》 将于 <span>#expiredTime#</span> 版权到期.
- -->
- <item id="NoticeThisCopyrightWillExpire" level="11" duration="10" type="1">
- <conditions>
Copy codeIt is said that it is an advertisement in the play, 8s time, that is to say, I localize it, and then hijack the browser to achieve ads, but it is obvious that this is not an advertisement before the video loads. Continue to flip - a very boring process. Find who called get adPlayerURL() and look up. Under com\qiyi\player\wonder\plugins\ad, it is found that the ad player exists in the form of a plug-in, that is, there is a call, look up, find CupidAdPlayer at com\qiyi\cupid\adplayer\CupidAdPlayer.as to initialize. And this class is confused, which is very suspicious. - public function CupidAdPlayer(param1:CupidParam)
- {
- this.PLAYER_TIMEOUT_LENGTHS = new Array(10000, 15000);
- Log.info("init, version=" + VERSION + ", " + param1.toString());
- this._videoPlayerVersion = param1.videoPlayerVersion;
- this._videoId = param1.videoId;
- this._tvId = param1.tvId;
- this._channelId = param1.channelId;
- this._collectionId = param1.collectionId;
- this._playerId = param1.playerId;
- this._albumId = param1.albumId;
- this._userId = param1.userId;
- this._webEventId = param1.webEventId;
- this._videoEventId = param1.videoEventId;
- this._vipRight = param1.vipRight;
- this._terminal = param1.terminal;
- this._duration = param1.duration;
- this._passportId = param1.passportId;
- this._passportCookie = param1.passportCookie;
- this._passportKey = param1.passportKey;
- this._videoDefinitionId = param1.videoDefinitionId;
- if (this.isQiyiWebEx())
- {
- this._playerUrl = this.IQIYI_WEBEX_AM_URL;
- }
- else if (param1.playerUrl)
- {
- this._playerUrl = param1.playerUrl;
- }
- else
- {
- this._playerUrl = this.IQIYI_WEB_AM_URL;
- }
- if (param1.dispatcher == null)
- {
- this._dispatcher = this;
- }
- else
- {
- this._dispatcher = param1.dispatcher;
- }
- this._volume = param1.volume;
- this._videoIndex = param1.videoIndex;
- this._stageWidth = param1.stageWidth;
- this._stageHeight = param1.stageHeight;
- this._displayContainer = param1.adContainer;
- this._screenStatus = DisplayProperties.isFullScreen(this._displayContainer.stage) ? ("1") : ("0");
- this._baiduMainVideo = param1.baiduMainVideo;
- this._disablePreroll = param1.disablePreroll;
- this._disableSkipAd = param1.disableSkipAd;
- this._enableVideoCore = param1.enableVideoCore;
- this._isUGC = param1.isUGC;
- this._videoPlayerUrl = this._displayContainer.loaderInfo ? (this._displayContainer.loaderInfo.loaderURL) : ("");
- this._env = this.generateEnv();
- this.addAdPlayerEventListeners();
- return;
- }// end function
Copy codeCupidAdPlayer(param1:CupidParam) < – Look at its calling parameters, that is, the upper layer is still calling, where the parameter 1, a value is very eye-catching, vipRight judges whether it is vip, and VIP does not have an advertisement, that is to say, if I make changes to the place where I judge whether it is VIP after obtaining the user information in the session of the website in its player, causing the lower level to be called, Mistaken for VIP (just the ad player thinks you're VIP and the rest of the world is unaffected). Then let's continue to look up. I searched and searched and went back, and returned to the catalog of advertising plugins. com\qiyi\player\wonder\plugins\ad\view in the ADView.as, the head is first - private var _adPlayer:CupidAdPlayer;
Copy codeDefined an instance of CupidAdPlayer named _adPlayer, look down to see who used _adPlayer. I found the ad player creation function. - public function createAdPlayer(param1:CupidParam) : void
- {
- if (this._adPlayer)
- {
- this.unloadAdPlayer();
- }
- this._log.info("loading adplayer...");
- this._adPlayer = new CupidAdPlayer(param1);
- this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_LOADING_SUCCESS, this.onAdLoadSuccess);
- this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_LOADING_FAILURE, this.onAdLoadFailed);
- this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_AD_START, this.onAdStartPlay);
- this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_PAUSE, this.onAdAskVideoPause);
- this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_RESUME, this.onAdAskVideoResume);
- this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_START_LOADING, this.onAdAskVideoStartLoad);
- this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_START, this.onAdAskVideoStartPlay);
- this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_END, this.onAdAskVideoEnd);
- this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_AD_BLOCK, this.onAdBlock);
- this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_DISPLAY_AD_TIP, this.onAskVideoShowBonusTips);
- this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_AD_VIDEO, this.onAdFlvADAction);
- this._adPlayer.load();
- return;
- }// end function
Copy codeI saw that it could also pass parameters, indicating that it was still being called. Finally found the source in the ADViewMediator.as under com\qiyi\player\wonder\plugins\ad\view. His function is finally called like this - private function createADPlayer() : void
- {
- sendNotification(BodyDef.NOTIFIC_PLAYER_STOP_LOAD);
- ProcessesTimeRecord.STime_adInit = getTimer();
- var _loc_1:* = facade.retrieveProxy(PlayerProxy.NAME) as PlayerProxy;
- var _loc_2:* = facade.retrieveProxy(UserProxy.NAME) as UserProxy;
- var _loc_3:* = new CupidParam();
- _loc_3.playerUrl = FlashVarConfig.adPlayerURL;
- _loc_3.videoId = _loc_1.curActor.loadMovieParams.vid;
- _loc_3.tvId = _loc_1.curActor.loadMovieParams.tvid;
- _loc_3.channelId = _loc_1.curActor.movieModel.channelID;
- _loc_3.playerId = FlashVarConfig.cupId;
- _loc_3.albumId = _loc_1.curActor.movieModel.albumId;
- _loc_3.dispatcher = null;
- _loc_3.adContainer = this._ADView;
- _loc_3.stageWidth = GlobalStage.stage.stageWidth;
- _loc_3.stageHeight = GlobalStage.stage.stageHeight;
- _loc_3.userId = _loc_1.curActor.uuid;
- _loc_3.webEventId = UUIDManager.instance.getWebEventID();
- _loc_3.videoEventId = UUIDManager.instance.getVideoEventID();
- _loc_3.vipRight = _loc_2.userLevel != UserDef.USER_LEVEL_NORMAL ? ("1") : ("0");
- _loc_3.terminal = "iqiyiw";
- _loc_3.duration = _loc_1.curActor.movieModel.duration / 1000;
- _loc_3.passportId = _loc_2.passportID;
- _loc_3.passportCookie = _loc_2.P00001;
- _loc_3.passportKey = KeyUtils.getPassportKey(0);
- _loc_3.enableVideoCore = true;
- _loc_3.disableSkipAd = _loc_1.curActor.movieModel.forceAD;
- _loc_3.volume = Settings.instance.mute ? (0) : (Settings.instance.volumn);
- _loc_3.isUGC = UGCUtils.isUGC(_loc_1.curActor.movieModel.tvid);
- _loc_3.collectionId = FlashVarConfig.collectionID;
- _loc_3.videoDefinitionId = _loc_1.curActor.movieModel.curDefinitionInfo.type.id;
- _loc_3.videoPlayerVersion = WonderVersion.VERSION_WONDER;
- this._ADView.createAdPlayer(_loc_3);
- return;
- }// end function
Copy codeThe key point is - _loc_3.vipRight = _loc_2.userLevel != UserDef.USER_LEVEL_NORMAL ? ("1") : ("0");
Copy codeThis sentence determines whether the user is a VIP or not, first judges the user's level according to the local variable loc_2 and returns 1 if it matches the defined VIP level. We made a slight modification to him, and he became a pseudo-VIP. - _loc_3.vipRight = _loc_2.userLevel != UserDef.USER_LEVEL_NORMAL ? ("1") : ("1");
Copy codeIn this way, just modify it in Hex, and the test ad is successfully removed (using Chrome's plug-in function, change the player address to be local, and pass the playback parameters as they are). In addition, under com\qiyi\cupid\adplayer\model AdBlockedBlackScreen.as there is a local detection function that prohibits Chrome's plug-in blocking. - public static function isInBlacklist(param1:String) : Boolean
- {
- if (!param1)
- {
- return false;
- }
- if (StringUtils.beginsWith(param1, "chrome-extension://"))
- {
- return true;
- }
- var _loc_2:* = new URLParser(param1);
- var _loc_3:* = _loc_2.getHost();
- return HOST_BLACKLIST.indexOf(_loc_3) != -1;
- }// end function
Copy codeJust change the return of the second if to false.
|