Inclusion Criteria:  Male or female, age ≥ 18 years. Histologically or cytologically confirmed diagnosis of unresectable locally advanced or metastatic (stage IIIB-IV) NSCLC. Previously treated with a PD-1 inhibitor, alone or in combination with another systemic therapy, and have unequivocal progressive disease confirmed by imaging or pathology. The PD-1 inhibitor must be the products already in the market. Previously received at least 2 systemic chemotherapy regimens (containing platinum is required). Tumor tissue can be provided for research. ECOG performance status of 0 or 1. Have at least one measurable target lesion as defined by RECIST v.1.1. The following laboratory results within 7 days prior to study drug administration: Hemoglobin ≥90g/L independent of transfusion, Neutrophils ≥1.5×109/L, Platelets ≥90×109/L, Creatinine ≤1.5×ULN, Bilirubin ≤1.5×ULN (unless known Gilbert's disease where it must be ≤3×ULN), AST and ALT ≤2.5×ULN (unless known hepatic metastasis where it must be ≤5×ULN); INR≤1.5×ULN, PT and aPTT ≤1.5×ULN. Life expectancy ≥12 weeks. Have the ability to understand and the willingness to sign a written informed consent document.  Exclusion Criteria:  Prior use of a PDL1 or PDL2, anti-CTLA4 antibody or any other antibody or drug that specifically targets immune checkpoint pathway. Prior use of HDAC inhibitor. Known history of intolerance to PD-1 inhibitor treatment. Known driver genes mutation (EGFR, ALK, ROS1 or RET). Use of any anti-tumor therapy or investigational agent and device within 28 days before the first dose of study drug; or received thoracic radiation >30Gy within 6 months before the first dose. Use of systemic immunosuppressive therapy within 28 days before the first dose of study drug. Inhaled or topical steroids and physiological dose of systemic glucocorticoid (≤10 mg daily prednisone equivalents) are permitted. Received a live vaccine within 28 days before the first dose of study drug or planned to receive during the study period. Note: Seasonal influenza vaccines for injection are generally inactivated flu vaccines and are allowed; and COVID-19 vaccine also are allowed. Received major surgery (craniotomy, thoracotomy or laparotomy) within 28 days before the first dose of study drug, or there are still serious and unhealed wounds, ulcers or fractures judged by the investigator during the screening period. Known history of allogeneic organ transplantation and allogeneic hematopoietic stem cell transplantation. Before the first dose of study drug, subjects who has not recovered ( ≤ Grade 1 defined by CTCAE V5.0) from AEs due to prior anti-cancer therapy. Except for hair loss, or laboratory test abnormalities assessed by the investigator as clinically insignificant. Subjects with obvious clinical symptoms or need drainage of pleural effusion, ascites and pericardial effusion, or who received drainage for the purpose of treatment within 1 month before the first dose of study drug. Active autoimmune disease that has required systemic treatment in past 2 years (i.e., corticosteroids, or immunosuppressive drugs). Replacement therapy (e.g., thyroxine, insulin, or physiologic corticosteroid replacement therapy for adrenal or pituitary insufficiency) is not considered a form of systemic treatment and are allowed. Known central nervous system (CNS) metastases and/or carcinomatous meningitis. Previously treated brain metastases may be an exception if stable and specific other criteria are met. Uncontrollable or major cardiovascular and cerebrovascular diseases, including, but not limited to:  1)Congestive heart failure (New York Heart Association Grade II or above); unstable angina or myocardial infarction within the previous 6 months; or cardiac arrhythmia requiring treatment; or left ventricular ejection fraction (LVEF)<50%; 2)Primary cardiomyopathy (e.g., dilated cardiomyopathy, hypertrophic cardiomyopathy, arrhythmogenic right ventricular cardiomyopathy, restrictive cardiomyopathy, amorphous cardiomyopathy); 3)History of clinically significant QTcF interval prolongation, or a QTcF interval > 470 msec(female) or > 470 msec(male) during the screening period.  4)Symptomatic coronary heart disease requiring medical management during the screening period.  5)Cerebrovascular accidents (i.e., cerebral hemorrhage, cerebral infarction, transient ischemic attack) within the previous 6 months; 15.Active bleeding with significant clinical significance within the previous 2 months; or subject who is taking anticoagulants, or subject with clear high-risk bleeding tendency during the screening period.  16.Suspected interstitial lung disease (ILD) or pulmonary fibrosis or pulmonary inflammation requiring treatment; or history of lung disease treated with oral or intravenous steroids within the previous 6 months; or immune-related pneumonia after previous treatment with PD-1 inhibitors.  17.Obvious gastrointestinal abnormalities during the screening period, which may affect the intake, transport or absorption of drugs; or history of gastrointestinal perforation and / or fistula; or history of peptic ulcer within the previous 6 months or intestinal obstruction within the previous 3 months.  18.Urinary protein ≥ 2+ and quantitative urinary protein ≥ 1g/24 h during the screening period; 19.Known active pulmonary tuberculosis, or subject who is receiving antituberculous treatment or having received antituberculous treatment within the previous 1 years.  20.Active infection requiring intravenous therapy; or severe infection within 28 days before the first dose of study drug.  21.Active hepatitis B (HBsAg and HBV DNA positive), or hepatitis C (HCV antibody test and HCV RNA positive); known HIV positive or history of AIDS or other serious infectious diseases.  22.History of pulmonary embolism within the previous 6 months or deep venous thrombosis or any other serious venous thromboembolic event within the previous 3 months.  23.History of second malignancy, except for carcinoma in situ with adequate treatment and no evidence of disease recurrence, non-melanomatous skin cancer or lentiginous melanoma, completely relieved for at least 2 years before the first dose of study drug and estimated that no other treatment is required during the study period.  24.Contraindications to any of the study drug ingredients. 25.History of hypersensitivity to monoclonal antibody, Chidamide, study drug, or any of its excipients.  26.History of alcohol or drug abuse. 27.Unwilling or unable to comply with procedures required in this protocol. 28.Pregnant or breast-feeding women. 29.Women of childbearing age or spouses of male patients who are unwilling or unable to use effective methods for contraception during the whole treatment period of this trial and within 12 weeks after the last use of Chidamide or within 150 days after the last use of Envafolimab (whichever is the latest).