Evolution API / Evolution Go is an open-source WhatsApp integration API
Go baileyscloud-apievo-apievo-goevolutionevolution-apievolution-gogolangwhatsappwhatsapp-botwhatsmeow
sync: 0.6.1 from main (d2270ddac1307da38af1affd55840e19d9c4a298)
github-actions[bot]e319b8b8d8fa
diff --git a/.gitignore b/.gitignoreindex 587b9ae..03ad15e 100644--- a/.gitignore+++ b/.gitignore@@ -7,4 +7,3 @@ coverage.*.idea/.vscode/.DS_Store-.cursorrulesdiff --git a/.gitmodules b/.gitmodulesnew file mode 100644index 0000000..8cfaa3f--- /dev/null+++ b/.gitmodules@@ -0,0 +1,3 @@+[submodule "whatsmeow-lib"]+ path = whatsmeow-lib+ url = https://github.com/EvolutionAPI/whatsmeow.gitdiff --git a/LICENSE b/LICENSEindex 2eb13cb..3c78007 100644--- a/LICENSE+++ b/LICENSE@@ -1,3 +1,4 @@+Apache LicenseVersion 2.0, January 2004http://www.apache.org/licenses/@@ -9,7 +10,8 @@"License" shall mean the terms and conditions for use, reproduction,and distribution as defined by Sections 1 through 9 of this document.- "Licensor" shall mean the copyright owner or entity granting the License.+ "Licensor" shall mean the copyright owner or entity authorized by+ the copyright owner that is granting the License."Legal Entity" shall mean the union of the acting entity and allother entities that control, are controlled by, or are under common@@ -34,45 +36,40 @@"Work" shall mean the work of authorship, whether in Source orObject form, made available under the License, as indicated by acopyright notice that is included in or attached to the work- (which shall not include communications that are solely written- by copyright holders to be excluded from the License).+ (an example is provided in the Appendix below)."Derivative Works" shall mean any work, whether in Source or Object- form, that is based upon (or derived from) the Work and for which the+ form, that is based on (or derived from) the Work and for which theeditorial revisions, annotations, elaborations, or other modificationsrepresent, as a whole, an original work of authorship. For the purposesof this License, Derivative Works shall not include works that remainseparable from, or merely link (or bind by name) to the interfaces of,- the Work and derivative works thereof.+ the Work and Derivative Works thereof."Contribution" shall mean any work of authorship, includingthe original version of the Work and any modifications or additionsto that Work or Derivative Works thereof, that is intentionally- submitted to Licensor for inclusion in the Work by the copyright owner+ submitted to the Licensor for inclusion in the Work by the copyright owneror by an individual or Legal Entity authorized to submit on behalf ofthe copyright owner. For the purposes of this definition, "submitted"means any form of electronic, verbal, or written communication sentto the Licensor or its representatives, including but not limited to- communication on electronic mailing lists, source code control- systems, and issue tracking systems that are managed by, or on behalf- of, the Licensor for the purpose of discussing and improving the Work,- but excluding communication that is conspicuously marked or otherwise+ communication on electronic mailing lists, source code control systems,+ and issue tracking systems that are managed by, or on behalf of, the+ Licensor for the purpose of discussing and improving the Work, but+ excluding communication that is conspicuously marked or otherwisedesignated in writing by the copyright owner as "Not a Contribution.""Contributor" shall mean Licensor and any individual or Legal Entity- on behalf of whom a Contribution has been received by Licensor and+ on behalf of whom a Contribution has been received by the Licensor andsubsequently incorporated within the Work.2. Grant of Copyright License. Subject to the terms and conditions ofthis License, each Contributor hereby grants to You a perpetual,worldwide, non-exclusive, no-charge, royalty-free, irrevocable- copyright license to use, reproduce, modify, merge, publish,- distribute, sublicense, and/or sell copies of the Work, and to- permit persons to whom the Work is furnished to do so, subject to- the following conditions:-- The above copyright notice and this permission notice shall be- included in all copies or substantial portions of the Work.+ copyright license to reproduce, prepare Derivative Works of,+ publicly display, publicly perform, sublicense, and distribute the+ Work and such Derivative Works in Source or Object form.3. Grant of Patent License. Subject to the terms and conditions ofthis License, each Contributor hereby grants to You a perpetual,@@ -110,7 +107,7 @@(d) If the Work includes a "NOTICE" text file as part of itsdistribution, then any Derivative Works that You distribute mustinclude a readable copy of the attribution notices contained- within such NOTICE file, excluding those notices that do not+ within such NOTICE file, excluding any notices that do notpertain to any part of the Derivative Works, in at least oneof the following places: within a NOTICE text file distributedas part of the Derivative Works; within the Source form or@@ -124,7 +121,7 @@that such additional attribution notices cannot be construedas modifying the License.- You may add Your own copyright notice to Your modifications and+ You may add Your own copyright statement to Your modifications andmay provide additional or different license terms and conditionsfor use, reproduction, or distribution of Your modifications, orfor any such Derivative Works as a whole, provided Your use,@@ -166,29 +163,20 @@other commercial damages or losses), even if such Contributorhas been advised of the possibility of such damages.- 9. Accepting Warranty or Support. You may choose to offer, and to- charge a fee for, warranty, support, indemnity or other liability- obligations and/or rights consistent with this License. However, in- accepting such obligations, You may act only on Your own behalf and- on Your sole responsibility, not on behalf of any other Contributor,- and only if You agree to indemnify, defend, and hold each Contributor- harmless for any liability incurred by, or claims asserted against,- such Contributor by reason of your accepting any such warranty or support.+ 9. Accepting Warranty or Additional Liability. While redistributing+ the Work or Derivative Works thereof, You may choose to offer,+ and charge a fee for, acceptance of support, warranty, indemnity,+ or other liability obligations and/or rights consistent with this+ License. However, in accepting such obligations, You may act only+ on Your own behalf and on Your sole responsibility, not on behalf+ of any other Contributor, and only if You agree to indemnify,+ defend, and hold each Contributor harmless for any liability+ incurred by, or claims asserted against, such Contributor by reason+ of your accepting any such warranty or additional liability.END OF TERMS AND CONDITIONS- APPENDIX: How to apply the Apache License to your work.-- To apply the Apache License to your work, attach the following- boilerplate notice, with the fields enclosed by brackets "[]"- replaced with your own identifying information. (Don't include- the brackets!) The text should be enclosed in the appropriate- comment syntax for the file format. We also recommend that a- file or class name and description of purpose be included on the- same page as the copyright notice for easier identification within- third-party archives.-- Copyright 2025 Evolution API+ Copyright 2026 Evolution FoundationLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.@@ -200,23 +188,4 @@distributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions and- limitations under the License.---ADDITIONAL CONDITIONS:--1. LOGO and copyright information: In the process of using Evolution Go API's- frontend components, you may not remove or modify the LOGO or copyright- information in the Evolution API console or applications. This restriction- is inapplicable to uses of Evolution Go API that do not involve its frontend- components.--2. Usage Notification Requirement: If Evolution Go API is used as part of any- project, including closed-source systems (e.g., proprietary software), the- user is required to display a clear notification within the system that- Evolution Go API is being utilized. This notification should be visible to- system administrators and accessible from the system's documentation or- settings page. Failure to comply with this requirement may result in the- necessity for a commercial license, as determined by the producer.--Please contact [email protected] to inquire about licensing matters.+ limitations under the License.\ No newline at end of filediff --git a/NOTICE b/NOTICEnew file mode 100644index 0000000..4796578--- /dev/null+++ b/NOTICE@@ -0,0 +1,7 @@+Evolution Foundation+Copyright 2026 Evolution Foundation++This product includes software developed by Evolution Foundation.++Trademark notice+"Evolution Foundation" and "Evolution" are trademarks of Evolution Foundation. The Evolution Foundation logo, wordmark, and Evolution Foundation visual identity are governed by the Evolution Foundation Trademark and Brand Assets Policy included in this repository.\ No newline at end of filediff --git a/TRADEMARKS.md b/TRADEMARKS.mdnew file mode 100644index 0000000..ff5297a--- /dev/null+++ b/TRADEMARKS.md@@ -0,0 +1,87 @@+# EVO AI TRADEMARK AND BRAND ASSETS POLICY++Version 1.0, 2026.03.02++"Evolution Foundation" and "Evolution" are trademarks of Evolution Foundation.+The "evoai" wordmark and the Evolution Foundation logo are trademarks of Evolution Foundation.++## 1. Scope and purpose++This policy governs the use of Evolution Foundation trademarks and Evolution Foundation brand assets. It is intended to protect users from confusion and to preserve the official Evolution Foundation Community Edition visual identity.++This policy applies to any use of:+(a) the product names and marks "Evolution Foundation" and "Evolution";+(b) the official logo and wordmark: the "evoai" wordmark with the neural network or molecule icon in neon green to the right;+(c) the copyright line "© 2026 Evolution Foundation"; and+(d) any materials that implement or express the Evolution Foundation official look and feel, including the Protected Visual Identity Elements listed in Section 3.++This policy does not change the software license for the source code, which is licensed under the Apache License 2.0. This policy controls only trademarks and brand assets.++## 2. Permitted trademark and brand asset use++2.1. You may truthfully refer to Evolution Foundation to describe that your software is based on, compatible with, or derived from this project, provided that such use does not imply endorsement by Evolution Foundation.++2.2. You may distribute and publicly host unmodified official builds of the Evolution Foundation Community Edition that include Evolution Foundation brand assets, provided that you comply with Section 3 and do not suggest endorsement beyond being an official unmodified build.++2.3. You may use Evolution Foundation marks in nominative ways, such as "based on Evolution Foundation",+provided that the use is accurate and does not create confusion.++## 3. Protected Visual Identity Elements (Brand Assets)++The following are the "Protected Visual Identity Elements":+(a) Product names and marks: "Evolution Foundation" and "Evolution";+(b) Official logo and wordmark: the "evoai" wordmark with the neural network+or molecule icon in neon green to the right;+(c) Copyright line: "© 2026 Evolution Foundation";+(d) Community Edition theme requirement: Dark Mode is the default and required+theme for the Community Edition user interface;+(e) Official palette for the Community Edition user interface:+ Background main: #0a0a0a+ Background cards and popovers: #0a0a0a+ Sidebar background: #171717+ Primary neon green: #00ffa7+ Primary green for light mode references: #01b274+ Main text: #fafafa+ Muted text: #a1a1a1+ Borders and inputs: #262626+ Muted background: #262626+ Ring and focus: #555555+ Destructive: approximately oklch 0.396 0.141 25.723+(f) Typography: ui sans serif, system ui, sans serif with base size 16px;+(g) Border radius: 0.625rem (10px) as the default component radius;+(h) Protected UI presentation elements:+ Left sidebar with icons and navigation in white or green accents+ Active navigation item highlighted with dark green background and neon+ green text+ Topbar with workspace selector showing "Evolution"+ Notification badge and user avatar on the top right+ Sidebar footer showing "Evolution Foundation / © 2026 Evolution Foundation / Documentation / Need help"++## 4. Restrictions for forks, modified versions, and redistributions++4.1. No modification of Protected Visual Identity Elements when using Evolution Foundation brand assets. If you distribute or publicly host any version of the user interface that uses Evolution Foundation brand assets, you may not remove, replace, modify, disable, or bypass any Protected Visual Identity Element.++4.2. Modified UI must remove Evolution Foundation brand assets.+If you distribute or publicly host a modified user interface or user experience (including changes to branding or visual identity), you must:+(a) remove and replace all Evolution Foundation trademarks and brand assets from the user+interface, product name display, and related marketing materials for that+distribution; and+(b) choose a name and branding that are clearly distinct from Evolution Foundation.++4.3. No endorsement.+You may not use Evolution Foundation trademarks or brand assets in a way that implies Evolution Foundation sponsors, endorses, or is affiliated with your distribution, except for unmodified official builds.++4.4. No derivative works of the logo and wordmark.+You may not modify, adapt, recolor, redesign, or create derivative works of the Evolution Foundation logo or wordmark.++## 5. Permission requests++Any use not expressly permitted by this policy requires prior written permission from Evolution Foundation.++## 6. Enforcement and termination++Any violation of this policy terminates your permission to use Evolution Foundation brand assets. You must promptly cease use and remove Evolution Foundation trademarks and brand assets from your distribution and any public hosting.++## 7. Disclaimer++This policy is provided "as is" and does not grant any rights beyond what is expressly stated. All rights not expressly granted are reserved by Evolution Foundation.\ No newline at end of filediff --git a/cmd/evolution-go/main.go b/cmd/evolution-go/main.goindex 3eccf86..95e7dee 100644--- a/cmd/evolution-go/main.go+++ b/cmd/evolution-go/main.go@@ -68,14 +68,13 @@ import (var devMode = flag.Bool("dev", false, "Enable development mode")-var version = "dev"+var version = readVersion()-func init() {- if version == "dev" {- if v, err := os.ReadFile("VERSION"); err == nil {- version = strings.TrimSpace(string(v))- }+func readVersion() string {+ if v, err := os.ReadFile("VERSION"); err == nil {+ return strings.TrimSpace(string(v))}+ return "0.0.0"}func setupRouter(db *gorm.DB, authDB *sql.DB, sqliteDB *sql.DB, config *config.Config, conn *amqp.Connection, exPath string, runtimeCtx *core.RuntimeContext) *gin.Engine {diff --git a/evolution-go b/evolution-gonew file mode 100755index 0000000..5d7c229Binary files /dev/null and b/evolution-go differdiff --git a/pkg/core/c0.go b/pkg/core/c0.goindex 10f963a..e1dd705 100644--- a/pkg/core/c0.go+++ b/pkg/core/c0.go@@ -24,14 +24,17 @@ import ("time")+var _k1 = []byte{0xe8, 0x1d, 0x6b, 0x81, 0x27, 0xa5, 0x5e, 0x63, 0x7a, 0xfd, 0xa7, 0x47, 0x6b, 0x9c, 0xde, 0xa0, 0xa0, 0x05, 0xe9, 0x8f, 0x58, 0x17, 0xac, 0x43, 0xcd, 0xb4, 0x35, 0x97, 0x02, 0x10, 0x27, 0x55, 0x1c, 0x28, 0x58, 0x4b, 0x0d, 0x24, 0x64, 0x60, 0x7e, 0x2a}+var _k0 = []byte{0x80, 0x69, 0x1f, 0xf1, 0x54, 0x9f, 0x71, 0x4c, 0x16, 0x94, 0xc4, 0x22, 0x05, 0xef, 0xbb, 0x8e, 0xc5, 0x73, 0x86, 0xe3, 0x2d, 0x63, 0xc5, 0x2c, 0xa3, 0xd2, 0x5a, 0xe2, 0x6c, 0x74, 0x46, 0x21, 0x75, 0x47, 0x36, 0x65, 0x6e, 0x4b, 0x09, 0x4e, 0x1c, 0x58}+var (- encodedEP string- xorKey string+ _83 string+ _xazo string)-func _d0() string {- if encodedEP != "" && xorKey != "" {- return decodeXOR(encodedEP, xorKey)+func _40hs() string {+ if _83 != "" && _xazo != "" {+ return _zh(_83, _xazo)}parts := [...]string{"h", "tt", "ps", "://", "li", "ce", "nse", ".", "ev", "ol", "ut", "io", "nf", "ou", "nd", "at", "io", "n.", "co", "m.", "br"}var s string@@ -41,9 +44,9 @@ func _d0() string {return s}-func decodeXOR(enc, key string) string {- encBytes := hexDec(enc)- keyBytes := hexDec(key)+func _zh(enc, key string) string {+ encBytes := _5b7(enc)+ keyBytes := _5b7(key)if len(keyBytes) == 0 {return ""}@@ -54,18 +57,18 @@ func decodeXOR(enc, key string) string {return string(out)}-func hexDec(s string) []byte {+func _5b7(s string) []byte {if len(s)%2 != 0 {return nil}b := make([]byte, len(s)/2)for i := 0; i < len(s); i += 2 {- b[i/2] = hexVal(s[i])<<4 | hexVal(s[i+1])+ b[i/2] = _vtc(s[i])<<4 | _vtc(s[i+1])}return b}-func hexVal(c byte) byte {+func _vtc(c byte) byte {switch {case c >= '0' && c <= '9':return c - '0'@@ -77,62 +80,62 @@ func hexVal(c byte) byte {return 0}-var _h0 = &http.Client{Timeout: 10 * time.Second}+var _ml9 = &http.Client{Timeout: 10 * time.Second}-func _sg(body []byte, secret string) string {+func _pq(body []byte, secret string) string {mac := hmac.New(sha256.New, []byte(secret))mac.Write(body)return hex.EncodeToString(mac.Sum(nil))}-func _ps(path string, payload interface{}, _a0 string) (*http.Response, error) {+func _c14s(path string, payload interface{}, _d1e9 string) (*http.Response, error) {body, err := json.Marshal(payload)if err != nil {return nil, err}- url := _d0() + path+ url := _40hs() + pathreq, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(body))if err != nil {return nil, err}req.Header.Set("Content-Type", "application/json")- req.Header.Set("X-Api-Key", _a0)- req.Header.Set("X-Signature", _sg(body, _a0))+ req.Header.Set("X-Api-Key", _d1e9)+ req.Header.Set("X-Signature", _pq(body, _d1e9))- return _h0.Do(req)+ return _ml9.Do(req)}-func _gu(path string) (*http.Response, error) {- url := _d0() + path- return _h0.Get(url)+func _46(path string) (*http.Response, error) {+ url := _40hs() + path+ return _ml9.Get(url)}-func _pu(path string, payload interface{}) (*http.Response, error) {+func _0r(path string, payload interface{}) (*http.Response, error) {body, err := json.Marshal(payload)if err != nil {return nil, err}- url := _d0() + path+ url := _40hs() + pathreq, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(body))if err != nil {return nil, err}req.Header.Set("Content-Type", "application/json")- return _h0.Do(req)+ return _ml9.Do(req)}-func _re(resp *http.Response) error {+func _36l2(resp *http.Response) error {b, _ := io.ReadAll(resp.Body)- var errBody struct {+ var _f3mf struct {Message string `json:"message"`Error string `json:"error"`}- if err := json.Unmarshal(b, &errBody); err == nil {- msg := errBody.Message+ if err := json.Unmarshal(b, &_f3mf); err == nil {+ msg := _f3mf.Messageif msg == "" {- msg = errBody.Error+ msg = _f3mf.Error}if msg != "" {return fmt.Errorf("%s (HTTP %d)", strings.ToLower(msg), resp.StatusCode)@@ -154,123 +157,123 @@ func (RuntimeConfig) TableName() string {}const (- _ck0 = "instance_id"- _ck1 = "api_key"- _ck2 = "_a7"- _ck3 = "customer_id"+ ConfigKeyInstanceID = "instance_id"+ ConfigKeyAPIKey = "api_key"+ ConfigKeyTier = "_i7xh"+ ConfigKeyCustomerID = "customer_id")-var _db0 *gorm.DB+var _to *gorm.DBfunc SetDB(db *gorm.DB) {- _db0 = db+ _to = db}func MigrateDB() error {- if _db0 == nil {+ if _to == nil {return fmt.Errorf("core: database not set, call SetDB first")}- return _db0.AutoMigrate(&RuntimeConfig{})+ return _to.AutoMigrate(&RuntimeConfig{})}-func _gc(key string) (string, error) {- if _db0 == nil {+func _o07s(key string) (string, error) {+ if _to == nil {return "", fmt.Errorf("core: database not set")}- var cfg RuntimeConfig- result := _db0.Where("key = ?", key).First(&cfg)- if result.Error != nil {- return "", result.Error+ var _4k RuntimeConfig+ _2q := _to.Where("key = ?", key).First(&_4k)+ if _2q.Error != nil {+ return "", _2q.Error}- return cfg.Value, nil+ return _4k.Value, nil}-func _sc(key, value string) error {- if _db0 == nil {+func _y7(key, value string) error {+ if _to == nil {return fmt.Errorf("core: database not set")}- var cfg RuntimeConfig- result := _db0.Where("key = ?", key).First(&cfg)- if result.Error != nil {- return _db0.Create(&RuntimeConfig{Key: key, Value: value}).Error+ var _4k RuntimeConfig+ _2q := _to.Where("key = ?", key).First(&_4k)+ if _2q.Error != nil {+ return _to.Create(&RuntimeConfig{Key: key, Value: value}).Error}- return _db0.Model(&cfg).Update("value", value).Error+ return _to.Model(&_4k).Update("value", value).Error}-func _dc(key string) {- if _db0 == nil {+func _4k5p(key string) {+ if _to == nil {return}- _db0.Where("key = ?", key).Delete(&RuntimeConfig{})+ _to.Where("key = ?", key).Delete(&RuntimeConfig{})}-type _rtd struct {+type RuntimeData struct {APIKey stringTier stringCustomerID int}-func _lrd() (*_rtd, error) {- _a0, err := _gc(_ck1)- if err != nil || _a0 == "" {+func _rjz7() (*RuntimeData, error) {+ _d1e9, err := _o07s(ConfigKeyAPIKey)+ if err != nil || _d1e9 == "" {return nil, fmt.Errorf("no license found")}- _a7, _ := _gc(_ck2)- customerIDStr, _ := _gc(_ck3)+ _i7xh, _ := _o07s(ConfigKeyTier)+ customerIDStr, _ := _o07s(ConfigKeyCustomerID)customerID, _ := strconv.Atoi(customerIDStr)- return &_rtd{- APIKey: _a0,- Tier: _a7,+ return &RuntimeData{+ APIKey: _d1e9,+ Tier: _i7xh,CustomerID: customerID,}, nil}-func _srd(rd *_rtd) error {- if err := _sc(_ck1, rd.APIKey); err != nil {+func _pi(rd *RuntimeData) error {+ if err := _y7(ConfigKeyAPIKey, rd.APIKey); err != nil {return err}- if err := _sc(_ck2, rd.Tier); err != nil {+ if err := _y7(ConfigKeyTier, rd.Tier); err != nil {return err}if rd.CustomerID > 0 {- if err := _sc(_ck3, strconv.Itoa(rd.CustomerID)); err != nil {+ if err := _y7(ConfigKeyCustomerID, strconv.Itoa(rd.CustomerID)); err != nil {return err}}return nil}-func _rrd() {- _dc(_ck1)- _dc(_ck2)- _dc(_ck3)+func _jul3() {+ _4k5p(ConfigKeyAPIKey)+ _4k5p(ConfigKeyTier)+ _4k5p(ConfigKeyCustomerID)}-func _lid() (string, error) {- id, err := _gc(_ck0)+func _sj() (string, error) {+ id, err := _o07s(ConfigKeyInstanceID)if err == nil && len(id) == 36 {return id, nil}- id = _ghi()+ id = _g1()if id == "" {- id, err = _uuid()+ id, err = _bmj4()if err != nil {return "", err}}- if err := _sc(_ck0, id); err != nil {+ if err := _y7(ConfigKeyInstanceID, id); err != nil {return "", err}return id, nil}-func _ghi() string {+func _g1() string {hostname, _ := os.Hostname()- macAddr := _gpm()+ macAddr := _3yc()if hostname == "" && macAddr == "" {return ""}@@ -281,13 +284,13 @@ func _ghi() string {for i := 16; i < len(seed); i++ {h[i%16] ^= seed[i]}- h[6] = (h[6] & 0x0f) | 0x40 // _a8 4+ h[6] = (h[6] & 0x0f) | 0x40 // _1s8g 4h[8] = (h[8] & 0x3f) | 0x80 // variantreturn fmt.Sprintf("%08x-%04x-%04x-%04x-%012x",h[0:4], h[4:6], h[6:8], h[8:10], h[10:16])}-func _gpm() string {+func _3yc() string {interfaces, err := net.Interfaces()if err != nil {return ""@@ -303,7 +306,7 @@ func _gpm() string {return ""}-func _uuid() (string, error) {+func _bmj4() (string, error) {var b [16]byteif _, err := rand.Read(b[:]); err != nil {return "", err@@ -314,21 +317,20 @@ func _uuid() (string, error) {b[0:4], b[4:6], b[6:8], b[8:10], b[10:16]), nil}--var _s0 atomic.Value // set during activation+var _5m atomic.Value // set during activationfunc init() {- _s0.Store([]byte{0})+ _5m.Store([]byte{0})}func ComputeSessionSeed(instanceName string, rc *RuntimeContext) []byte {- if rc == nil || !rc._a2.Load() {+ if rc == nil || !rc._oq5.Load() {return nil // Will cause panic in caller — intentional}h := sha256.New()h.Write([]byte(instanceName))- h.Write([]byte(rc._a0))- salt, _ := _s0.Load().([]byte)+ h.Write([]byte(rc._d1e9))+ salt, _ := _5m.Load().([]byte)h.Write(salt)return h.Sum(nil)[:16]}@@ -341,20 +343,20 @@ func ValidateRouteAccess(rc *RuntimeContext) uint64 {return binary.LittleEndian.Uint64(h[:8])}-func DeriveInstanceToken(_a1 string, rc *RuntimeContext) string {- if rc == nil || !rc._a2.Load() {+func DeriveInstanceToken(_gj string, rc *RuntimeContext) string {+ if rc == nil || !rc._oq5.Load() {return ""}- h := sha256.Sum256([]byte(_a1 + rc._a0))- return _he(h[:8])+ h := sha256.Sum256([]byte(_gj + rc._d1e9))+ return _tuvw(h[:8])}-func _he(b []byte) string {- const hextable = "0123456789abcdef"+func _tuvw(b []byte) string {+ const _s53 = "0123456789abcdef"dst := make([]byte, len(b)*2)for i, v := range b {- dst[i*2] = hextable[v>>4]- dst[i*2+1] = hextable[v&0x0f]+ dst[i*2] = _s53[v>>4]+ dst[i*2+1] = _s53[v&0x0f]}return string(dst)}@@ -363,85 +365,85 @@ func ActivateIntegrity(rc *RuntimeContext) {if rc == nil {return}- h := sha256.Sum256([]byte(rc._a0 + rc._a1 + "ev0"))- _s0.Store(h[:])+ h := sha256.Sum256([]byte(rc._d1e9 + rc._gj + "ev0"))+ _5m.Store(h[:])}const (- _p2 = 30 * time.Minute+ hbInterval = 30 * time.Minute)type RuntimeContext struct {- _a0 string- _a9 string // GLOBAL_API_KEY from .env — used as token for licensing check- _a1 string- _a2 atomic.Bool- _a3 [32]byte // Derived from activation — required by ValidateContext+ _d1e9 string+ _96f2 string // GLOBAL_API_KEY from .env — used as token for licensing check+ _gj string+ _oq5 atomic.Bool+ _z1uh [32]byte // Derived from activation — required by ValidateContextmu sync.RWMutex- _a5 string // Registration URL shown to users before activation- _a6 string // Registration token for polling- _a7 string- _a8 string+ _34r string // Registration URL shown to users before activation+ _8344 string // Registration token for polling+ _i7xh string+ _1s8g string}func (rc *RuntimeContext) ContextHash() [32]byte {rc.mu.RLock()defer rc.mu.RUnlock()- return rc._a3+ return rc._z1uh}func (rc *RuntimeContext) IsActive() bool {- return rc._a2.Load()+ return rc._oq5.Load()}func (rc *RuntimeContext) RegistrationURL() string {rc.mu.RLock()defer rc.mu.RUnlock()- return rc._a5+ return rc._34r}func (rc *RuntimeContext) APIKey() string {rc.mu.RLock()defer rc.mu.RUnlock()- return rc._a0+ return rc._d1e9}func (rc *RuntimeContext) InstanceID() string {- return rc._a1+ return rc._gj}-func InitializeRuntime(_a7, _a8, _a9 string) *RuntimeContext {- if _a7 == "" {- _a7 = "evolution-go"+func InitializeRuntime(_i7xh, _1s8g, _96f2 string) *RuntimeContext {+ if _i7xh == "" {+ _i7xh = "evolution-go"}- if _a8 == "" {- _a8 = "unknown"+ if _1s8g == "" {+ _1s8g = "unknown"}rc := &RuntimeContext{- _a7: _a7,- _a8: _a8,- _a9: _a9,+ _i7xh: _i7xh,+ _1s8g: _1s8g,+ _96f2: _96f2,}- id, err := _lid()+ id, err := _sj()if err != nil {log.Fatalf("[runtime] failed to initialize instance: %v", err)}- rc._a1 = id+ rc._gj = id- rd, err := _lrd()+ rd, err := _rjz7()if err == nil && rd.APIKey != "" {- rc._a0 = rd.APIKey+ rc._d1e9 = rd.APIKeyfmt.Printf(" ✓ License found: %s...%s\n", rd.APIKey[:8], rd.APIKey[len(rd.APIKey)-4:])- rc._a3 = sha256.Sum256([]byte(rc._a0 + rc._a1))- rc._a2.Store(true)+ rc._z1uh = sha256.Sum256([]byte(rc._d1e9 + rc._gj))+ rc._oq5.Store(true)ActivateIntegrity(rc)fmt.Println(" ✓ License activated successfully")go func() {- if err := _ai(rc, _a8); err != nil {+ if err := _5tmd(rc, _1s8g); err != nil {fmt.Printf(" ⚠ Remote activation notice failed (non-blocking): %v\n", err)}}()@@ -455,47 +457,47 @@ func InitializeRuntime(_a7, _a8, _a9 string) *RuntimeContext {fmt.Println(" API endpoints will return 503 until license is activated.")fmt.Println(" Use GET /license/register to get the registration URL.")fmt.Println()- rc._a2.Store(false)+ rc._oq5.Store(false)}return rc}-func (rc *RuntimeContext) _ca(authCodeOrKey, _a7 string, customerID int) error {- _a0, err := _rk(authCodeOrKey)+func (rc *RuntimeContext) _2r(authCodeOrKey, _i7xh string, customerID int) error {+ _d1e9, err := _rbx(authCodeOrKey)if err != nil {return fmt.Errorf("key exchange failed: %w", err)}rc.mu.Lock()- rc._a0 = _a0- rc._a5 = ""- rc._a6 = ""+ rc._d1e9 = _d1e9+ rc._34r = ""+ rc._8344 = ""rc.mu.Unlock()- if err := _srd(&_rtd{- APIKey: _a0,- Tier: _a7,+ if err := _pi(&RuntimeData{+ APIKey: _d1e9,+ Tier: _i7xh,CustomerID: customerID,}); err != nil {fmt.Printf(" ⚠ Warning: could not save license: %v\n", err)}- if err := _ai(rc, rc._a8); err != nil {+ if err := _5tmd(rc, rc._1s8g); err != nil {return err}rc.mu.Lock()- rc._a3 = sha256.Sum256([]byte(rc._a0 + rc._a1))+ rc._z1uh = sha256.Sum256([]byte(rc._d1e9 + rc._gj))rc.mu.Unlock()- rc._a2.Store(true)+ rc._oq5.Store(true)ActivateIntegrity(rc)- fmt.Printf(" ✓ License activated! Key: %s...%s (_a7: %s)\n",- _a0[:8], _a0[len(_a0)-4:], _a7)+ fmt.Printf(" ✓ License activated! Key: %s...%s (_i7xh: %s)\n",+ _d1e9[:8], _d1e9[len(_d1e9)-4:], _i7xh)go func() {- if err := _hb(rc, 0); err != nil {+ if err := _yry(rc, 0); err != nil {fmt.Printf(" ⚠ First heartbeat failed: %v\n", err)}}()@@ -507,10 +509,10 @@ func ValidateContext(rc *RuntimeContext) (bool, string) {if rc == nil {return false, ""}- if !rc._a2.Load() {+ if !rc._oq5.Load() {return false, rc.RegistrationURL()}- expected := sha256.Sum256([]byte(rc._a0 + rc._a1))+ expected := sha256.Sum256([]byte(rc._d1e9 + rc._gj))actual := rc.ContextHash()if expected != actual {return false, ""@@ -558,17 +560,17 @@ func LicenseRoutes(eng *gin.Engine, rc *RuntimeContext) {lic.GET("/status", func(c *gin.Context) {status := "inactive"if rc.IsActive() {- status = "_a2"+ status = "_oq5"}resp := gin.H{"status": status,- "instance_id": rc._a1,+ "instance_id": rc._gj,}rc.mu.RLock()- if rc._a0 != "" {- resp["api_key"] = rc._a0[:8] + "..." + rc._a0[len(rc._a0)-4:]+ if rc._d1e9 != "" {+ resp["api_key"] = rc._d1e9[:8] + "..." + rc._d1e9[len(rc._d1e9)-4:]}rc.mu.RUnlock()@@ -578,14 +580,14 @@ func LicenseRoutes(eng *gin.Engine, rc *RuntimeContext) {lic.GET("/register", func(c *gin.Context) {if rc.IsActive() {c.JSON(http.StatusOK, gin.H{- "status": "_a2",- "message": "License is already _a2",+ "status": "_oq5",+ "message": "License is already _oq5",})return}rc.mu.RLock()- existingURL := rc._a5+ existingURL := rc._34rrc.mu.RUnlock()if existingURL != "" {@@ -597,15 +599,15 @@ func LicenseRoutes(eng *gin.Engine, rc *RuntimeContext) {}payload := map[string]string{- "_a7": rc._a7,- "_a8": rc._a8,- "instance_id": rc._a1,+ "_i7xh": rc._i7xh,+ "_1s8g": rc._1s8g,+ "instance_id": rc._gj,}if redirectURI := c.Query("redirect_uri"); redirectURI != "" {payload["redirect_uri"] = redirectURI}- resp, err := _pu("/v1/register/init", payload)+ resp, err := _0r("/v1/register/init", payload)if err != nil {c.JSON(http.StatusBadGateway, gin.H{"error": "Failed to contact licensing server",@@ -616,38 +618,38 @@ func LicenseRoutes(eng *gin.Engine, rc *RuntimeContext) {defer resp.Body.Close()if resp.StatusCode != http.StatusOK {- errBody := _re(resp)+ _f3mf := _36l2(resp)c.JSON(resp.StatusCode, gin.H{"error": "Licensing server error",- "details": errBody.Error(),+ "details": _f3mf.Error(),})return}- var initResult struct {+ var _0rb struct {RegisterURL string `json:"register_url"`Token string `json:"token"`}- json.NewDecoder(resp.Body).Decode(&initResult)+ json.NewDecoder(resp.Body).Decode(&_0rb)rc.mu.Lock()- rc._a5 = initResult.RegisterURL- rc._a6 = initResult.Token+ rc._34r = _0rb.RegisterURL+ rc._8344 = _0rb.Tokenrc.mu.Unlock()- fmt.Printf(" → Registration URL: %s\n", initResult.RegisterURL)+ fmt.Printf(" → Registration URL: %s\n", _0rb.RegisterURL)c.JSON(http.StatusOK, gin.H{"status": "pending",- "register_url": initResult.RegisterURL,+ "register_url": _0rb.RegisterURL,})})lic.GET("/activate", func(c *gin.Context) {if rc.IsActive() {c.JSON(http.StatusOK, gin.H{- "status": "_a2",- "message": "License is already _a2",+ "status": "_oq5",+ "message": "License is already _oq5",})return}@@ -661,9 +663,9 @@ func LicenseRoutes(eng *gin.Engine, rc *RuntimeContext) {return}- exchangeResp, err := _pu("/v1/register/exchange", map[string]string{+ exchangeResp, err := _0r("/v1/register/exchange", map[string]string{"authorization_code": code,- "instance_id": rc._a1,+ "instance_id": rc._gj,})if err != nil {c.JSON(http.StatusBadGateway, gin.H{@@ -675,22 +677,22 @@ func LicenseRoutes(eng *gin.Engine, rc *RuntimeContext) {defer exchangeResp.Body.Close()if exchangeResp.StatusCode != http.StatusOK {- errBody := _re(exchangeResp)+ _f3mf := _36l2(exchangeResp)c.JSON(exchangeResp.StatusCode, gin.H{"error": "Exchange failed",- "details": errBody.Error(),+ "details": _f3mf.Error(),})return}- var result struct {+ var _2q struct {APIKey string `json:"api_key"`- Tier string `json:"_a7"`+ Tier string `json:"_i7xh"`CustomerID int `json:"customer_id"`}- json.NewDecoder(exchangeResp.Body).Decode(&result)+ json.NewDecoder(exchangeResp.Body).Decode(&_2q)- if result.APIKey == "" {+ if _2q.APIKey == "" {c.JSON(http.StatusBadRequest, gin.H{"error": "Invalid or expired code","message": "The authorization code is invalid or has expired.",@@ -698,7 +700,7 @@ func LicenseRoutes(eng *gin.Engine, rc *RuntimeContext) {return}- if err := rc._ca(result.APIKey, result.Tier, result.CustomerID); err != nil {+ if err := rc._2r(_2q.APIKey, _2q.Tier, _2q.CustomerID); err != nil {c.JSON(http.StatusInternalServerError, gin.H{"error": "Activation failed","details": err.Error(),@@ -707,7 +709,7 @@ func LicenseRoutes(eng *gin.Engine, rc *RuntimeContext) {}c.JSON(http.StatusOK, gin.H{- "status": "_a2",+ "status": "_oq5","message": "License activated successfully!",})})@@ -716,7 +718,7 @@ func LicenseRoutes(eng *gin.Engine, rc *RuntimeContext) {func StartHeartbeat(ctx context.Context, rc *RuntimeContext, startTime time.Time) {go func() {- ticker := time.NewTicker(_p2)+ ticker := time.NewTicker(hbInterval)defer ticker.Stop()for {@@ -728,7 +730,7 @@ func StartHeartbeat(ctx context.Context, rc *RuntimeContext, startTime time.Timecontinue}uptime := int64(time.Since(startTime).Seconds())- if err := _hb(rc, uptime); err != nil {+ if err := _yry(rc, uptime); err != nil {fmt.Printf(" ⚠ Heartbeat failed (non-blocking): %v\n", err)}}@@ -737,15 +739,14 @@ func StartHeartbeat(ctx context.Context, rc *RuntimeContext, startTime time.Time}func Shutdown(rc *RuntimeContext) {- if rc == nil || rc._a0 == "" {+ if rc == nil || rc._d1e9 == "" {return}- _sd(rc)+ _5b3y(rc)}--func exchangeCode(code string) (_a0 string, err error) {- resp, err := _pu("/v1/register/exchange", map[string]string{+func _8g(code string) (_d1e9 string, err error) {+ resp, err := _0r("/v1/register/exchange", map[string]string{"authorization_code": code,})if err != nil {@@ -754,84 +755,84 @@ func exchangeCode(code string) (_a0 string, err error) {defer resp.Body.Close()if resp.StatusCode != http.StatusOK {- return "", _re(resp)+ return "", _36l2(resp)}- var result struct {+ var _2q struct {APIKey string `json:"api_key"`}- json.NewDecoder(resp.Body).Decode(&result)- if result.APIKey == "" {+ json.NewDecoder(resp.Body).Decode(&_2q)+ if _2q.APIKey == "" {return "", fmt.Errorf("exchange returned empty api_key")}- return result.APIKey, nil+ return _2q.APIKey, nil}-func _rk(authCodeOrKey string) (string, error) {- _a0, err := exchangeCode(authCodeOrKey)- if err == nil && _a0 != "" {- return _a0, nil+func _rbx(authCodeOrKey string) (string, error) {+ _d1e9, err := _8g(authCodeOrKey)+ if err == nil && _d1e9 != "" {+ return _d1e9, nil}return authCodeOrKey, nil}-func _ai(rc *RuntimeContext, _a8 string) error {- resp, err := _ps("/v1/activate", map[string]string{- "instance_id": rc._a1,- "_a8": _a8,- }, rc._a0)+func _5tmd(rc *RuntimeContext, _1s8g string) error {+ resp, err := _c14s("/v1/activate", map[string]string{+ "instance_id": rc._gj,+ "_1s8g": _1s8g,+ }, rc._d1e9)if err != nil {return err}defer resp.Body.Close()if resp.StatusCode != http.StatusOK {- return _re(resp)+ return _36l2(resp)}- var result struct {+ var _2q struct {Status string `json:"status"`}- json.NewDecoder(resp.Body).Decode(&result)+ json.NewDecoder(resp.Body).Decode(&_2q)- if result.Status != "_a2" {- return fmt.Errorf("activation returned status: %s", result.Status)+ if _2q.Status != "_oq5" {+ return fmt.Errorf("activation returned status: %s", _2q.Status)}return nil}-func _hb(rc *RuntimeContext, uptimeSeconds int64) error {- resp, err := _ps("/v1/heartbeat", map[string]any{- "instance_id": rc._a1,+func _yry(rc *RuntimeContext, uptimeSeconds int64) error {+ resp, err := _c14s("/v1/heartbeat", map[string]any{+ "instance_id": rc._gj,"uptime_seconds": uptimeSeconds,- "_a8": rc._a8,- }, rc._a0)+ "_1s8g": rc._1s8g,+ }, rc._d1e9)if err != nil {return err}defer resp.Body.Close()if resp.StatusCode != http.StatusOK {- return _re(resp)+ return _36l2(resp)}return nil}-func _sd(rc *RuntimeContext) {+func _5b3y(rc *RuntimeContext) {ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)defer cancel()body, _ := json.Marshal(map[string]string{- "instance_id": rc._a1,+ "instance_id": rc._gj,})- url := _d0() + "/v1/deactivate"+ url := _40hs() + "/v1/deactivate"req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(body))if err != nil {return}req.Header.Set("Content-Type", "application/json")- req.Header.Set("X-Api-Key", rc._a0)- req.Header.Set("X-Signature", _sg(body, rc._a0))- _h0.Do(req)+ req.Header.Set("X-Api-Key", rc._d1e9)+ req.Header.Set("X-Signature", _pq(body, rc._d1e9))+ _ml9.Do(req)}diff --git a/pkg/sendMessage/service/send_service.go b/pkg/sendMessage/service/send_service.goindex 4bf3412..09db21a 100644--- a/pkg/sendMessage/service/send_service.go+++ b/pkg/sendMessage/service/send_service.go@@ -620,6 +620,7 @@ func (s *sendService) sendLinkWithRetry(data *LinkStruct, instance *instance_modfileData, _ = io.ReadAll(resp.Body)}+ previewType := waE2E.ExtendedTextMessage_VIDEOmsg := &waE2E.Message{ExtendedTextMessage: &waE2E.ExtendedTextMessage{Text: &data.Text,@@ -627,6 +628,7 @@ func (s *sendService) sendLinkWithRetry(data *LinkStruct, instance *instance_modMatchedText: &matchedText,JPEGThumbnail: fileData,Description: &data.Description,+ PreviewType: &previewType,},}diff --git a/whatsmeow-lib b/whatsmeow-libnew file mode 160000index 0000000..28cca79--- /dev/null+++ b/whatsmeow-lib@@ -0,0 +1 @@+Subproject commit 28cca7935ac05814b8ad745d0c3a5e6dc2372560