华为开发者活动详情

华为开发者活动详情

探索华为云技术,赢取丰厚奖励

celebration 活动亮点

华为开发者活动再次来袭!参与云实验、案例实操和认证考试,赢取华为智能设备、云资源代金券等丰厚奖励。

30+
实践案例
10+
认证考试
1000元
最高奖励
rocket_launch 立即参与

card_giftcard 活动奖励

按照惯例先看奖励打个鸡血激励你参加

云实验实操抽奖

抽华为手环9、定制双肩包、开发者定制冲锋衣等礼品

云实验实操奖品

开发者空间案例实操抽奖

抽华为智能体脂称、开发者定制冲锋衣、定制双肩包等礼品

开发者空间案例实操奖品

积分兑好礼

最高可兑换1000元云资源券代金券、1099元工作级开发者认证代金券

积分兑好礼

本次活动奖励分为3类,分别是云实验实操、开发者空间案例实操、考证获得积分,接下来一个个讲

build 实操环节

cloud 云实验实操

需在PC操作,入口在文章首页报名链接

完成上述任意云实验进度100%可参与抽奖,casino 点此抽奖

code 空间案例实操

实操入口在文章首页报名链接

get_app 免费领取开发者空间,然后完成上方任意1个案例实践后,在论坛贴评论区发布:案例名称+完成案例实践截图+心得,即可参与抽奖。

school 考证获得积分

how_to_reg 1. 报名活动

活动时间:2025年 06月 30日 - 2025年 08月 07日

如果碰到不能打开的网站,建议关闭代理或者自己手动观察一下规则,手动修改一下走直连

assignment_turned_in 2. 考取证书

注意:如果有已经考过的,重复考取同一门不计分,今天先别领券,优惠券大概率不兼容,明天会追加认证,明天再领!!

——工作日每周一、周三、周五18点前发放符合条件(必须前一天微认证通过且证书生成)的用户

  1. local_offer 点此领取2张27元微认证代金券,通过1门微认证local_offer 点此再领取1张27元微认证代金券
  2. 通过以上任意2门微认证 local_offer 点此申请2张27元微认证代金券
  3. 考完1-5的认证,已经得到10分,填写问卷A可以申请2张47元微认证代金券和699元开发者认证代金券(限量750张)
  4. 考完6-7的认证,已经得到14分,这时候用掉699元开发者认证代金券考掉8-10任意一门就得到18分,这时候已经能领取900元代金券,剩下两分可以通过考另外一门得到22分或者拉2个人头就得到20分了,就能马上领取1000元的代金券了
  5. Gemini的拍照识别功能就是你的考场学霸,电脑接上摄像头,手机边拍边答,很快就答完了,如果分数不及格,可以多用几个AI来回尝试一下或者结合一下多个AI的答案自己筛选一下
  6. 考机试的时候如果碰到卡顿的情况可以把所有窗口关了,重新进,内存爆了

shopping_cart 3. 购买云资源

等券发放之后cloud_download 点击这里自费买最便宜的海外服务器,自己选hk/sg,然后在控制台用下发的代金券去升级配置+续费,续费选择11个月,记得最后一次续费11个月的时候记得手动调整一下到期时间把券榨干净,最后祝大家考试通过!

必要工具

浏览器安装油猴或者脚本猫,将下面的“通用阻止切屏检测”脚本添加到其中

// ==UserScript==
// @name         通用阻止切屏检测
// @namespace    http://tampermonkey.net/
// @version      0.1.0
// @description  尝试阻止各类网站的切屏、焦点丢失等检测
// @author       nodeseek@小号 && Gemini
// @match        http://*/*
// @match        https://*/*
// @run-at       document-start
// @grant        unsafeWindow
// @license      GPL-3.0
// ==/UserScript==

(function () {
    'use strict';
    const window = unsafeWindow; // 使用原始 window 对象

    // 黑名单事件,这些事件的监听器将被阻止
    const blackListedEvents = new Set([
        "visibilitychange", // 页面可见性改变
        "blur",             // 元素或窗口失去焦点
        "focus",            // 元素或窗口获得焦点 (某些检测可能反向利用focus)
        "pagehide",         // 页面隐藏(例如导航到其他页面)
        "freeze",           // 页面被冻结 (较新的事件)
        "resume",           // 页面从冻结状态恢复 (较新的事件)
        "mouseleave",       // 鼠标移出元素(通常是 document 或 body)
        "mouseout",         // 鼠标移出元素(更通用的移出,但要小心副作用)
        // "focusout",      // 元素将要失去焦点(与blur类似,但更通用,看情况添加)
        // "focusin",       // 元素将要获得焦点(与focus类似,看情况添加)
    ]);

    // 白名单属性,这些属性在 document 对象上将被伪造
    const spoofedDocumentProperties = {
        hidden: { value: false, configurable: true },
        mozHidden: { value: false, configurable: true }, // Firefox (旧版)
        msHidden: { value: false, configurable: true },  // Internet Explorer
        webkitHidden: { value: false, configurable: true }, // Chrome, Safari, Opera (旧版 Blink/WebKit)
        visibilityState: { value: "visible", configurable: true },
        hasFocus: { value: () => true, configurable: true }
    };

    // 需要清空/置空的事件处理器属性 (on-event handlers)
    const eventHandlersToNullifyDocument = [
        "onvisibilitychange",
        "onblur",
        "onfocus",
        "onmouseleave",
        "onmouseout",
        // "onfocusout",
        // "onfocusin",
        "onpagehide",
        "onfreeze",
        "onresume"
    ];

    const eventHandlersToNullifyWindow = [
        "onblur",
        "onfocus",
        "onpagehide",
        "onpageshow", // 有些检测可能通过 pageshow 结合 persisted 属性判断
        "onfreeze",
        "onresume",
        "onmouseleave", // window 也有 onmouseleave
        "onmouseout"
    ];

    const isDebug = false; // 设置为 true 以启用调试日志
    const scriptPrefix = "[通用阻止切屏检测]";
    const log = console.log.bind(console, `%c${scriptPrefix}`, 'color: #4CAF50; font-weight: bold;');
    const warn = console.warn.bind(console, `%c${scriptPrefix}`, 'color: #FFC107; font-weight: bold;');
    const error = console.error.bind(console, `%c${scriptPrefix}`, 'color: #F44336; font-weight: bold;');
    const debug = isDebug ? log : () => { };

    /**
     * 伪装函数的 toString 方法,使其看起来像原始函数。
     * @param {Function} modifiedFunction 被修改的函数
     * @param {Function} originalFunction 原始函数
     */
    function patchToString(modifiedFunction, originalFunction) {
        if (typeof modifiedFunction !== 'function' || typeof originalFunction !== 'function') {
            warn("patchToString: 传入的参数不是函数。", modifiedFunction, originalFunction);
            return;
        }
        try {
            const originalToStringSource = Function.prototype.toString.call(originalFunction);
            modifiedFunction.toString = () => originalToStringSource;

            // 进一步伪装 toString.toString
            const originalToStringToStringSource = Function.prototype.toString.call(originalFunction.toString);
            Object.defineProperty(modifiedFunction.toString, 'toString', {
                value: () => originalToStringToStringSource,
                enumerable: false,
                configurable: true, // 保持可配置,以防万一
                writable: false
            });
            debug(`patchToString applied for: ${originalFunction.name || 'anonymous function'}`);
        } catch (e) {
            error("patchToString failed:", e, "for function:", originalFunction.name);
        }
    }


    /**
     * 劫持并修改对象的 addEventListener 方法。
     * @param {EventTarget} targetObject 要劫持的对象 (window, document, Element)
     * @param {string} objectName 用于日志记录的对象名称
     */
    function patchAddEventListener(targetObject, objectName) {
        if (!targetObject || typeof targetObject.addEventListener !== 'function') {
            warn(`Cannot patch addEventListener for invalid target: ${objectName}`);
            return;
        }
        const originalAddEventListener = targetObject.addEventListener;

        targetObject.addEventListener = function (type, listener, optionsOrCapture) {
            if (blackListedEvents.has(type.toLowerCase())) {
                log(`BLOCKED ${objectName}.addEventListener: ${type}`);
                return undefined; // 阻止添加黑名单中的事件监听器
            }
            debug(`ALLOWED ${objectName}.addEventListener: ${type}`, listener, optionsOrCapture);
            return originalAddEventListener.call(this, type, listener, optionsOrCapture);
        };

        patchToString(targetObject.addEventListener, originalAddEventListener);
        log(`${objectName}.addEventListener patched.`);
    }

    /**
     * 劫持并修改对象的 removeEventListener 方法 (可选,但建议一起修改)。
     * @param {EventTarget} targetObject 要劫持的对象
     * @param {string} objectName 用于日志记录的对象名称
     */
    function patchRemoveEventListener(targetObject, objectName) {
        if (!targetObject || typeof targetObject.removeEventListener !== 'function') {
            warn(`Cannot patch removeEventListener for invalid target: ${objectName}`);
            return;
        }
        const originalRemoveEventListener = targetObject.removeEventListener;

        targetObject.removeEventListener = function (type, listener, optionsOrCapture) {
            if (blackListedEvents.has(type.toLowerCase())) {
                log(`Original call to ${objectName}.removeEventListener for blacklisted event '${type}' would have been ignored by our addEventListener patch anyway. Allowing native call if needed.`);
                // 即使我们阻止了 addEventListener,原始的 removeEventListener 仍然应该能安全调用
                // 因为如果监听器从未被添加,调用 remove 也无害。
            }
            debug(`PASSTHROUGH ${objectName}.removeEventListener: ${type}`, listener, optionsOrCapture);
            return originalRemoveEventListener.call(this, type, listener, optionsOrCapture);
        };
        patchToString(targetObject.removeEventListener, originalRemoveEventListener);
        log(`${objectName}.removeEventListener patched.`);
    }


    /**
     * 修改对象上的属性,使其返回伪造的值。
     * @param {object} targetObject 目标对象 (e.g., document)
     * @param {object} propertiesToSpoof 属性描述对象
     * @param {string} objectName 对象名称
     */
    function spoofProperties(targetObject, propertiesToSpoof, objectName) {
        if (!targetObject) {
            warn(`Cannot spoof properties for invalid target: ${objectName}`);
            return;
        }
        for (const prop in propertiesToSpoof) {
            if (Object.prototype.hasOwnProperty.call(propertiesToSpoof, prop)) {
                try {
                    Object.defineProperty(targetObject, prop, propertiesToSpoof[prop]);
                    debug(`Spoofed ${objectName}.${prop}`);
                } catch (e) {
                    error(`Failed to spoof ${objectName}.${prop}:`, e);
                }
            }
        }
        log(`${objectName} properties spoofed.`);
    }

    /**
     * 清空或置空对象上的事件处理器属性。
     * @param {object} targetObject 目标对象
     * @param {string[]} eventHandlerNames 事件处理器名称数组
     * @param {string} objectName 对象名称
     */
    function nullifyEventHandlers(targetObject, eventHandlerNames, objectName) {
        if (!targetObject) {
            warn(`Cannot nullify event handlers for invalid target: ${objectName}`);
            return;
        }
        eventHandlerNames.forEach(handlerName => {
            try {
                Object.defineProperty(targetObject, handlerName, {
                    get: () => {
                        debug(`Access to ${objectName}.${handlerName} (get), returning undefined.`);
                        return undefined;
                    },
                    set: (newHandler) => {
                        log(`Attempt to set ${objectName}.${handlerName} blocked.`);
                        if (typeof newHandler === 'function') {
                             // 可以选择性地调用 newHandler,或者完全阻止
                             // debug(`(Blocked) Handler function was:`, newHandler);
                        }
                    },
                    configurable: true // 保持可配置,以便脚本可以多次运行或被其他脚本修改
                });
                debug(`Nullified ${objectName}.${handlerName}`);
            } catch (e) {
                error(`Failed to nullify ${objectName}.${handlerName}:`, e);
            }
        });
        log(`${objectName} on-event handlers nullified.`);
    }

    // --- 开始执行 ---

    log("Script starting...");

    // 1. 劫持 window 和 document 的 addEventListener/removeEventListener
    patchAddEventListener(window, "window");
    patchRemoveEventListener(window, "window"); // 也 patch removeEventListener 以保持一致性
    patchAddEventListener(document, "document");
    patchRemoveEventListener(document, "document");

    // 2. 修改 document 的属性
    spoofProperties(document, spoofedDocumentProperties, "document");

    // 3. 置空 document 和 window 上的事件处理器
    nullifyEventHandlers(document, eventHandlersToNullifyDocument, "document");
    nullifyEventHandlers(window, eventHandlersToNullifyWindow, "window");

    // 4. 对于 document.body,需要等待 DOMContentLoaded
    // 使用 MutationObserver 确保 body 存在时立即 patch,比 DOMContentLoaded 更早且更可靠
    const observer = new MutationObserver((mutations, obs) => {
        if (document.body) {
            patchAddEventListener(document.body, "document.body");
            patchRemoveEventListener(document.body, "document.body");
            // 对于 document.body,也可以考虑 nullify onmouseleave, onmouseout 等
            nullifyEventHandlers(document.body, ["onmouseleave", "onmouseout", "onblur", "onfocus"], "document.body");
            log("document.body patched via MutationObserver.");
            obs.disconnect(); // 完成任务后断开观察者
        }
    });

    if (document.body) { // 如果 body 已经存在 (不太可能在 document-start,但以防万一)
        patchAddEventListener(document.body, "document.body");
        patchRemoveEventListener(document.body, "document.body");
        nullifyEventHandlers(document.body, ["onmouseleave", "onmouseout", "onblur", "onfocus"], "document.body");
        log("document.body patched directly.");
    } else {
        observer.observe(document.documentElement || document, { childList: true, subtree: true });
    }


    // 5. 调试:劫持计时器 (如果 isDebug 为 true)
    if (isDebug) {
        const originalSetInterval = window.setInterval;
        window.setInterval = function(...args) {
            const id = originalSetInterval.apply(this, args);
            debug("calling window.setInterval", id, args);
            return id;
        };
        patchToString(window.setInterval, originalSetInterval);

        const originalSetTimeout = window.setTimeout;
        window.setTimeout = function(...args) {
            const id = originalSetTimeout.apply(this, args);
            debug("calling window.setTimeout", id, args);
            return id;
        };
        patchToString(window.setTimeout, originalSetTimeout);
        log("Timer functions (setInterval, setTimeout) wrapped for debugging.");
    }

    log("Script execution finished. Monitoring active.");

})();

然后再安装SuperCopy 超级复制插件