|
Recently busy with the opening of the school suitable for blind folding - these two days Zero busy video ads, said the ads are getting more and more flooded, some of the video opening ads are more than 60s. He got rid of the ads for Sohu, but he hasn't been able to get rid of the ads for Aqiyi. Let me help him look. The source code is what he gave me, I don't have a swf decompiler. I didn't have a swf decompiler. I probably looked at the structure, and I haven't learned ActionScript. He said it's similar to Java, so I don't bother to look at the basic syntax, and go straight to it. First, let's look at the header of the main file Player.as to see what references are there. - 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 the code Look at the name, com.qiyi.player.wonder.common.config.*; caught my attention - look at the configuration information. There are two files, FlashVarConfig.as and SystemConfig.as. SystemConfig.as doesn't show anything interesting, but the xml configuration file referenced in FlashVarConfig.as is worth investigating. - 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 = "";
Copying the code On line 31, this config file has this paragraph. And in line 35 of the advertisement address also caught my attention, later in the analysis. First look at the configuration file. - </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 the code It says it's an in-show ad, 8s time, which means I localized it and hijacked the browser to remove the ads, but it's clear that this isn't an ad before the video loads. Keep flipping-very boring process. Find out who calls get adPlayerURL() and look upwards. Under com\qiyi\player\wonder\plugins\ad, I found that the ad player exists in the form of a plugin, that is, there is still a call to it, looking upwards, I found that at com\qiyi\cupid\adplayer\CupidAdPlayer.as CupidAdPlayer is initialized. And the class is obfuscated, which is 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 the code CupidAdPlayer(param1:CupidParam) <- look at its calling parameters, that is, the upper layer is still calling, which parameter one, a value is very noticeable, vipRight Judge whether it is vip, and vip does not exist ads, that is to say, if I get the user information in the session in the player, I will use it to initialize CupidAdPlayer.as. That is to say, if I make a change in the place of judging whether a user is a vip after the player gets the user's information from the website's session, it will lead to the lower level being mistakenly thought to be a vip when it's called (only the advertisement player will think that you're a vip, while the rest of the place will not be affected). So let's keep looking upwards. We're looking for it, and we're going back to the directory of the ad plugin. com\qiyi\player\wonder\plugins\ad\view in ADView.as, with the header first being - private var _adPlayer:CupidAdPlayer;
Copy Code Defined an instance of CupidAdPlayer named _adPlayer once, scrolled down to find out who uses _adPlayer. surprisingly 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
Copying the code Seeing that you can still pass parameters means that it's still being called. I finally found the source in ADViewMediator.as under com\qiyi\player\wonder\plugins\ad\view. The final call to his function looks 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 Code The key point is in the - _loc_3.vipRight = _loc_2.userLevel != UserDef.USER_LEVEL_NORMAL ? ("1") : ("0");
Copy Code This line, to determine whether the user is a vip or not, first according to the local variable loc_2 to determine the user's level, if with the definition of the vip level matches, it will return 1. We give him a slight modification, it will become a pseudo-vip. - _loc_3.vipRight = _loc_2.userLevel != UserDef.USER_LEVEL_NORMAL ? ("1") : ("1");
Copy the code This in Hex to modify the line, test ads successfully removed (using Chrome's plug-in function, modify the player address for the local, the playback parameters are passed as is). In addition, in the AdBlockedBlackScreen.as under com\qiyi\cupid\adplayer\model, there is a local detection function to prohibit 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 the code Just change the return of the second if to false.
|