Unverified Commit d5a0dbed authored by rewine's avatar rewine Committed by GitHub
Browse files

wechat-uos: 4.0.0.21 -> 4.0.0.23 (#354378)

parents aa73b933 21107d7b
Loading
Loading
Loading
Loading
+0 −44
Original line number Diff line number Diff line
// taken from https://aur.archlinux.org/cgit/aur.git/tree/libuosdevicea.c?h=wechat-universal

/*
 * licensestub - compat layer for libuosdevicea
 * Copyright (C) 2024 Zephyr Lykos <self@mochaa.ws>
 * Copyright (C) 2024 Guoxin "7Ji" Pu <pugokushin@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */
#define _GNU_SOURCE

#include <string.h>

#define declare_string_getter(suffix, constant) void uos_get_##suffix(char *const restrict out) { if (out) strcpy(out, constant); }

declare_string_getter(mac,      // MAC address with colon stripped
    "000000000000")
declare_string_getter(hddsninfo,
    "SN")
declare_string_getter(hwserial, // MD5 of hddsninfo
    "92666505ce75444ee14be2ebc2f10a60")
declare_string_getter(mb_sn,    // hardcoded
    "E50022008800015957007202c59a1a8-3981-2020-0810-204909000000")
declare_string_getter(osver, 
    "UnionTech OS Desktop")
declare_string_getter(licensetoken, 
    "djEsdjEsMSwyLDk5QUFFN0FBQVdRQjk5OFhKS0FIU1QyOTQsMTAsOTI2NjY1MDVjZTc1NDQ0ZWUxNGJlMmViYzJmMTBhNjAsQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE6ZjA3NjAwYzZkNmMyMDkyMDBkMzE5YzU2OThmNTc3MGRlYWY1NjAyZTY5MzUxZTczNjI2NjlhNzIyZTBkNTJiOTNhYzk0MmM3YTNkZTgxNjIxMmUwMDA1NTUwODg4N2NlMDQ4ODMyNTExY2JhNGFiMjdmYzlmZjMyYzFiNTYwNjMwZDI3ZDI2NmE5ZGIxZDQ0N2QxYjNlNTNlNTVlOTY1MmU5YTU4OGY0NWYzMTMwZDE0NDc4MTRhM2FmZjRlZGNmYmNkZjhjMmFiMDc5OWYwNGVmYmQ2NjdiNGYwYzEwNDhkYzExNjYwZWU1NTdlNTdmNzBlNjA1N2I0NThkMDgyOA==")

int uos_is_active() {
    return 0;
}
+0 −85
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
, stdenv
, lib
, fetchurl
, requireFile
, dpkg
, nss
, nspr
@@ -45,21 +44,6 @@
, libnotify
, buildFHSEnv
, writeShellScript
, /**
  License for wechat-uos, packed in a gz archive named "license.tar.gz".
  It should have the following files:
  license.tar.gz
  ├── etc
  │   ├── lsb-release
  │   └── os-release
  └── var
      ├── lib
      │   └── uos-license
      │       └── .license.json
      └── uos
          └── .license.key
  */
  uosLicense ? null
}:
let
  # zerocallusedregs hardening breaks WeChat
@@ -72,79 +56,16 @@ let
    name = "wechat-uos-env";
    buildCommand = ''
      mkdir -p $out/etc
      mkdir -p $out/lib/license
      mkdir -p $out/usr/bin
      mkdir -p $out/usr/share
      mkdir -p $out/opt
      mkdir -p $out/var

      ln -s ${wechat}/opt/* $out/opt/
      ln -s ${wechat}/usr/lib/wechat-uos/license/etc/os-release  $out/etc/os-release
      ln -s ${wechat}/usr/lib/wechat-uos/license/etc/lsb-release  $out/etc/lsb-release
      ln -s ${wechat}/usr/lib/wechat-uos/license/var/*  $out/var/
      ln -s ${wechat}/usr/lib/wechat-uos/license/libuosdevicea.so $out/lib/license/
    '';
    preferLocalBuild = true;
  };

  uosLicenseUnzipped = stdenvNoCC.mkDerivation {
    name = "uos-license-unzipped";
    src =
      if uosLicense == null then
        requireFile
          {
            name = "license.tar.gz";
            url = "https://www.uniontech.com";
            hash = "sha256-U3YAecGltY8vo9Xv/h7TUjlZCyiIQdgSIp705VstvWk=";
          } else uosLicense;

    installPhase = ''
      runHook preInstall

      mkdir -p $out
      cp -r * $out/

      runHook postInstall
    '';
    outputHashAlgo = "sha256";
    outputHashMode = "recursive";
    outputHash = "sha256-pNftwtUZqBsKBSPQsEWlYLlb6h2Xd9j56ZRMi8I82ME=";
  };

  libuosdevicea = stdenv.mkDerivation rec {
    name = "libuosdevicea";
    src = ./libuosdevicea.c;

    unpackPhase = ''
      runHook preUnpack

      cp ${src} libuosdevicea.c

      runHook postUnpack
    '';

    buildPhase = ''
      runHook preBuild

      $CC -shared -fPIC -o libuosdevicea.so libuosdevicea.c

      runHook postBuild
    '';

    installPhase = ''
      runHook preInstall

      mkdir -p $out/lib
      cp libuosdevicea.so $out/lib/

      runHook postInstall
    '';

    meta = with lib; {
      license = licenses.gpl2Plus;
    };
  };

  wechat-uos-runtime = with xorg; [
    # Make sure our glibc without hardening gets picked up first
    (lib.hiPrio glibcWithoutHardening)
@@ -231,8 +152,6 @@ let
        };
      }.${stdenv.system} or (throw "${pname}-${version}: ${stdenv.system} is unsupported.");

      inherit uosLicense;

      nativeBuildInputs = [ dpkg ];

      unpackPhase = ''
@@ -250,10 +169,6 @@ let

        cp -r wechat-uos/* $out

        mkdir -pv $out/usr/lib/wechat-uos/license
        ln -s ${uosLicenseUnzipped}/* $out/usr/lib/wechat-uos/license/
        ln -s ${libuosdevicea}/lib/libuosdevicea.so $out/usr/lib/wechat-uos/license/

        runHook postInstall
      '';

+8 −8
Original line number Diff line number Diff line
# Generated by ./update.sh - do not update manually!
# Last updated: 2024-11-04
# Last updated: 2024-11-08
{
  version = "4.0.0.21";
  amd64_url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_4.0.0.21_amd64.deb";
  arm64_url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_4.0.0.21_arm64.deb";
  loongarch64_url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_4.0.0.21_loongarch64.deb";
  amd64_hash = "sha256-1tO8ARt2LuCwPz7rO25/9dTOIf9Rwqc9TdqiZTTojRk=";
  arm64_hash = "sha256-Xl+bT/WXZ58rchvUBAMfcdqMxOIRxp5qyMRE/FvEC9I=";
  loongarch64_hash = "sha256-b6j3y10HOdRvKoTTY9j2jGoM/W9XAjdIrQNZA9ddmUw=";
  version = "4.0.0.23";
  amd64_url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_4.0.0.23_amd64.deb";
  arm64_url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_4.0.0.23_arm64.deb";
  loongarch64_url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_4.0.0.23_loongarch64.deb";
  amd64_hash = "sha256-Q3gmo83vJddj9p4prhBHm16LK6CAtW3ltd5j4FqPcgM=";
  arm64_hash = "sha256-oIsPbEkw1+zXpzvXAVEdmykXjb5zulHATwnrnhsxkPc=";
  loongarch64_hash = "sha256-grj9yGHZZag20l5s8IgcknvUvz0fBHkakgKsOe+rhmI=";
}